Open aleksey-bitwine opened 7 years ago
Since ActiveRecord 5.0 the "[]" method is not called via method_missing: https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/relation/delegation.rb#L39
So accounts[:outstanding, :liability, true] raises "ArgumentError: wrong number of arguments (given 3, expected 1..2)" exception.
I think that https://github.com/vitaly/debitcredit/blob/master/app/models/debitcredit/account.rb#L25 has to be renamed and "[]" can be an alias only (for backward compatibility)
I have created workaround: https://github.com/barges/debitcredit/commit/78285a237137305961f4a5faa915ef38bb18d021
It works
Since ActiveRecord 5.0 the "[]" method is not called via method_missing: https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/relation/delegation.rb#L39
So accounts[:outstanding, :liability, true] raises "ArgumentError: wrong number of arguments (given 3, expected 1..2)" exception.
I think that https://github.com/vitaly/debitcredit/blob/master/app/models/debitcredit/account.rb#L25 has to be renamed and "[]" can be an alias only (for backward compatibility)