Sha256: b0ce0e43429230fd94b51d0dba4204c73d249e2fb777eae51b496f7365558dda

Contents?: true

Size: 867 Bytes

Versions: 1

Compression:

Stored size: 867 Bytes

Contents

require 'yaml'
require 'configurations'
require "rails/paths"
require "active_support/concern"
require 'active_support/core_ext/module/delegation'
require 'rails/railtie'
require 'active_record'

require "auto_scopes/version"
require "auto_scopes/associations_methods"
require "auto_scopes/associations_chains"
require "auto_scopes/check_models"

module AutoScopes
	include Configurations

	configurable :auto_scopes_location, :scope_association_prefix, :create_scope_for_association

	configuration_defaults do |c|
		c.auto_scopes_location         = 'config/auto_scopes'
		c.scope_association_prefix     = 'by'
		c.create_scope_for_association = true
  end

	class << self
		def config
			AutoScopes.configuration
		end

		def associations_source
			@_associations_source ||= YAML.load_file(Rails.root.join(config.auto_scopes_location + '.yml')) || []
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
auto_scopes-0.1.0 lib/auto_scopes.rb