datacite / volpino

The DataCite Profiles service
https://profiles.datacite.org
MIT License
2 stars 0 forks source link

Bug claims pending #80

Closed kjgarza closed 5 years ago

kjgarza commented 5 years ago

write_attribute does not save to active record.


This change is Reviewable

mfenner commented 5 years ago

@kjgarza The saving to ActiveRecord should happen via the aasm_state gem: https://github.com/aasm/aasm#activerecord

kjgarza commented 5 years ago

ok, I can see that. In the validation I did, that does not seem to be working (saving to AR) . Probably , the transitions calls are missing the Bang!.

job.aasm.fire!(:run) # saved

I'll check the AASM docs

mfenner commented 5 years ago

Thanks! If aasm_state saves to active_record, write_attribute makes sense, reducing the number of database calls. Also, this was the working code used before switching to aasm_state, see commit history.