aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_one_through_association.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-24 19:32:34 +0000
committerJon Leighton <j@jonathanleighton.com>2011-01-30 11:56:41 +0000
commitd85ee50eda88fc1d486140b63d5c6826b7f3671b (patch)
tree059ff5e9b6e43878a92bde4c99fe56dd23a26a98 /activerecord/lib/active_record/associations/has_one_through_association.rb
parent15601c52e7c7094a6b7b54ef8acfc8299a4d6724 (diff)
downloadrails-d85ee50eda88fc1d486140b63d5c6826b7f3671b.tar.gz
rails-d85ee50eda88fc1d486140b63d5c6826b7f3671b.tar.bz2
rails-d85ee50eda88fc1d486140b63d5c6826b7f3671b.zip
Indent methods under private/protected sections
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_one_through_association.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_through_association.rb b/activerecord/lib/active_record/associations/has_one_through_association.rb
index dcd74e7346..69771afe50 100644
--- a/activerecord/lib/active_record/associations/has_one_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_through_association.rb
@@ -11,24 +11,24 @@ module ActiveRecord
private
- def create_through_record(record)
- through_proxy = @owner.send(:association_proxy, @reflection.through_reflection.name)
- through_record = through_proxy.send(:load_target)
+ def create_through_record(record)
+ through_proxy = @owner.send(:association_proxy, @reflection.through_reflection.name)
+ through_record = through_proxy.send(:load_target)
- if through_record && !record
- through_record.destroy
- elsif record
- attributes = construct_join_attributes(record)
+ if through_record && !record
+ through_record.destroy
+ elsif record
+ attributes = construct_join_attributes(record)
- if through_record
- through_record.update_attributes(attributes)
- elsif @owner.new_record?
- through_proxy.build(attributes)
- else
- through_proxy.create(attributes)
+ if through_record
+ through_record.update_attributes(attributes)
+ elsif @owner.new_record?
+ through_proxy.build(attributes)
+ else
+ through_proxy.create(attributes)
+ end
end
end
- end
end
end
end