Closed huoxito closed 9 years ago
Can you add a Changelog.md entry ?
@seuros ammended PR and submitted another one to sm-ar. Could you provide an example changelog entry? I'd add something like this there:
### Pass `static: false` in case you don't want initial states to be forced. e.g.
# will set the initial machine state
@machines.initialize_states(@object)
# optionally you can pass the attributes to have that as the initial state
@machines.initialize_states(@object, {}, { state: 'finished' })
# or pass set `static` to false if you want to keep the `object.state` current value
@machines.initialize_states(@object, { static: false })
ops missed your reply while writing mine sorry
You can choose the format for the Changelog
just added changelog entry
This is an attempt to get both this build and state_machines-ar builds green.
Currently state_machines-ar has at least 3 issues on latest rails assuming I got this right (features that used to work before):
state
column.Post.new state: 'finished'
I believe the changes here fix those tree issues on the activerecord side. However it changes the way the api for
initialize_states
work. Now if one don't want to force the initial state it has to explicitly passstatic: false
instead, previously it would only force if one passedstatic: :force
. Still the fix for # 2 mentioned above I got is so awful terrible I'd rather drop that feature. What you think? wouldn't really want to merge this as is myselfps. once this is resolved I'd submit https://github.com/huoxito/state_machines-activerecord/compare/4.2-states-initialization to sm-ar and double check if spree builds are ok with the latest version of all these projects.
// @seuros