Sha256: 77f14f70278e2576a42488fbf9aeb692ddc4705e8bea0923d5e005e4e096d6c1

Contents?: true

Size: 445 Bytes

Versions: 79

Compression:

Stored size: 445 Bytes

Contents

module Pay
  module Adapter
    extend ActiveSupport::Concern

    def self.current_adapter
      if ActiveRecord::Base.respond_to?(:connection_db_config)
        ActiveRecord::Base.connection_db_config.adapter
      else
        ActiveRecord::Base.connection_config[:adapter]
      end
    end

    def self.json_column_type
      case current_adapter
      when "postgresql"
        :jsonb
      else
        :json
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
pay-5.0.4 lib/pay/adapter.rb
pay-5.0.3 lib/pay/adapter.rb
pay-5.0.2 lib/pay/adapter.rb
pay-5.0.1 lib/pay/adapter.rb
pay-5.0.0 lib/pay/adapter.rb
pay-4.2.1 lib/pay/adapter.rb
pay-4.2.0 lib/pay/adapter.rb
pay-4.1.1 lib/pay/adapter.rb
pay-4.1.0 lib/pay/adapter.rb
pay-4.0.4 lib/pay/adapter.rb
pay-4.0.2 lib/pay/adapter.rb
pay-4.0.1 lib/pay/adapter.rb
pay-4.0.0 lib/pay/adapter.rb
pay-3.0.24 lib/pay/adapter.rb
pay-3.0.23 lib/pay/adapter.rb
pay-3.0.22 lib/pay/adapter.rb
pay-3.0.21 lib/pay/adapter.rb
pay-3.0.20 lib/pay/adapter.rb
pay-3.0.19 lib/pay/adapter.rb
pay-3.0.18 lib/pay/adapter.rb