From fe24ba881a676c5119498c4d6362a4827bf695ba Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 31 Jul 2014 18:31:19 -0300 Subject: Rename method for clarity Ruby generally does not use the is_* prefix on predicate methods. --- activerecord/lib/active_record/type/serialized.rb | 6 +++--- 1 file 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 -- cgit v1.2.3