Module: ActiveRecord::Bitemporal::Bitemporalize::ClassMethods
- Includes:
- Relation::Finder
- Defined in:
- lib/activerecord-bitemporal/bitemporalize.rb
Instance Method Summary collapse
- #bitemporal_id_key ⇒ Object
-
#cached_find_by_statement(key, &block) ⇒ Object
Override ActiveRecord::Core::ClassMethods#cached_find_by_statement ‘.find_by` not use caching.
- #inherited(klass) ⇒ Object
Methods included from Relation::Finder
#find, #find_at_time, #find_at_time!
Instance Method Details
#bitemporal_id_key ⇒ Object
18 19 20 |
# File 'lib/activerecord-bitemporal/bitemporalize.rb', line 18 def bitemporal_id_key 'bitemporal_id' end |
#cached_find_by_statement(key, &block) ⇒ Object
Override ActiveRecord::Core::ClassMethods#cached_find_by_statement ‘.find_by` not use caching
24 25 26 |
# File 'lib/activerecord-bitemporal/bitemporalize.rb', line 24 def cached_find_by_statement(key, &block) ActiveRecord::StatementCache.create(connection, &block) end |
#inherited(klass) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/activerecord-bitemporal/bitemporalize.rb', line 28 def inherited(klass) super klass.prepend_relation_delegate_class ActiveRecord::Bitemporal::Relation klass.relation_delegate_class(ActiveRecord::Associations::CollectionProxy).prepend ActiveRecord::Bitemporal::CollectionProxy if relation_delegate_class(ActiveRecord::Relation).ancestors.include? ActiveRecord::Bitemporal::Relation::MergeWithExceptBitemporalDefaultScope klass.relation_delegate_class(ActiveRecord::Relation).prepend ActiveRecord::Bitemporal::Relation::MergeWithExceptBitemporalDefaultScope end end |