Skip to content

Instantly share code, notes, and snippets.

@brycemcd
Created June 30, 2010 23:15
Show Gist options
  • Save brycemcd/459346 to your computer and use it in GitHub Desktop.
Save brycemcd/459346 to your computer and use it in GitHub Desktop.
class Design < ActiveRecord::Base
has_many :comments, :dependent => :destroy
has_many :images, :dependent => :destroy
has_many :orders
belongs_to :event
named_scope :all_derbies, { :conditions => {:derby => true} }
named_scope :active_derbies, { :conditions => {:derby => true, :active_in_derby => true} }
has_attached_file :display, :styles => { :event => "305x350>", :box => "100x100#" }
validates_attachment_presence :display
has_attached_file :printer
validates_attachment_presence :printer
before_printer_post_process :save_printer_as_file
def save_printer_as_file
false if self.printer
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment