I have a model that has a pivot area that retrieves only a couple of important fields:
class Cupcake < ActiveRecord::Base
scope :summary, select([:id, :name])
end
If I call this area, then call
Cupcake.find(id)
I get a record with id and name attributes filled only.
Is there some kind of option that I can pass to the find command to force it to go to the database? Also, should they not generate completely different sql statements, and therefore will activerecord be forced to go to the database?
Note. I am using Rails 3.2.3 with pg gem
source
share