lib/chgk_rating/utils/transformations.rb in chgk_rating-2.2.0 vs lib/chgk_rating/utils/transformations.rb in chgk_rating-2.2.1
- old
+ new
@@ -36,10 +36,10 @@
Module.const_get("ChgkRating::#{type}::#{namespace}").new(*opts)
end
end
def to_boolean
- ->(d) { !d.to_i.zero? }
+ ->(d) { d.respond_to?(:to_i) ? !d.to_i.zero? : !!d }
end
def to_binary_boolean
->(d) { d ? '1' : '0' }
end