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-8.3.0 lib/pay/adapter.rb
pay-8.2.2 lib/pay/adapter.rb
pay-8.2.1 lib/pay/adapter.rb
pay-8.2.0 lib/pay/adapter.rb
pay-8.1.3 lib/pay/adapter.rb
pay-8.1.2 lib/pay/adapter.rb
pay-8.1.1 lib/pay/adapter.rb
pay-8.1.0 lib/pay/adapter.rb
pay-8.0.0 lib/pay/adapter.rb
pay-7.3.0 lib/pay/adapter.rb
pay-7.2.1 lib/pay/adapter.rb
pay-7.1.1 lib/pay/adapter.rb
pay-7.1.0 lib/pay/adapter.rb
pay-7.0.0 lib/pay/adapter.rb
pay-6.8.1 lib/pay/adapter.rb
pay-6.8.0 lib/pay/adapter.rb
pay-6.7.2 lib/pay/adapter.rb
pay-6.7.1 lib/pay/adapter.rb
pay-6.7.0 lib/pay/adapter.rb
pay-6.6.1 lib/pay/adapter.rb