Class: DoubleEntry::Account::ActiveRecordScopeFactory
- Inherits:
-
Object
- Object
- DoubleEntry::Account::ActiveRecordScopeFactory
- Defined in:
- lib/double_entry/account.rb
Instance Method Summary collapse
-
#initialize(active_record_class) ⇒ ActiveRecordScopeFactory
constructor
A new instance of ActiveRecordScopeFactory.
- #scope_identifier ⇒ Object
Constructor Details
#initialize(active_record_class) ⇒ ActiveRecordScopeFactory
Returns a new instance of ActiveRecordScopeFactory.
39 40 41 |
# File 'lib/double_entry/account.rb', line 39 def initialize(active_record_class) @active_record_class = active_record_class end |
Instance Method Details
#scope_identifier ⇒ Object
43 44 45 |
# File 'lib/double_entry/account.rb', line 43 def scope_identifier ->(value) { value.is_a?(@active_record_class) ? value.id : value } end |