Created
August 6, 2008 17:48
-
-
Save haikuwebdev/4243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostImage < ActiveRecord::Base | |
# So we can code post_image.category instead of the uglier post_image.post_image_category | |
belongs_to :category, :class_name => 'PostImageCategory', :foreign_key => 'post_image_category_id' | |
# You may want to pass other options to has_attachment. | |
# See the attachment_fu README. | |
has_attachment :content_type => :image, | |
:storage => :file_system, | |
# There is no size restriction on thumbnails. | |
# But you'll probably want them to fit in the TinyMCE plugin popup dialog. | |
:thumbnails => {:small => '124'} | |
validates_as_attachment | |
named_scope :thumbnails, :conditions => {:thumbnail => 'thumbnail'} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment