Sha256: c24bdbb2723c0e093aeac1a09117b58d9a65a7e2c6abc477eeaa417ce9fd2f79

Contents?: true

Size: 909 Bytes

Versions: 6

Compression:

Stored size: 909 Bytes

Contents

module Killbill
  module Plugin
    module ActiveMerchant
      module Sinatra
        enable :sessions

        include ::ActionView::Helpers::FormTagHelper

        helpers do
          def config
            ::Killbill::Plugin::ActiveMerchant.config
          end

          def logger
            ::Killbill::Plugin::ActiveMerchant.logger
          end

          def required_parameter!(parameter_name, parameter_value, message='must be specified!')
            halt 400, "#{parameter_name} #{message}" if parameter_value.blank?
          end
        end

        after do
          # return DB connections to the Pool if required
          pool = ::ActiveRecord::Base.connection_pool
          if pool.active_connection?
            connection = ::ActiveRecord::Base.connection
            pool.remove(connection)
            connection.disconnect!
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
killbill-3.2.4 lib/killbill/helpers/active_merchant/sinatra.rb
killbill-3.2.3 lib/killbill/helpers/active_merchant/sinatra.rb
killbill-3.2.2 lib/killbill/helpers/active_merchant/sinatra.rb
killbill-3.2.1 lib/killbill/helpers/active_merchant/sinatra.rb
killbill-3.2.0 lib/killbill/helpers/active_merchant/sinatra.rb
killbill-3.1.12 lib/killbill/helpers/active_merchant/sinatra.rb