From b15a47deff7d29dc91d59b1fef983bb12e08fb6d Mon Sep 17 00:00:00 2001 From: Santosh Wadghule Date: Fri, 23 Jan 2015 11:08:50 +0530 Subject: Use 'public_send' over the 'send' method for object's properties. --- activerecord/lib/active_record/persistence.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 714d36e7c0..22112fe8ff 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -245,7 +245,7 @@ module ActiveRecord def update_attribute(name, value) name = name.to_s verify_readonly_attribute(name) - send("#{name}=", value) + public_send("#{name}=", value) save(validate: false) if changed? end @@ -352,7 +352,7 @@ module ActiveRecord # method toggles directly the underlying value without calling any setter. # Returns +self+. def toggle(attribute) - self[attribute] = !send("#{attribute}?") + self[attribute] = !public_send("#{attribute}?") self end -- cgit v1.2.3