Sha256: 17bce108dc2a8295b3132ea4b4d55422a958021f303c1c63dab7e6246f892526

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require 'acts_as_favoritor/version'

module ActsAsFavoritor

    autoload :Favoritor, 'acts_as_favoritor/favoritor'
    autoload :Favoritable, 'acts_as_favoritor/favoritable'
    autoload :FavoritorLib, 'acts_as_favoritor/favoritor_lib'
    autoload :FavoriteScopes, 'acts_as_favoritor/favorite_scopes'

    def self.setup
        @configuration ||= Configuration.new
        yield @configuration if block_given?
    end

    def self.method_missing method_name, *args, &block
        if method_name == :custom_parent_classes=
            ActiveSupport::Deprecation.warn 'Setting custom parent classes is deprecated and will be removed in future versions.'
        end
        @configuration.respond_to?(method_name) ?
        @configuration.send(method_name, *args, &block) : super
    end

    class Configuration
        attr_accessor :custom_parent_classes

        def initialize
            @custom_parent_classes = []
        end
    end

    setup

    require 'favoritor/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3
    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_favoritor-1.0.0 lib/acts_as_favoritor.rb