diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-12 05:34:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-12 05:34:10 +0000 |
commit | 3b9e90a4dab94d25bfa7ed5e47ca0641857ef992 (patch) | |
tree | 1bd1c5d02280f93c447d1917da98cbbdf9ab31a8 /activerecord/lib/active_record/deprecated_associations.rb | |
parent | b59619600fbbfb2cf6d7156fb4c21bb2c0cec955 (diff) | |
download | rails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.tar.gz rails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.tar.bz2 rails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.zip |
Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1146 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/deprecated_associations.rb')
-rw-r--r-- | activerecord/lib/active_record/deprecated_associations.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/activerecord/lib/active_record/deprecated_associations.rb b/activerecord/lib/active_record/deprecated_associations.rb index a3d0f1d947..077ac1de3b 100644 --- a/activerecord/lib/active_record/deprecated_associations.rb +++ b/activerecord/lib/active_record/deprecated_associations.rb @@ -84,25 +84,7 @@ module ActiveRecord !#{association_name}(force_reload).nil? end end_eval - end - - def deprecated_build_method(method_prefix, collection_name, collection_class_name, class_primary_key_name)# :nodoc: - module_eval <<-"end_eval", __FILE__, __LINE__ - def #{method_prefix + collection_name}(attributes = {}) - association = #{collection_class_name}.new - association.attributes = attributes.merge({ "#{class_primary_key_name}" => id}) - association - end - end_eval - end - - def deprecated_create_method(method_prefix, collection_name, collection_class_name, class_primary_key_name)# :nodoc: - module_eval <<-"end_eval", __FILE__, __LINE__ - def #{method_prefix + collection_name}(attributes = nil) - #{collection_class_name}.create((attributes || {}).merge({ "#{class_primary_key_name}" => id})) - end - end_eval - end + end end end end |