aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-04-12 14:54:31 -0600
committerSean Griffin <sean@seantheprogrammer.com>2016-04-12 14:54:31 -0600
commitba194d4230c97197567e5c0f71fca47e40035783 (patch)
tree0dd508146a83958e9eaafc8ec9482d1f44a09d57 /activemodel/lib/active_model
parentecd53667fa814023d3434fca0629e19bad46b092 (diff)
parent051d859880dde2896cc5417844e566569466b28c (diff)
downloadrails-ba194d4230c97197567e5c0f71fca47e40035783.tar.gz
rails-ba194d4230c97197567e5c0f71fca47e40035783.tar.bz2
rails-ba194d4230c97197567e5c0f71fca47e40035783.zip
Merge pull request #24515 from Sen-Zhang/attribute_changed_not_return_nil
prevent 'attribute_changed?' from returning nil
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/dirty.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index fad4de9df5..9aca5f2c90 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -180,7 +180,7 @@ module ActiveModel
result &&= options[:to] == __send__(attr) if options.key?(:to)
result &&= options[:from] == changed_attributes[attr] if options.key?(:from)
end
- result
+ !!result
end
# Handles <tt>*_was</tt> for +method_missing+.