Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Raise InvalidContext error when the current state does not define a state-driven behavior
* Fix target state being indeterminate for transitions that use blacklists
* Allow super to be called within state-driven behaviors
* Fix issue with Rails 6.1+ where ActiveRecord.column_defaults returns `frozen` hash

## 1.2.0 / 2013-03-30

Expand Down
2 changes: 1 addition & 1 deletion lib/state_machine/machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def initialize_state(object, options = {})
if state && (options[:force] || initialize_state?(object))
value = state.value

if hash = options[:to]
if hash = options[:to].dup
hash[attribute.to_s] = value
else
write(object, :state, value)
Expand Down