Permalink
Browse files

where needs to bring the bind params when creating a new relation

  • Loading branch information...
tenderlove committed Jan 14, 2014
1 parent b5f679b commit f5a635e4f47f5c864d49e8fe23641d65adfb25e3
Showing with 3 additions and 0 deletions.
  1. +3 −0 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -58,6 +58,9 @@ def except(*skips)
# Post.order('id asc').only(:where) # discards the order condition
# Post.order('id asc').only(:where, :order) # uses the specified order
def only(*onlies)
+ if onlies.any? { |o| o == :where }
+ onlies << :bind
+ end
relation_with values.slice(*onlies)
end

0 comments on commit f5a635e

Please sign in to comment.