diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-11 07:15:59 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-11 07:15:59 +0000 |
commit | 800b899f9685a12e0e255e29369eac36e2985d28 (patch) | |
tree | 6990f3d1ce4872aa1eafb3bbf4646b0fff47c078 /activerecord/lib | |
parent | 813e8ba93bf099dd065512f958a516c6b893a841 (diff) | |
download | rails-800b899f9685a12e0e255e29369eac36e2985d28.tar.gz rails-800b899f9685a12e0e255e29369eac36e2985d28.tar.bz2 rails-800b899f9685a12e0e255e29369eac36e2985d28.zip |
Remove deprecated push_with_attributes.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6997 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index c8e216f072..2155ce8e30 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -5,7 +5,7 @@ module ActiveRecord super construct_sql end - + def build(attributes = {}) load_target record = @reflection.klass.new(attributes) @@ -27,7 +27,7 @@ module ActiveRecord def find_first load_target.first end - + def find(*args) options = Base.send(:extract_options_from_args!, args) @@ -66,24 +66,7 @@ module ActiveRecord args << options @reflection.klass.find(*args) end - end - - # Deprecated as of Rails 1.2. If your associations require attributes - # you should be using has_many :through - def push_with_attributes(record, join_attributes = {}) - raise_on_type_mismatch(record) - join_attributes.each { |key, value| record[key.to_s] = value } - - callback(:before_add, record) - insert_record(record) unless @owner.new_record? - @target << record - callback(:after_add, record) - - self end - deprecate :push_with_attributes => "consider using has_many :through instead" - - alias :concat_with_attributes :push_with_attributes protected def count_records @@ -121,10 +104,10 @@ module ActiveRecord @owner.connection.execute(sql) end - + return true end - + def delete_records(records) if sql = @reflection.options[:delete_sql] records.each { |record| @owner.connection.execute(interpolate_sql(sql, record)) } @@ -134,7 +117,7 @@ module ActiveRecord @owner.connection.execute(sql) end end - + def construct_sql interpolate_sql_options!(@reflection.options, :finder_sql) |