Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (19 sloc) 0.37 kb
728fa69 @sgrif Move types to the top level `ActiveRecord` namespace
sgrif authored
1 module ActiveRecord
2 module Type
3 class Integer < Value # :nodoc:
4 include Numeric
5
6 def type
7 :integer
8 end
9
10 alias type_cast_for_database type_cast
11
12 private
13
14 def cast_value(value)
15 case value
16 when true then 1
17 when false then 0
18 else value.to_i rescue nil
19 end
20 end
21 end
22 end
23 end
Something went wrong with that request. Please try again.