TLDR:
amount
=> amount(1i)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Transaction < ApplicationRecord
# …
def amount=(value)
if value.is_a? Hash
# do stuff with value[1] etc
end
super(value)
end
# …
end