Sha256: 15c7a712288a74d86c6ea96f35d3aebd5a6bd4000db58d133ac43f5ad7bd8888
Contents?: true
Size: 453 Bytes
Versions: 60
Compression:
Stored size: 453 Bytes
Contents
# typed: strict class SpellBook < ApplicationRecord validates :name, length: { minimum: 5 }, presence: true # simulate when belongs_to is optional by default, but it is enforced at the DB level belongs_to :wizard, optional: true # habtm enforced at the DB level has_and_belongs_to_many :spells enum book_type: { unclassified: 0, biology: 1, dark_art: 999, } scope :recent, -> { where('created_at > ?', 1.month.ago) } end
Version data entries
60 entries across 22 versions & 1 rubygems