Permalink
Browse files

Fixes stupid thing I did.

  • Loading branch information...
1 parent d38e4e9 commit f19311a820b782dfceeb0cd6005229b265d8b032 @wycats committed Apr 16, 2008
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/data_mapper/property.rb
@@ -263,11 +263,15 @@ def inspect
end
def typecast(value)
+ return value if type === value
+
if type == TrueClass
value == true || value == "true"
elsif type == String
value.to_s
- elsif [Float, Fixnum, BigDecimal].include?(type)
+ elsif Fixnum
+ value.to_i
+ elsif [Float, BigDecimal].include?(type)
value.to_f
elsif type == DateTime
Time.parse(value)

0 comments on commit f19311a

Please sign in to comment.