Skip to content

Instantly share code, notes, and snippets.

@matheusca
Created February 14, 2011 19:49
Show Gist options
  • Save matheusca/826416 to your computer and use it in GitHub Desktop.
Save matheusca/826416 to your computer and use it in GitHub Desktop.
class Addict
include Mongoid::Document
embeds_many :addict_photos
accepts_nested_attributes_for :addict_photos
field :date, :type => Date
end
class AddictPhoto
include Mongoid::Document
embedded_in :addict, :inverse_of => :addict_photo
mount_uploader :image, AddictUploader
field :right, :type => Boolean
field :left, :type => Boolean
field :up, :type => Boolean
field :down, :type => Boolean
field :size, :type => Integer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment