Sha256: 00ef284d23f6be1b242283bfec755b5756d1d18391fbccc8db9e3886234d5925
Contents?: true
Size: 781 Bytes
Versions: 1
Compression:
Stored size: 781 Bytes
Contents
# frozen_string_literal: true module Archangel ## # Field model # class Field < ApplicationRecord ## # Available field types constant # CLASSIFICATIONS = %w[boolean email integer string url].freeze acts_as_paranoid acts_as_list scope: :collection_id, top_of_list: 0, add_new_at: :bottom validates :classification, presence: true, inclusion: { in: CLASSIFICATIONS } validates :collection_id, presence: true, on: :update validates :label, presence: true validates :required, inclusion: { in: [true, false] } validates :slug, presence: true, uniqueness: { scope: :collection_id } belongs_to :collection default_scope { order(position: :asc) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
archangel-0.4.0 | app/models/archangel/field.rb |