Class: Lims::Core::Persistence::Sequel::Store
- Inherits:
-
Lims::Core::Persistence::Store
- Object
- Lims::Core::Persistence::Store
- Lims::Core::Persistence::Sequel::Store
- Defined in:
- lib/lims-core/persistence/sequel/store.rb
Overview
An Sequel::Store, ie an wrapper around a database using the sequel gem
Constant Summary
Constants inherited from Lims::Core::Persistence::Store
Lims::Core::Persistence::Store::DIRTY_ATTRIBUTE_STRATEGY_DEEP_COPY, Lims::Core::Persistence::Store::DIRTY_ATTRIBUTE_STRATEGY_MD5, Lims::Core::Persistence::Store::DIRTY_ATTRIBUTE_STRATEGY_QUICK_HASH, Lims::Core::Persistence::Store::DIRTY_ATTRIBUTE_STRATEGY_SHA1
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
Attributes inherited from Lims::Core::Persistence::Store
Instance Method Summary collapse
-
#initialize(database, *args) ⇒ Store
constructor
Create a store with a Sequel::Database We don’t wrap for now the creation of the database.
-
#transaction ⇒ Object
Execute given block within a transaction and create a session object needed to update revisionned table.
Methods inherited from Lims::Core::Persistence::Store
#base_module, base_module, const_missing, #create_session, #with_session
Constructor Details
#initialize(database, *args) ⇒ Store
Create a store with a Sequel::Database We don’t wrap for now the creation of the database
19 20 21 22 23 24 |
# File 'lib/lims-core/persistence/sequel/store.rb', line 19 def initialize(database, *args) raise RuntimeError unless database.is_a?(::Sequel::Database) @database = database super(*args) @dirty_attribute_strategy = DIRTY_ATTRIBUTE_STRATEGY_SHA1 end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
13 14 15 |
# File 'lib/lims-core/persistence/sequel/store.rb', line 13 def database @database end |
Instance Method Details
#transaction ⇒ Object
Execute given block within a transaction and create a session object needed to update revisionned table.
29 30 31 32 33 |
# File 'lib/lims-core/persistence/sequel/store.rb', line 29 def transaction database.transaction do super end end |