Sha256: dff07376038e01f9d6a8d243e45c2048be75ecb16f037e4fce621ed0e7c17503
Contents?: true
Size: 601 Bytes
Versions: 27
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 class Game include Mongoid::Document field :high_score, type: Integer, default: 500 field :score, type: Integer, default: 0 field :name belongs_to :person, index: true, validate: true belongs_to :parent, class_name: "Game", foreign_key: "parent-id" has_one :video, validate: false has_many :ratings, as: :ratable, dependent: :nullify accepts_nested_attributes_for :person validates_format_of :name, without: /\$\$\$/ set_callback(:initialize, :after) do |document| write_attribute("name", "Testing") unless name end end
Version data entries
27 entries across 27 versions & 2 rubygems