aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAndrey Subbota <subbota@gmail.com>2018-07-17 12:55:30 +0300
committerAndrey Subbota <subbota@gmail.com>2018-07-27 00:38:21 +0300
commit35ee756a366d3ac80128a017cf8ba197a0fdd4a1 (patch)
tree85d116200b8d468622d5ce540e0aee0088eb64c5 /activerecord/lib/active_record
parentf0c917c7d491f4f7b142748375e1128d5579152a (diff)
downloadrails-35ee756a366d3ac80128a017cf8ba197a0fdd4a1.tar.gz
rails-35ee756a366d3ac80128a017cf8ba197a0fdd4a1.tar.bz2
rails-35ee756a366d3ac80128a017cf8ba197a0fdd4a1.zip
Allow subclasses to redefine autosave callbacks for associated records
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index a405f05e0b..2adc473153 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -149,7 +149,7 @@ module ActiveRecord
private
def define_non_cyclic_method(name, &block)
- return if method_defined?(name)
+ return if instance_methods(false).include?(name)
define_method(name) do |*args|
result = true; @_already_called ||= {}
# Loop prevention for validation of associations