-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Destroy callback default changed to :before #683
Conversation
There may be a better alternative, see discussion in #682. |
Also, if we were to proceed with this PR, it would need a test, please. |
Actually, we don't have tests set up for rails 5 yet, do we? I'll see if I can do that. |
I've tried setting up a Rails 5 env but it looks like it might be a bit premature (dependencies force us to also support Sinatra 2.0.0 which is alpha, the |
I'm actually working on this right now :) I'm trying out appraisal. If you want to email me (jared at jaredbeck dot com) we can hop on skype or something. |
This is looking good. Can you squash your commits, please? |
All done - please re-review. |
@@ -5,7 +5,9 @@ module VersionConcern | |||
extend ::ActiveSupport::Concern | |||
|
|||
included do | |||
belongs_to :item, :polymorphic => true | |||
opts = {:polymorphic => true} | |||
opts[:required] = false if ActiveRecord::Base.respond_to? :belongs_to_required_by_default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both this change (required: false) and the change to the default recording_order
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't - I was trying to revert that. Let me try again.
Also warn if paper_trail_on_destroy(:after) is combined with ActiveRecord belongs_to_required_by_default
Destroy callback default changed to :before
Merged, thanks Owen! |
👍 |
To allow after_destroy versioning with Rails 5; fixes #682