-
Notifications
You must be signed in to change notification settings - Fork 82
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
Map attribute aliases to column names when initializing #95
base: master
Are you sure you want to change the base?
Map attribute aliases to column names when initializing #95
Conversation
@seuros @rafaelfranca there seem to be some job errors (not test failures) - can you re-run the jobs? |
@joelvh can you rebase/merge master to this branch ? |
@joelvh I think alias_attribute should be in active-model |
@seuros do you have a suggestion of how to accomplish this in ActiveModel? Using Pry, I didn't see any calls from the constructor handling the attributes using ActiveModel, from what I recall because I also thought it might fit there. The place to implement this in AR was much clearer. |
@seuros I've come up with a fix for ActiveModel in state-machines/state_machines-activemodel#28. However, my tests to see if ActiveRecord is fixed by this indicate the params handled by ActiveModel don't get passed to ActiveRecord. I'm doing some investigating, but it would appear my previous comment still stands, that AR either doesn't use the AM initialization or the transformed params are not passed along properly. |
@seuros my latest investigation points to It would seem that we need separate fixes (e.g. the two PRs I've created) unless there's a way to to have AR's initializer trigger AM's inside the state machine. |
bb1ab2a
to
bfa9d17
Compare
bfa9d17
to
0e32ee4
Compare
@seuros I've rebased this |
@seuros just checking to see if this is the route to go or the ActiveModel PR. |
@seuros will this be merged? |
Fixes https://github.com/state-machines/state_machines-activemodel/issues/2