activerecord-typedstore
activerecord-typedstore copied to clipboard
Add prefix to attribute definition
Whilst adding accessor: false, I thought it would be convenient to add prefix to attributes as well. It also fixes https://github.com/byroot/activerecord-typedstore/issues/7.
Thoughts?
@byroot @rafaelfranca
LGTM
Coverage decreased (-0.09%) to 94.617% when pulling d5d757c0a5cefdcb4da57d778d51685bc03f985f on maximebedard:add-prefix into fff4ec50041dbe5eac272fbce1a0491bc64e4c90 on byroot:master.
Coverage decreased (-0.3%) to 94.418% when pulling 9fb6b33e0f2bb028c8ccfb2fb73a35ca04bb6b66 on maximebedard:add-prefix into fff4ec50041dbe5eac272fbce1a0491bc64e4c90 on byroot:master.
Typed Store looks great! It would really be a good fit to simplify something my team did a long time ago. The one thing that's stopping me from using it is the :prefix
option (specifically with a string/symbol prefix). This PR seems very close, except that the regular ActiveRecord Store allows prefix: :foo
instead of prefix: true
, to prefix the methods with 'foo_'
instead of the field name.
Is there anything I can do to help get this PR out and get the string/symbol prefix complete?
Here's the relevant ActiveRecord code. https://github.com/rails/rails/blob/de53ba56cab69fb9707785a397a59ac4aaee9d6f/activerecord/lib/active_record/store.rb#L112-L120
Thanks!
Is there anything I can do to help get this PR out and get the string/symbol prefix complete?
This PR is very outdated, but if you feel like submitting a similar one that is rebased, I'll review it.
Sounds good. Thanks, Jean!
I was also looking for this functionality as well, so I went ahead and rebased and put up a PR at #91