rails 3 console error -


i have got error message when using rails3 consol

irb(main):018:0> webtrisulmenu.find(1)
nomethoderror: undefined method eq' nil:nilclass
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/whiny_nil.rb:48:in
method_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:299:in find_one'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:289:in
find_with_ids'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:107:in find'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/base.rb:444:in
find'
(irb):18
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in start'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in
start'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:23:in <top (required)>'
script/rails:6:in
require'
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

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -