Sha256: 56e3af0d0c7e6348b3b1195e51af21c2912f0cb61576c06d8796cbe866ca4bf4
Contents?: true
Size: 1 KB
Versions: 15
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true # encoding: utf-8 class EmmCongress include Mongoid::Document embeds_many :legislators, class_name: 'EmmLegislator' field :name, type: String end class EmmLegislator include Mongoid::Document embedded_in :congress, class_name: 'EmmCongress' field :a, type: Integer, default: 0 field :b, type: Integer, default: 0 end # Models with associations with :class_name as a :: prefixed string class EmmCcCongress include Mongoid::Document embeds_many :legislators, class_name: '::EmmCcLegislator' field :name, type: String end class EmmCcLegislator include Mongoid::Document embedded_in :congress, class_name: '::EmmCcCongress' field :a, type: Integer, default: 0 field :b, type: Integer, default: 0 end class EmmManufactory include Mongoid::Document embeds_many :products, order: :id.desc, class_name: 'EmmProduct' end class EmmProduct include Mongoid::Document embedded_in :manufactory, class_name: 'EmmManufactory' field :name, type: String end
Version data entries
15 entries across 15 versions & 2 rubygems