Class: Alf::Sequel::UnitOfWork::Insert
- Inherits:
-
Object
- Object
- Alf::Sequel::UnitOfWork::Insert
- Includes:
- Atomic
- Defined in:
- lib/alf/sequel/unit_of_work/insert.rb
Instance Attribute Summary
Attributes included from Atomic
Instance Method Summary collapse
-
#initialize(connection, relvar_name, inserted) ⇒ Insert
constructor
A new instance of Insert.
- #matching_relation ⇒ Object
Methods included from Atomic
Constructor Details
#initialize(connection, relvar_name, inserted) ⇒ Insert
Returns a new instance of Insert.
7 8 9 10 11 12 |
# File 'lib/alf/sequel/unit_of_work/insert.rb', line 7 def initialize(connection, relvar_name, inserted) super(connection) @relvar_name = relvar_name @inserted = inserted @insert_result = nil end |
Instance Method Details
#matching_relation ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/alf/sequel/unit_of_work/insert.rb', line 14 def matching_relation @matching_relation ||= begin raise IllegalStateError, "Unit of work not ran" unless ran? unless @insert_result raise UnsupportedError, "Composite keys insertion feedback is unsupported." end Relation(@insert_result) end end |