Sha256: 48f0160ced9da1f81c3676163b4cb878f2d7ae22ca71778f10d037fd1d31852e

Contents?: true

Size: 708 Bytes

Versions: 1

Compression:

Stored size: 708 Bytes

Contents

module RademadeAdmin
  module ModelOptions

    def options(&options_block)
      configuration.instance_eval &options_block
    end

    def model_name
      configuration.model_name
    end

    def item_name
      configuration.item_name
    end

    def parent_menu_item
      configuration.parent_menu_item
    end

    def model_class
      configuration.model_class
    end

    def model_info
      @model_info ||= Model::Graph.instance.model_info(model_class)
    end

    def init_model_info(model_reflection)
      Model::Info.new(model_reflection, configuration)
    end

    private
    
    def configuration
      @configuration ||= Model::Configuration.new(controller_name)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rademade_admin-0.0.1 app/services/model_controller/model_options.rb