Created
November 23, 2010 19:47
-
-
Save matheusca/712394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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