diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-12-17 09:57:27 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-20 13:56:04 -0800 |
commit | 9863d8a5f6576ab10df51230c0531cec8d4468f9 (patch) | |
tree | a49a9115c4c8ab325627f38551fe10a6353bc7d3 | |
parent | 7f5fcc0785e28175b1a54971e5adc34ecd50787d (diff) | |
download | rails-9863d8a5f6576ab10df51230c0531cec8d4468f9.tar.gz rails-9863d8a5f6576ab10df51230c0531cec8d4468f9.tar.bz2 rails-9863d8a5f6576ab10df51230c0531cec8d4468f9.zip |
Remove unnecessary overloaded methods create, create! and create_record from HasAndBelongsToManyAssociation
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 18 |
1 files changed, 0 insertions, 18 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 259bf1f591..e17ac6f2cc 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 @@ -2,14 +2,6 @@ module ActiveRecord # = Active Record Has And Belongs To Many Association module Associations class HasAndBelongsToManyAssociation < AssociationCollection #:nodoc: - def create(attributes = {}) - create_record(attributes) { |record| insert_record(record) } - end - - def create!(attributes = {}) - create_record(attributes) { |record| insert_record(record, true) } - end - def columns @reflection.columns(@reflection.options[:join_table], "#{@reflection.options[:join_table]} Columns") end @@ -109,16 +101,6 @@ module ActiveRecord end private - def create_record(attributes, &block) - # Can't use Base.create because the foreign key may be a protected attribute. - ensure_owner_is_persisted! - if attributes.is_a?(Array) - attributes.collect { |attr| create(attr) } - else - build_record(attributes, &block) - end - end - def record_timestamp_columns(record) if record.record_timestamps record.send(:all_timestamp_attributes).map { |x| x.to_s } |