Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the store_accessor method #280

Closed
zedtux opened this issue Oct 15, 2021 · 0 comments · Fixed by #282
Closed

Add support for the store_accessor method #280

zedtux opened this issue Oct 15, 2021 · 0 comments · Fixed by #282
Labels
feature New functionalities

Comments

@zedtux
Copy link
Collaborator

zedtux commented Oct 15, 2021

Some gems are using this method which allows to tell the column name where to store a given key:

class Subscription
  store_accessor :data, :paddle_update_url
end

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:

# 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://...'
@zedtux zedtux added the feature New functionalities label Oct 15, 2021
@zedtux zedtux linked a pull request Oct 17, 2021 that will close this issue
zedtux added a commit that referenced this issue Oct 17, 2021
…port

Implements the `store_accessor` method (Closes #280)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionalities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant