diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-11-29 17:23:10 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-11-29 17:23:10 -0700 |
commit | a975407a0a4f8bb06f8d4696de6a8b5e5a086622 (patch) | |
tree | 2eb6aa16cc293b80a4a09f5e9efcd02b0f414b34 /activerecord/lib/active_record/relation | |
parent | b5242b6f95bc6a9481f438dce3fbed89e0f1edb0 (diff) | |
download | rails-a975407a0a4f8bb06f8d4696de6a8b5e5a086622.tar.gz rails-a975407a0a4f8bb06f8d4696de6a8b5e5a086622.tar.bz2 rails-a975407a0a4f8bb06f8d4696de6a8b5e5a086622.zip |
Update Arel usage for rails/arel#98fc259
`where_sql` now requires that we pass it an engine. None of the manager
classes take an engine in their constructor.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 5061940d82..357861caaa 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -108,7 +108,7 @@ module ActiveRecord # Same as +take+ but raises <tt>ActiveRecord::RecordNotFound</tt> if no record # is found. Note that <tt>take!</tt> accepts no arguments. def take! - take or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql}]") + take or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql(@klass.arel_engine)}]") end # Find the first record (or first N records if a parameter is supplied). @@ -176,7 +176,7 @@ module ActiveRecord # Same as +last+ but raises <tt>ActiveRecord::RecordNotFound</tt> if no record # is found. Note that <tt>last!</tt> accepts no arguments. def last! - last or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql}]") + last or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql(@klass.arel_engine)}]") end # Find the second record. @@ -323,7 +323,7 @@ module ActiveRecord # the expected number of results should be provided in the +expected_size+ # argument. def raise_record_not_found_exception!(ids, result_size, expected_size) #:nodoc: - conditions = arel.where_sql + conditions = arel.where_sql(@klass.arel_engine) conditions = " [#{conditions}]" if conditions if Array(ids).size == 1 @@ -498,7 +498,7 @@ module ActiveRecord end def find_nth!(index) - find_nth(index, offset_index) or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql}]") + find_nth(index, offset_index) or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql(@klass.arel_engine)}]") end def find_nth_with_limit(offset, limit) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 0edd2b1e48..d58af01339 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -858,7 +858,7 @@ module ActiveRecord private def build_arel - arel = Arel::SelectManager.new(klass.arel_engine, table) + arel = Arel::SelectManager.new(table) build_joins(arel, joins_values.flatten) unless joins_values.empty? |