Sha256: 9faddf8025fc4f360aee7d02fb78376c7c1633a0c92aee76ae3c5e0c8ab5f8f8

Contents?: true

Size: 363 Bytes

Versions: 6

Compression:

Stored size: 363 Bytes

Contents

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coalescing_panda-5.1.0 lib/coalescing_panda/misc_helper.rb
coalescing_panda-5.0.10 lib/coalescing_panda/misc_helper.rb
coalescing_panda-5.0.9 lib/coalescing_panda/misc_helper.rb
coalescing_panda-5.0.8 lib/coalescing_panda/misc_helper.rb
coalescing_panda-5.0.7 lib/coalescing_panda/misc_helper.rb
coalescing_panda-5.0.6 lib/coalescing_panda/misc_helper.rb