If this model is nested inside the Spree model, it should be placed at
`app/models/spree/parser.rb`

On Tue, Feb 19, 2013 at 7:37 AM, Serega Sheypak wrote:

Looks like some kind on env issue. I don't see any spree problem,

ssa@ssa-HP-EliteBook-8460p ~/spree-1.3.1-0 $ cat /home/ssa/spree-1.3.1-0/apps/**spree/htdocs/app/models/**parser.rb
module Spree
class Parser < ActiveRecord::Base
has_many :parser_mappings,:dependent => :destroy
belongs_to :taxon
belongs_to :prototype

validates :taxon_id, :prototype_id, :source_url, :title, :presence => true
#:parser_mapping_ids, allow to add them on the second step

attr_accessible :parser_mapping_ids, :taxon_id, :prototype_id, :source_url, :title, :description

end

end
So class in on its place. Sometimes it works, sometimes: not.

2013/2/19 Ryan Bigg <ryan@spreecommerce.com>
Please show us the class defined in app/models/parser.rb



On 19/02/2013, at 6:52, Serega Sheypak wrote:

The solution is:
Here is a top of controller:
#class ParsersController < Spree::Admin::BaseController
class ParsersController < Spree::Admin::ResourceController
#some more code...
1.
class ParsersController < Spree::Admin::BaseController
#class ParsersController < Spree::Admin::ResourceController
2.
refresh page, get respond_with error

3.
put it back:
#class ParsersController < Spree::Admin::BaseController
class ParsersController < Spree::Admin::ResourceController

Seems like there is a problem in some phusion passenger and apache 2.
Looks like some compiled cache or stuff like that.
I do always get such mystic error after cold restart.

The problem is solved.

понедельник, 18 февраля 2013 г., 23:37:08 UTC+4 пользователь Serega
Sheypak написал:
Hi, I've got such exception:
LoadError in Spree::Admin::**ParsersController#index

*Expected /home/ssa/spree-1.3.1-0/apps/spree/htdocs/app/models/parser.rb to define Parser*

Rails.root: /home/ssa/spree-1.3.1-0/apps/**spree/htdocs
Application Trace <http://localhost:8080/spree/admin/parsers#> | Framework
Trace <http://localhost:8080/spree/admin/parsers#> | Full Trace<http://localhost:8080/spree/admin/parsers#>

activesupport (3.2.11) lib/active_support/**dependencies.rb:503:in `load_missing_constant'
activesupport (3.2.11) lib/active_support/**dependencies.rb:192:in `block in const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `each'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:514:in `load_missing_constant'
activesupport (3.2.11) lib/active_support/**dependencies.rb:192:in `block in const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `each'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:514:in `load_missing_constant'
activesupport (3.2.11) lib/active_support/**dependencies.rb:192:in `block in const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `each'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `const_missing'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:230:in `block in constantize'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:229:in `each'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:229:in `constantize'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:260:in `safe_constantize'
activesupport (3.2.11) lib/active_support/core_ext/**string/inflections.rb:66:in `safe_constantize'
actionpack (3.2.11) lib/action_controller/metal/**params_wrapper.rb:152:in `_default_wrap_model'
actionpack (3.2.11) lib/action_controller/metal/**params_wrapper.rb:169:in `_set_wrapper_defaults'
actionpack (3.2.11) lib/action_controller/metal/**params_wrapper.rb:133:in `inherited'
actionpack (3.2.11) lib/abstract_controller/**railties/routes_helpers.rb:7:**in `block (2 levels) in with'
actionpack (3.2.11) lib/action_controller/**railties/paths.rb:7:in `block (2 levels) in with'
activesupport (3.2.11) lib/active_support/**dependencies.rb:469:in `load'
activesupport (3.2.11) lib/active_support/**dependencies.rb:469:in `block in load_file'
activesupport (3.2.11) lib/active_support/**dependencies.rb:639:in `new_constants_in'
activesupport (3.2.11) lib/active_support/**dependencies.rb:468:in `load_file'
activesupport (3.2.11) lib/active_support/**dependencies.rb:353:in `require_or_load'
activesupport (3.2.11) lib/active_support/**dependencies.rb:502:in `load_missing_constant'
activesupport (3.2.11) lib/active_support/**dependencies.rb:192:in `block in const_missing'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `each'
activesupport (3.2.11) lib/active_support/**dependencies.rb:190:in `const_missing'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:230:in `block in constantize'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:229:in `each'
activesupport (3.2.11) lib/active_support/inflector/**methods.rb:229:in `constantize'
activesupport (3.2.11) lib/active_support/**dependencies.rb:554:in `get'
actionpack (3.2.11) lib/action_dispatch/routing/**route_set.rb:69:in `controller_reference'
actionpack (3.2.11) lib/action_dispatch/routing/**route_set.rb:54:in `controller'
actionpack (3.2.11) lib/action_dispatch/routing/**route_set.rb:32:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/**route_set.rb:601:in `call'
spree_core (1.3.1) lib/spree/core/middleware/**redirect_legacy_product_url.**rb:13:in `call'
spree_core (1.3.1) lib/spree/core/middleware/seo_**assist.rb:27:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/railtie/**configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/**route_set.rb:601:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/best_standards_**support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:**in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/head.rb:14:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/params_parser.rb:**21:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.**rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.**rb:200:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.**rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_**adapters/abstract/connection_**pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.11) lib/active_support/callbacks.**rb:405:in `_run__2572212233659567151__**call__2126386352801157777__**callbacks'
activesupport (3.2.11) lib/active_support/callbacks.**rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.**rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.**rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/**middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/reloader.rb:65:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/debug_exceptions.**rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/show_exceptions.rb:**56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.11) lib/active_support/tagged_**logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:**in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/**strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.11) lib/action_dispatch/**middleware/static.rb:62:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:**in `call'
railties (3.2.11) lib/rails/railtie/**configurable.rb:30:in `method_missing'
passenger (3.9.1.beta) lib/phusion_passenger/rack/**thread_handler_extension.rb:**67:in `process_request'
passenger (3.9.1.beta) lib/phusion_passenger/request_**handler/thread_handler.rb:126:**in `accept_and_process_next_**request'
passenger (3.9.1.beta) lib/phusion_passenger/request_**handler/thread_handler.rb:100:**in `block in main_loop'
passenger (3.9.1.beta) lib/phusion_passenger/utils/**robust_interruption.rb:82:in `disable_interruptions'
passenger (3.9.1.beta) lib/phusion_passenger/request_**handler/thread_handler.rb:98:**in `main_loop'
passenger (3.9.1.beta) lib/phusion_passenger/request_**handler.rb:432:in `block (3 levels) in start_threads'


Here is a root exception:

*Expected /home/ssa/spree-1.3.1-0/apps/spree/htdocs/app/models/parser.rb to define Parser*

And I do linux cat for mentioned path:

ssa@ssa-HP-EliteBook-8460p ~/spree-1.3.1-0 $ cat /home/ssa/spree-1.3.1-0/apps/**spree/htdocs/app/models/**parser.rb
module Spree
class Parser < ActiveRecord::Base
has_many :parser_mappings,:dependent => :destroy
belongs_to :taxon
belongs_to :prototype

validates :taxon_id, :prototype_id, :source_url, :title, :presence => true
#:parser_mapping_ids, allow to add them on the second step

attr_accessible :parser_mapping_ids, :taxon_id, :prototype_id, :source_url, :title, :description

end

end

Hm... there is a class...?


Here is a contoller code:

module Spree
module Admin
#class ParsersController < Spree::Admin::BaseController
class ParsersController < Spree::Admin::**ResourceController

#before_filter :load_data, :except => :index

def index
respond_with(@collection)
end

def show
redirect_to( :action => :edit )
end

def collection
return @collection if @collection.present?
params[:q] ||= {}
params[:q][:deleted_at_null] ||= "1"

params[:q][:s] ||= "title asc"

@search = super.ransack(params[:q])
@collection = @search.result.
page(params[:page]).
per(Spree::Config[:admin_**products_per_page])
@collection
end

#def load_data
# @taxons = Taxon.order(:name)
#end

end
end
end


What do I do wrong?


--
You received this message because you are subscribed to the Google Groups
"Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups
"Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 18, '13 at 7:52p
activeFeb 19, '13 at 8:05p
posts4
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Serega Sheypak: 3 posts Ryan Bigg: 1 post

People

Translate

site design / logo © 2022 Grokbase