I am using RubyMine
with rails 3.2.12
and I am getting following deprecated warning in my IDE. Any Idea How can I solve this deprecated warning?
Use the new ActiveRecord::Relation
stuff that was added in Rails 3. Find more info here: http://guides.rubyonrails.org/active_record_querying.html
Instead of #find
, use #first
, #last
, #all
, etc. on your model, and the methods that return a ActiveRecord::Relation, like #where
.
#User.find(:first)
User.first
#User.find(:all, :conditions => {:foo => true})
User.where(:foo => true).all