ペーパークリップをMiniExiftoolで動作させようとしています。
私はついにこれを書きました:
# Photo model
belongs_to :user
has_attached_file :picture
after_picture_post_process :copy_exif_data
private
def copy_exif_data
exif = MiniExiftool.new picture.queued_for_write[:original].path
self.date = exif['date_time_original']
save!
end
私は得る:
Mysql :: Error:列'user_id'をnullにすることはできません...
保存せずに!すべて正常に機能しますが、self.dateはnullのままです(exif ['date_time_original']がnullでなくても)。
本当に欲求不満です。ペーパークリップをMiniExiftoolで動作させるにはどうすればよいですか?