Skip to content

Instantly share code, notes, and snippets.

@AstDerek
Created January 8, 2013 19:36
Show Gist options
  • Save AstDerek/4487171 to your computer and use it in GitHub Desktop.
Save AstDerek/4487171 to your computer and use it in GitHub Desktop.
class Album < ActiveRecord::Base
has_many :images
belongs_to :gallery, :polymorphic => true
attr_accessible :title
end
class Category < ActiveRecord::Base
attr_accessible :name
end
class Description < ActiveRecord::Base
belongs_to :language
belongs_to :localized, :polymorphic => true
attr_accessible :contents
end
class Event < ActiveRecord::Base
has_one :album, :as => :gallery
has_many :descriptions, :as => :localized
has_many :contact_informations, :class_name => "General_field"
has_many :related_links, :class_name => "General_field"
belongs_to :category
attr_accessible :date, :fee, :location, :teaser
end
class General_field < ActiveRecord::Base
attr_accessible :label, :contents
end
class Image < ActiveRecord::Base
belongs_to :album
attr_accessible :title, :path
end
class Language < ActiveRecord::Base
attr_accessible :name, :shortcode # Name in diff languages? This is n^2 worth of names
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment