Method: ActiveRecord::SpawnMethods#only
- Defined in:
- activerecord/lib/active_record/relation/spawn_methods.rb
#only(*onlies) ⇒ Object
Removes any condition from the query other than the one(s) specified in onlies.
Post.order('id asc').only(:where) # discards the order condition
Post.order('id asc').only(:where, :order) # uses the specified order
67 68 69 |
# File 'activerecord/lib/active_record/relation/spawn_methods.rb', line 67 def only(*onlies) relation_with values.slice(*onlies) end |