Module: ActiveRecord::Bitemporal::Optionable
- Included in:
- ActiveRecord::Bitemporal, Persistence::PersistenceOptionable
- Defined in:
- lib/activerecord-bitemporal/bitemporal.rb
Instance Method Summary collapse
- #bitemporal_option ⇒ Object
- #bitemporal_option_merge!(other) ⇒ Object
- #with_bitemporal_option(**opt) ⇒ Object
Instance Method Details
#bitemporal_option ⇒ Object
21 22 23 |
# File 'lib/activerecord-bitemporal/bitemporal.rb', line 21 def bitemporal_option ::ActiveRecord::Bitemporal.merge_by(bitemporal_option_storage) end |
#bitemporal_option_merge!(other) ⇒ Object
25 26 27 |
# File 'lib/activerecord-bitemporal/bitemporal.rb', line 25 def bitemporal_option_merge!(other) self.bitemporal_option_storage = bitemporal_option.merge other end |
#with_bitemporal_option(**opt) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/activerecord-bitemporal/bitemporal.rb', line 29 def with_bitemporal_option(**opt) tmp_opt = bitemporal_option_storage self.bitemporal_option_storage = tmp_opt.merge(opt) yield self ensure self.bitemporal_option_storage = tmp_opt end |