aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-07 16:25:22 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-07 16:25:22 -0800
commit08ef06dbf1273fc09d6e23b7d8727928717e8004 (patch)
treec718a7e1b7b61e83d665c7e3583bc575a4d2d707 /activerecord/lib/active_record/associations
parent2b4de6621f75b49c30c03ddd78076f7204cc9577 (diff)
downloadrails-08ef06dbf1273fc09d6e23b7d8727928717e8004.tar.gz
rails-08ef06dbf1273fc09d6e23b7d8727928717e8004.tar.bz2
rails-08ef06dbf1273fc09d6e23b7d8727928717e8004.zip
just return the record from insert_record, use truthiness for comparisons
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index 81dd373f7b..f299f51466 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -26,14 +26,14 @@ module ActiveRecord
def insert_record(record, force = true, validate = true)
if record.new_record?
- return false unless save_record(record, force, validate)
+ return unless save_record(record, force, validate)
end
through_association = @owner.send(@reflection.through_reflection.name)
through_association.create!(construct_join_attributes(record))
update_counter(1)
- true
+ record
end
private