Class: Burden::StorageBackends::ActiveRecordBackend
- Inherits:
-
Object
- Object
- Burden::StorageBackends::ActiveRecordBackend
- Defined in:
- lib/burden/storage_backends/active_record_backend.rb
Instance Attribute Summary collapse
-
#connection_success ⇒ Object
readonly
Returns the value of attribute connection_success.
Instance Method Summary collapse
-
#initialize(config) ⇒ ActiveRecordBackend
constructor
A new instance of ActiveRecordBackend.
- #ready? ⇒ Boolean
- #runs ⇒ Object
Constructor Details
#initialize(config) ⇒ ActiveRecordBackend
Returns a new instance of ActiveRecordBackend.
9 10 11 12 13 14 15 16 |
# File 'lib/burden/storage_backends/active_record_backend.rb', line 9 def initialize(config) @connection_success = true begin ActiveRecord::Base.establish_connection(config) rescue => e @connection_success = false end end |
Instance Attribute Details
#connection_success ⇒ Object (readonly)
Returns the value of attribute connection_success.
7 8 9 |
# File 'lib/burden/storage_backends/active_record_backend.rb', line 7 def connection_success @connection_success end |
Instance Method Details
#ready? ⇒ Boolean
18 19 20 |
# File 'lib/burden/storage_backends/active_record_backend.rb', line 18 def ready? @connection_success end |
#runs ⇒ Object
22 23 24 |
# File 'lib/burden/storage_backends/active_record_backend.rb', line 22 def runs Burden::StorageBackends::ActiveRecord::Run end |