Sha256: e736cd4373ed96d0f86e25f12f4b42e7342a44f46ca964ed6d415564f7d205c3

Contents?: true

Size: 718 Bytes

Versions: 1

Compression:

Stored size: 718 Bytes

Contents

module Form
  extend ActiveSupport::Concern

  included do
    attr_accessor :_subtitle

    validates :_subtitle, invisible_captcha: true

    delegate :virtual?, :has_attachments?, :has_collections?, to: :class
  end

  class_methods do
    def virtual?
      false
    end

    def has_attachments?
      respond_to? :attachments
    end

    def has_collections?
      respond_to? :collections
    end

    def has_collections(*collections)
      define_singleton_method :collections do
        collections
      end

      delegate :collections, to: :class
    end
  end

  class << self
    def structure_models
      %w[
        Form::Structure
        Form::Field
        Form::Email
      ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin_cms-0.0.1 app/models/form.rb