search for: reply_thumbnail_at_height

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

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?
...::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!("#{x}x#{y}") {|cols, rows, img| img.resize!(cols, rows)} end end def validate_on_create errors.add_to_base(comment.board.language(:error_toobig)) if self[:image_width] &gt...