Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ActiveRecord transitions which don't include Statesman::Adapt…
…ers::ActiveRecordTransition In #306, we made the "updated timestamp column" for a transition configurable through a `class_attribute` on `Statesman::Adapters::ActiveRecordTransition`, which is generally `include`d on transition classes. However, not all transition classes include this module, and indeed we have [advised][1] in the README not to include it when using a PostgreSQL JSON column type for metadata, as pointed out by #309. This leads to an exception like the following when trying to perform a transition: ``` NoMethodError: undefined method `updated_timestamp_column' for #<Class:0x00007fdd2ade07b0> ``` This fixes the issue by defaulting to using `:updated_at` as before if the transition class doesn't have an `.updated_timestamp_column` method defined. As a follow-up action, it'd be nice to get all transitions including the module to have a more consistent and friendly base for future improvements to Statesman, as discussed in the [issue comments][2]. This, however, would be a breaking change and should be introduced separately after more thought. Fixes #309. [1]: https://github.com/gocardless/statesman#using-postgresql-json-column [2]: #309 (comment)
- Loading branch information