Class: ThriftRack::ActiveRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift_rack/active_record.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ActiveRecord

Returns a new instance of ActiveRecord.



3
4
5
# File 'lib/thrift_rack/active_record.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
# File 'lib/thrift_rack/active_record.rb', line 7

def call(env)
  ::ActiveRecord::Base.connection_pool.with_connection do
    @app.call(env)
  end
end