Sha256: d36b921785caa234b2a071bd3349b65296cca26f054de521b6e642525267ac73

Contents?: true

Size: 1.79 KB

Versions: 5

Compression:

Stored size: 1.79 KB

Contents

# frozen_string_literal: true

module Motor
  module BuildSchema
    module ColumnAccessTypes
      ALL = [
        READ_ONLY = 'read_only',
        WRITE_ONLY = 'write_only',
        READ_WRITE = 'read_write',
        HIDDEN = 'hidden'
      ].freeze
    end

    SEARCHABLE_COLUMN_TYPES = %i[citext text string bitstring].freeze

    COLUMN_NAME_ACCESS_TYPES = {
      id: ColumnAccessTypes::READ_ONLY,
      created_at: ColumnAccessTypes::READ_ONLY,
      updated_at: ColumnAccessTypes::READ_ONLY,
      deleted_at: ColumnAccessTypes::READ_ONLY
    }.with_indifferent_access.freeze

    DEFAULT_SCOPE_TYPE = 'default'

    DEFAULT_ACTIONS = [
      {
        name: 'create',
        display_name: 'Create',
        action_type: 'default',
        preferences: {},
        visible: true
      },
      {
        name: 'edit',
        display_name: 'Edit',
        action_type: 'default',
        preferences: {},
        visible: true
      },
      {
        name: 'remove',
        display_name: 'Remove',
        action_type: 'default',
        preferences: {},
        visible: true
      }
    ].freeze

    DEFAULT_TABS = [
      {
        name: 'details',
        display_name: 'Details',
        tab_type: 'default',
        preferences: {},
        visible: true
      }
    ].freeze

    module_function

    def call
      schema = LoadFromRails.call
      schema = MergeSchemaConfigs.call(schema)

      ReorderSchema.call(schema)
    end
  end
end

require_relative './build_schema/active_storage_attachment_schema'
require_relative './build_schema/load_from_rails'
require_relative './build_schema/find_display_column'
require_relative './build_schema/persist_resource_configs'
require_relative './build_schema/reorder_schema'
require_relative './build_schema/merge_schema_configs'
require_relative './build_schema/utils'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
motor-admin-0.1.37 lib/motor/build_schema.rb
motor-admin-0.1.36 lib/motor/build_schema.rb
motor-admin-0.1.35 lib/motor/build_schema.rb
motor-admin-0.1.34 lib/motor/build_schema.rb
motor-admin-0.1.33 lib/motor/build_schema.rb