Sha256: 2fbbb26656acddbae98c825c7872fe6f99f6a0e2b7162eca4a39378a0f15a467
Contents?: true
Size: 527 Bytes
Versions: 10
Compression:
Stored size: 527 Bytes
Contents
class Name include Mongoid::Document field :_id, type: String, default: ->{ "#{first_name}-#{last_name}" } field :first_name, type: String field :last_name, type: String field :parent_title, type: String embeds_many :translations, validate: false embeds_one :language, as: :translatable, validate: false embedded_in :namable, polymorphic: true accepts_nested_attributes_for :language attr_protected :_id, :id def set_parent=(set = false) self.parent_title = namable.title if set end end
Version data entries
10 entries across 10 versions & 3 rubygems