Skip to content

Instantly share code, notes, and snippets.

@mhfs
Created October 29, 2009 02:43
Show Gist options
  • Save mhfs/221066 to your computer and use it in GitHub Desktop.
Save mhfs/221066 to your computer and use it in GitHub Desktop.
class Asset < ActiveRecord::Base
attr_accessible :caption, :attachment, :attachment_file_name, :attachment_content_type, :attachment_file_size, :attachment_updated_at
has_attached_file :attachment,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
validates_attachment_presence :attachment
validates_presence_of :account_id, :caption
belongs_to :account
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment