lib/extend_at.rb in extend_at-0.1.1 vs lib/extend_at.rb in extend_at-0.1.2
- old
+ new
@@ -388,9 +388,10 @@
end
def compatible_type(value,type)
return true if value.class == String and [:string, :text, :binary].include? type
return true if value.class == Fixnum and [:integer, :float].include? type
+ return true if [Fixnum, Float].include? value.class and [:integer, :float].include? type
return true if [true.class, false.class].include? value.class and [:boolean].include? type
return true if value.class == BigDecimal and [:decimal].include? type
return true if [Date, Time].include? value.class and [:date, :time].include? type
return true if value.class == BigDecimal and [:decimal].include? type
return true if [Date, Time, ActiveSupport::TimeWithZone].include? value.class and [:datetime, :timestamp].include? type
\ No newline at end of file