aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-12-26 19:04:26 +0000
committerJon Leighton <j@jonathanleighton.com>2010-12-26 19:38:04 +0000
commit0c272471fe815c121a83d959468b2f1b6f8aaba8 (patch)
tree4c273e52e8ff14b1072ca8d27a3e79865cc7cc78 /activerecord
parente8ada11aac28f0850f0e485acacf34e7eb81aa19 (diff)
downloadrails-0c272471fe815c121a83d959468b2f1b6f8aaba8.tar.gz
rails-0c272471fe815c121a83d959468b2f1b6f8aaba8.tar.bz2
rails-0c272471fe815c121a83d959468b2f1b6f8aaba8.zip
Remove AssociationProxy#dependent? - it's badly named and only used in one place
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_proxy.rb5
-rw-r--r--activerecord/lib/active_record/associations/has_one_association.rb2
2 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb
index f51275d86d..c7b171b41d 100644
--- a/activerecord/lib/active_record/associations/association_proxy.rb
+++ b/activerecord/lib/active_record/associations/association_proxy.rb
@@ -167,11 +167,6 @@ module ActiveRecord
end
protected
- # Does the association have a <tt>:dependent</tt> option?
- def dependent?
- @reflection.options[:dependent]
- end
-
def interpolate_sql(sql, record = nil)
@owner.send(:interpolate_sql, sql, record)
end
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb
index fd3827390f..654157d998 100644
--- a/activerecord/lib/active_record/associations/has_one_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_association.rb
@@ -27,7 +27,7 @@ module ActiveRecord
load_target
unless @target.nil? || @target == obj
- if dependent? && !dont_save
+ if @reflection.options[:dependent] && !dont_save
case @reflection.options[:dependent]
when :delete
@target.delete if @target.persisted?