search for: parent_thumbnail_at_width

Displaying 2 results from an estimated 2 matches for "parent_thumbnail_at_width".

2006 Jul 22
7
Validation with has_many
I have two problems. I have a comment that has_many uploads. Before saving the comment, I want to be sure that the upload(s) has passed validation, but I also need to validate in other ways. For example, I do not want to save the comment if there is no comment or upload. Or, I do not want to save the comment if the image has been uploaded previously (comparing md5s with past upload md5s
2006 Jul 25
1
How do I validate using associated objects?
...ge = Magick::ImageList.new.from_blob(@upload_blob) self[:image_width] = @image.columns self[:image_height] = @image.rows end def create_thumbnail @thumbnail = Magick::ImageList.new.from_blob(@image[0].to_blob) if comment.parent_id == nil x = comment.board.setting(:parent_thumbnail_at_width) y = comment.board.setting(:parent_thumbnail_at_height) else x = comment.board.setting(:reply_thumbnail_at_width) y = comment.board.setting(:reply_thumbnail_at_height) end if @thumbnail.columns > x or @thumbnail.rows > y @thumbnail.change_geometry!("#...