Method: ActiveRecord::SpawnMethods#only
- Defined in:
- 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
60 61 62 |
# File 'lib/active_record/relation/spawn_methods.rb', line 60 def only(*onlies) relation_with values.slice(*onlies) end |