mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use 'public_send' over the 'send' method for object's properties.
This commit is contained in:
parent
139c232b07
commit
b15a47deff
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue