diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/belongs_to_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/belongs_to_association.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb index 1abea8d831..a818a780ed 100644 --- a/activerecord/lib/active_record/associations/belongs_to_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_association.rb @@ -1,19 +1,7 @@ module ActiveRecord # = Active Record Belongs To Associations module Associations - class BelongsToAssociation < AssociationProxy #:nodoc: - def create(attributes = {}) - new_record(:create_association, attributes) - end - - def create!(attributes = {}) - build(attributes).tap { |record| record.save! } - end - - def build(attributes = {}) - new_record(:build_association, attributes) - end - + class BelongsToAssociation < SingularAssociation #:nodoc: def replace(record) record = record.target if AssociationProxy === record raise_on_type_mismatch(record) if record @@ -34,12 +22,6 @@ module ActiveRecord end private - def new_record(method, attributes) - record = scoped.scoping { @reflection.send(method, attributes) } - replace(record) - record - end - def update_counters(record) counter_cache_name = @reflection.counter_cache_column |