diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-26 14:40:45 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-26 14:40:45 +0530 |
commit | 9d3d60c64a9ce69b9932f5c543112199e576c2ad (patch) | |
tree | 6cc2d5fbf8f707274683a93cda8ac32b175b7663 /activerecord/lib/active_record | |
parent | 284d186cf4e055cefb2f8482d016e3bd09e9c341 (diff) | |
download | rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.tar.gz rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.tar.bz2 rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.zip |
Ensure preload and eager_load finder methods accept multiple arguments
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 3dedf44190..c02acba786 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -11,11 +11,11 @@ module ActiveRecord @eager_load_associations = eager_load end - def preload(associations) + def preload(*associations) create_new_relation(@relation, @readonly, @associations_to_preload + Array.wrap(associations)) end - def eager_load(associations) + def eager_load(*associations) create_new_relation(@relation, @readonly, @associations_to_preload, @eager_load_associations + Array.wrap(associations)) end |