Class: Grande::Context
- Inherits:
-
Object
- Object
- Grande::Context
- Defined in:
- lib/grande/context.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Class Method Summary collapse
Instance Method Summary collapse
-
#run_after_fork ⇒ Object
If one is using forking servers, this could should be run to re-setup all DB connections.
- #set_app(app) ⇒ Object
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
14 15 16 |
# File 'lib/grande/context.rb', line 14 def app @app end |
Class Method Details
.instance ⇒ Object
16 17 18 |
# File 'lib/grande/context.rb', line 16 def self.instance @instance ||= new end |
Instance Method Details
#run_after_fork ⇒ Object
If one is using forking servers, this could should be run to re-setup all DB connections
29 30 31 |
# File 'lib/grande/context.rb', line 29 def run_after_fork @app.restore_db_connections_after_fork end |
#set_app(app) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/grande/context.rb', line 20 def set_app(app) raise "App can't be set twice" if @app raise 'App can only be set if in booting phase' unless app.booting? @app = app end |