You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In Rails 6 and above, kt-paperlcip fails on line 98 in lib/paperclip/has_attached_file.rb where an :on condition is used for after_commit / destroy
93 def add_active_record_callbacks
94 name = @name
95 @klass.send(:after_save) { send(name).send(:save) }
96 @klass.send(:before_destroy) { send(name).send(:queue_all_for_delete) }
97 if @klass.respond_to?(:after_commit)
98 @klass.send(:after_commit, on: :destroy) do
99 send(name).send(:flush_deletes)
100 end
101 else
102 @klass.send(:after_destroy) { send(name).send(:flush_deletes) }
103 end
104 end
To Reproduce
Steps to reproduce the behavior:
Implement has_attached_file with any settings
Attempt an rspec run, rails console, or start a puma server etc.
For now, you can just fork kt-paperclip, and comment out the :after_commit part. This is what uses the :on operator and throws the error. Leave the :after_destroy, just remove it from the if/else
Describe the bug
In Rails 6 and above, kt-paperlcip fails on line 98 in lib/paperclip/has_attached_file.rb where an :on condition is used for after_commit / destroy
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should function normally.
Desktop (please complete the following information):
Looks like someone else has hit this:
https://stackoverflow.com/questions/76966547/rails-7-argumenterror-unknown-key-on-valid-keys-are-if-unless-prepend
The text was updated successfully, but these errors were encountered: