diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-07-31 18:31:19 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-07-31 19:34:29 -0300 |
commit | fe24ba881a676c5119498c4d6362a4827bf695ba (patch) | |
tree | 470c110960da2b5ed115629e28a97b8bddcd18a8 | |
parent | e9bbe4a106afc9dd42464007f9fba3b54772bae0 (diff) | |
download | rails-fe24ba881a676c5119498c4d6362a4827bf695ba.tar.gz rails-fe24ba881a676c5119498c4d6362a4827bf695ba.tar.bz2 rails-fe24ba881a676c5119498c4d6362a4827bf695ba.zip |
Rename method for clarity
Ruby generally does not use the is_* prefix on predicate methods.
-rw-r--r-- | activerecord/lib/active_record/type/serialized.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb index 42bbed7103..abeea769c4 100644 --- a/activerecord/lib/active_record/type/serialized.rb +++ b/activerecord/lib/active_record/type/serialized.rb @@ -12,7 +12,7 @@ module ActiveRecord end def type_cast_from_database(value) - if is_default_value?(value) + if default_value?(value) value else coder.load(super) @@ -21,7 +21,7 @@ module ActiveRecord def type_cast_for_database(value) return if value.nil? - unless is_default_value?(value) + unless default_value?(value) super coder.dump(value) end end @@ -43,7 +43,7 @@ module ActiveRecord private - def is_default_value?(value) + def default_value?(value) value == coder.load(nil) end end |