Skip to content

Commit

Permalink
Refactor before_update and before_create to before_save
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Bleh committed Nov 20, 2014
1 parent c20ed05 commit f6bece9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/papercrop/model_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def crop_attached_file(attachment_name, opts = {})
definitions[attachment_name][:processors] ||= []
definitions[attachment_name][:processors] = definitions[attachment_name][:processors].unshift(:cropper)

before_update :"reprocess_to_crop_#{attachment_name}_attachment"
before_create :"reprocess_to_crop_#{attachment_name}_attachment"
before_save :"reprocess_to_crop_#{attachment_name}_attachment"
end
end

Expand Down

0 comments on commit f6bece9

Please sign in to comment.