-
Notifications
You must be signed in to change notification settings - Fork 91
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
Check for valid configuration keys on initialization #118
Comments
I would have to dig into other gems to see a pattern... but is there any general agreement on how do handle keys that are not "handled"? Let's look at it from transitions point of view... event :explode, :timestamp => true, :foo => true do
transitions :from => :complete, :to => :exploded
end In the above, we obviously use class Order < ActiveRecord::Base
include ActiveModel::Transitions
state_machine :auto_scopes => true, :invalid_option => true do #introduced :invalid_option key
state :pick_line_items
state :picking_line_items
event :move_cart do
transitions to: :pick_line_items, from: :picking_line_items
end
end
end In the next example we are not working on the |
Rails uses |
@geoffgarside - Thanks for the heads up how rails handles it. I think if we add it into this gem we will have to be very consistent in adding this type of assertion across each interface where we are passing in keys. |
@jondecko @geoffgarside sounds excellent to me. Personally I am all on the "raise hell" side when it comes to invalid keys since imho it's too easy to make a mistake you'll only notice in production 4 weeks later. |
You are correct. This change would potentially break code that is working through silent errors. We just have to properly communicate that when/if this gets merged. |
Since we're following semantic versioning this shouldn't be a problem - we'd just bump up our gem version to a major version number which would already indicate that we break backwards compatibility. |
Originated from here: #117
The text was updated successfully, but these errors were encountered: