Closed vendethiel closed 9 years ago
I didn't quite get your use-case. It would be great if you could share an example.
Also, do you mean to save crop_x
and crop_y
attributes in the database? And what about crop_w
and crop_h
? Virtual attributes or database fields?
Sorry - I save them all. The "x_crop_y" means "ATTR_crop_xywh". I need to keep these to crop through later uploaded images (and try to recognize the entity associated to them). Thanks
I'm running into a problem using this gem with CarrierWave::Backgrounder and I think it's due to these virtual attributes not being persisted through Delayed::Job
.
@vendethiel Would you mind sharing your workaround so I can see whether that solves the issue for me? Thank you in advance.
Uhm, I don't remember exactly; but I'll check tomorrow if I remember to.
def update(attributes)
with_transaction_returning_status do
assign_attributes(attributes)
%w(x y h w).each do |pos|
write_attribute(pos, attributes["image_crop_#{pos}"])
end
save
end
end
Hey,
I just wanted to know if you'd be okay with an option to disable the auto-generation of the
attr_accessor
s for theX_crop_Y
attributes. My use case needs me to save those, and I'd rather not have some glue code to save them in the model.