Module: PandaPal::MiscHelper

Defined in:
lib/panda_pal/helpers/misc_helper.rb

Constant Summary collapse

MigrationClass =
Rails.version < '5.0' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]

Class Method Summary collapse

Class Method Details

.to_boolean(v) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/panda_pal/helpers/misc_helper.rb', line 5

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