Sha256: 747f79cc24f556a0cd00cb9f440e858a58eb2d4fa9047c5a3780e9949b0b2459

Contents?: true

Size: 489 Bytes

Versions: 6

Compression:

Stored size: 489 Bytes

Contents

module Season

  class Configuration

    attr_accessor :include_by_default

    def initialize
      @include_by_default = false
    end

  end
    
  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration
    auto_include_scopes
  end

  private

    def self.auto_include_scopes
      if configuration.include_by_default
        ActiveRecord::Base.send(:include, Season::Scopes) if defined? ActiveRecord
      end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
season-0.1 lib/season/configuration.rb
season-0.0.6 lib/season/configuration.rb
season-0.0.5 lib/season/configuration.rb
season-0.0.4 lib/season/configuration.rb
season-0.0.3 lib/season/configuration.rb
season-0.0.2 lib/season/configuration.rb