rails 3 console error -
i have got error message when using rails3 consol
irb(main):018:0> webtrisulmenu.find(1)
nomethoderror: undefined methodeq' nil:nilclass
method_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/whiny_nil.rb:48:in
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:299:infind_one'
find_with_ids'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:289:in
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:107:infind'
find'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/base.rb:444:in
(irb):18
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:44:instart'
start'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:23:in<top (required)>'
require'
script/rails:6:in
script/rails:6:in `'
but using ,its working fine
irb(main):019:0> webtrisulcontext.find(:all,:conditions=>['id =1'])
=> webtrisulcontext id: 1, name: "primary", internal_name: "", description: "the default web trisul context", slinkname: "root_ctx0", webtrisul_dashboard_id: nil
please me out of this?
there wrong webtrisulmenu
class. it's not getting initialized when rails environment loaded nilclass error tells me.
therefore, unable find on webtrisulmenu
model.
see wrong in model, , if can't figure out yourself, post contents of file here.
Comments
Post a Comment