Sha256: 184b7a45a47289eeaf978ef53a6d127811b78555666bb095f66210eadb931aa6

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

# This is here because responders don't require it.
require 'rails/engine'
require 'responders'

require_relative 'inherited_resources/engine'
require_relative 'inherited_resources/blank_slate'
require_relative 'inherited_resources/responder'

module InheritedResources
  ACTIONS = [ :index, :show, :new, :edit, :create, :update, :destroy ] unless self.const_defined?(:ACTIONS)

  autoload :Actions,            'inherited_resources/actions'
  autoload :BaseHelpers,        'inherited_resources/base_helpers'
  autoload :ShallowHelpers,     'inherited_resources/shallow_helpers'
  autoload :BelongsToHelpers,   'inherited_resources/belongs_to_helpers'
  autoload :ClassMethods,       'inherited_resources/class_methods'
  autoload :DSL,                'inherited_resources/dsl'
  autoload :PolymorphicHelpers, 'inherited_resources/polymorphic_helpers'
  autoload :SingletonHelpers,   'inherited_resources/singleton_helpers'
  autoload :UrlHelpers,         'inherited_resources/url_helpers'
  autoload :VERSION,            'inherited_resources/version'

  # Change the flash keys used by FlashResponder.
  def self.flash_keys=(array)
    Responders::FlashResponder.flash_keys = array
  end
end

ActiveSupport.on_load(:action_controller_base) do
  # If you cannot inherit from InheritedResources::Base you can call
  # inherit_resources in your controller to have all the required modules and
  # functionality included.
  def self.inherit_resources
    InheritedResources::Base.inherit_resources(self)
    initialize_resources_class_accessors!
    create_resources_url_helpers!
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inherited_resources-2.0.1 lib/inherited_resources.rb