Class: DoubleEntry::Account::ActiveRecordScopeFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/double_entry/account.rb

Instance Method Summary collapse

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_identifierObject



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