Methods

Files

Class Index [+]

Quicksearch

Arel::Attributes::Boolean

Public Instance Methods

type_cast(value) click to toggle source
    # File lib/arel/algebra/attributes/boolean.rb, line 4
 4:       def type_cast(value)
 5:         case value
 6:         when true, false then value
 7:         # when nil            then options[:allow_nil] ? nil : false
 8:         when nil         then false
 9:         when 1           then true
10:         when 0           then false
11:         else
12:           case value.to_s.downcase.strip
13:           when 'true'  then true
14:           when 'false' then false
15:           else         raise typecast_error(value)
16:           end
17:         end
18:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.