Method: CanvasSync::MiscHelper.to_boolean

Defined in:
lib/canvas_sync/misc_helper.rb

.to_boolean(v) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/canvas_sync/misc_helper.rb', line 7

def self.to_boolean(v)
  if Rails.version < '5.0'
    ActiveRecord::Type::Boolean.new.type_cast_from_user(v)
  else
    ActiveRecord::Type::Boolean.new.deserialize(v)
  end
end