Then one can access the column/key from the object instance:
# This would insert a new subscription with a `:data` field
# with the `Hash` type storing the key `:paddle_update_url`
# with the value `https://...`.
subscription = Subscription.new(paddle_update_url: 'https://...')
subscription.paddle_update_url
#=> 'https://...'
Some gems are using this method which allows to tell the column name where to store a given key:
This
store_accessor
method simply define getter/setter and dirty methods for the given keys.Then one can access the column/key from the object instance: