Sha256: cbfee7cae1d394f681b339a894c2c09b108fb15aad58aca71f850be25c381e09

Contents?: true

Size: 1.24 KB

Versions: 135

Compression:

Stored size: 1.24 KB

Contents

module Effective
  class Resource
    include Effective::Resources::Actions
    include Effective::Resources::Associations
    include Effective::Resources::Attributes
    include Effective::Resources::Controller
    include Effective::Resources::Init
    include Effective::Resources::Instance
    include Effective::Resources::Forms
    include Effective::Resources::Generator
    include Effective::Resources::I18n
    include Effective::Resources::Klass
    include Effective::Resources::Model
    include Effective::Resources::Naming
    include Effective::Resources::Paths
    include Effective::Resources::Relation
    include Effective::Resources::Sql
    include Effective::Resources::Tenants

    # In practice, this is initialized two ways
    # With a klass and a namespace from effective_datatables
    # Or with a controller_path from crud controller

    # post, Post, Admin::Post, admin::Post, admin/posts, admin/post, admin/effective::post
    def initialize(input, namespace: nil, relation: nil, &block)
      _initialize_input(input, namespace: namespace, relation: relation)

      # This is an effective_resource do ... end block
      _initialize_model(&block) if block_given?

      self
    end

    def to_s
      human_name
    end

  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
effective_resources-2.27.3 app/models/effective/resource.rb
effective_resources-2.27.2 app/models/effective/resource.rb
effective_resources-2.27.1 app/models/effective/resource.rb
effective_resources-2.27.0 app/models/effective/resource.rb
effective_resources-2.26.5 app/models/effective/resource.rb
effective_resources-2.26.4 app/models/effective/resource.rb
effective_resources-2.26.3 app/models/effective/resource.rb
effective_resources-2.26.2 app/models/effective/resource.rb
effective_resources-2.26.1 app/models/effective/resource.rb
effective_resources-2.26.0 app/models/effective/resource.rb
effective_resources-2.25.16 app/models/effective/resource.rb
effective_resources-2.25.15 app/models/effective/resource.rb
effective_resources-2.25.14 app/models/effective/resource.rb
effective_resources-2.25.13 app/models/effective/resource.rb
effective_resources-2.25.12 app/models/effective/resource.rb
effective_resources-2.25.11 app/models/effective/resource.rb
effective_resources-2.25.10 app/models/effective/resource.rb
effective_resources-2.25.9 app/models/effective/resource.rb
effective_resources-2.25.8 app/models/effective/resource.rb
effective_resources-2.25.7 app/models/effective/resource.rb