module Shamu::ToBoolExtension::Integers

Add `to_model_id` to Integer types.

Public Instance Methods

to_bool( default = false ) click to toggle source
# File lib/shamu/to_bool_extension.rb, line 29
def to_bool( default = false )
  case self
  when 1 then true
  when 0 then false
  else        default
  end
end