Sha256: 91fd8f3743b80cefa2662094cd4e0ff5e16e549949fb0b0333cd854f32c57a59

Contents?: true

Size: 1021 Bytes

Versions: 2

Compression:

Stored size: 1021 Bytes

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 'acts_as_favoritor/railtie' if defined?(Rails)

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_favoritor-1.0.2 lib/acts_as_favoritor.rb
acts_as_favoritor-1.0.1 lib/acts_as_favoritor.rb