11

I would like to know if an image has changed on an ActiveRecord model object so I can perform other functions but don't see anything available to know this.

I.E.

object.image.changed? or object.image_changed? or object.changed? 
John Pollard
  • 3,729
  • 3
  • 24
  • 50

1 Answers1

10

If you would like to know before the object has saved:

object.attachment_changes.any?

If you would like to know after the changes having been committed, the only solution I've found so far is to check the blob:

object.image.blob.saved_changes?

Dan
  • 1,136
  • 10
  • 24