Skip to content

Instantly share code, notes, and snippets.

@matheusca
Created November 23, 2010 19:47
Show Gist options
  • Save matheusca/712394 to your computer and use it in GitHub Desktop.
Save matheusca/712394 to your computer and use it in GitHub Desktop.
class Admin::Condominio
include Mongoid::Document
field :nome, :type => String
field :endereco, :type => String
field :construtora, :type => String
field :bairro, :type => String
field :descricao, :type => String
field :piscina_adulta, :type => Boolean
field :piscina_infantil, :type => Boolean
field :playground, :type => Boolean
field :fitness, :type => Boolean
field :espaco_gourmet, :type => Boolean
field :sala_de_festa, :type => Boolean
field :salao_de_jogos, :type => Boolean
field :cameras_de_seguranca, :type => Boolean
field :gas_encanado, :type => Boolean
field :elevador_social, :type => Boolean
field :elevador_de_servico, :type => Boolean
field :portaria, :type => Boolean
field :quadra_de_esportes, :type => Boolean
field :area_de_churrasco, :type => Boolean
field :garagem, :type => Boolean
embeds_many :condominio_fotos
accepts_nested_attributes_for :condominio_fotos, :reject_if => lambda { |a| a[:foto].blank? }, :allow_destroy => true
end
require 'carrierwave/orm/mongoid'
class CondominioFoto
include Mongoid::Document
mount_uploader :foto, FotoUploader
embedded_in :admin_condominio, :inverse_of => :condominio_fotos
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment