Sha256: 7ee2b5006dffae00a9ce318334407277e12b6ca7fdb064d4971189de32aa8b96
Contents?: true
Size: 452 Bytes
Versions: 15
Compression:
Stored size: 452 Bytes
Contents
# typed: false 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
15 entries across 14 versions & 1 rubygems