aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorSantosh Wadghule <santosh.wadghule@gmail.com>2015-01-23 11:08:50 +0530
committerSantosh Wadghule <santosh.wadghule@gmail.com>2015-01-23 11:08:50 +0530
commitb15a47deff7d29dc91d59b1fef983bb12e08fb6d (patch)
tree9acac92e5126a9eb49d36e3b7eb4a071595e2dca /activerecord/lib/active_record/persistence.rb
parent139c232b075da940cdf1042dcaad4c3b514908c9 (diff)
downloadrails-b15a47deff7d29dc91d59b1fef983bb12e08fb6d.tar.gz
rails-b15a47deff7d29dc91d59b1fef983bb12e08fb6d.tar.bz2
rails-b15a47deff7d29dc91d59b1fef983bb12e08fb6d.zip
Use 'public_send' over the 'send' method for object's properties.
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb4
1 files changed, 2 insertions, 2 deletions
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