1
MiniExiftool에서 작업하는 Paperclip을 얻으려고합니다. 내가 할업데이트 할 때 참조가 없음
# 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: Column 'user_id' cannot be null ...
저장하지 않고
나는 마지막으로 쓴! 모두 잘 작동하지만 self.date는 null로 남습니다 (exif [ 'date_time_original']이 null이 아니더라도).
저는 정말 좌절합니다. MiniExiftool에서 Paperclip을 사용하려면 어떻게해야합니까?