diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:28:43 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:30:04 +0530 |
commit | 08633bae5e4f05e913ec5d5d2483bfd6c07c7375 (patch) | |
tree | 9ceafedbf6825b2b756dabc34a4e297df4971741 /activerecord/lib/active_record/associations.rb | |
parent | 949c8c0d0e92e6e7855dc4decc10eb4c658e0ede (diff) | |
download | rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.gz rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.bz2 rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.zip |
Migrate all the calculation methods to Relation
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 0b248a6c55..f0bad6c3ba 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1466,11 +1466,10 @@ module ActiveRecord end def find_with_associations(options = {}, join_dependency = nil) - catch :invalid_query do - join_dependency ||= JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins]) - rows = select_all_rows(options, join_dependency) - return join_dependency.instantiate(rows) - end + join_dependency ||= JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins]) + rows = select_all_rows(options, join_dependency) + join_dependency.instantiate(rows) + rescue ThrowResult [] end @@ -1733,7 +1732,7 @@ module ActiveRecord def construct_arel_limited_ids_condition(options, join_dependency) if (ids_array = select_limited_ids_array(options, join_dependency)).empty? - throw :invalid_query + raise ThrowResult else Arel::Predicates::In.new( Arel::SqlLiteral.new("#{connection.quote_table_name table_name}.#{primary_key}"), |