Class: ThriftRack::ActiveRecord
- Inherits:
-
Object
- Object
- ThriftRack::ActiveRecord
- Defined in:
- lib/thrift_rack/active_record.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
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 |