rules 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rules.rb +0 -2
- data/lib/rules/has_rules.rb +0 -1
- data/lib/rules/rule.rb +0 -2
- data/lib/rules/rule_set.rb +0 -2
- data/lib/rules/version.rb +1 -1
- data/spec/dummy/app/models/admin_user.rb +1 -5
- data/spec/dummy/app/models/order.rb +0 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +6 -45
- data/spec/dummy/config/boot.rb +3 -9
- data/spec/dummy/config/environment.rb +2 -2
- data/spec/dummy/config/environments/development.rb +20 -16
- data/spec/dummy/config/environments/production.rb +44 -32
- data/spec/dummy/config/environments/test.rb +18 -13
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +0 -5
- data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/spec/dummy/config/locales/en.yml +0 -3
- data/spec/dummy/config/routes.rb +1 -2
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +27 -27
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7b26e3bb3dcf16334c7b8cc2b441a4971e691f
|
4
|
+
data.tar.gz: 92494c4160992aa98709d165d4cbd33022a116c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb3f61a95053cebdbaf101f41a60ef9ec299ead259cffb116d53acce0c308704109925fc5c8825280bd78db3d14f5d40d94952d59d752c58362302b31eee673
|
7
|
+
data.tar.gz: 18d2e51d487c6d44fbe0c721442fd02c6fa8faab9c940628cf038991c7766772870cd913e983e14eb8ded457ebb185fab5a76c878ceb98e5e9fa99728db7ec45
|
data/lib/rules.rb
CHANGED
data/lib/rules/has_rules.rb
CHANGED
@@ -4,7 +4,6 @@ module Rules
|
|
4
4
|
base.instance_eval do
|
5
5
|
has_one :rule_set, class_name: 'Rules::RuleSet', as: :source, dependent: :destroy
|
6
6
|
|
7
|
-
attr_accessible :rule_set_attributes
|
8
7
|
accepts_nested_attributes_for :rule_set, allow_destroy: true
|
9
8
|
|
10
9
|
def has_rule_attributes(attributes = {})
|
data/lib/rules/rule.rb
CHANGED
@@ -3,8 +3,6 @@ require 'rules/parameters'
|
|
3
3
|
|
4
4
|
module Rules
|
5
5
|
class Rule < ActiveRecord::Base
|
6
|
-
attr_accessible :rule_set, :evaluator_key, :lhs_parameter_key, :rhs_parameter_key, :rhs_parameter_raw
|
7
|
-
|
8
6
|
belongs_to :rule_set, class_name: 'Rules::RuleSet'
|
9
7
|
|
10
8
|
validates :evaluator_key, presence: true, inclusion: {in: Evaluators.list.keys.map(&:to_s)}
|
data/lib/rules/rule_set.rb
CHANGED
data/lib/rules/version.rb
CHANGED
@@ -2,10 +2,6 @@ class AdminUser < ActiveRecord::Base
|
|
2
2
|
# Include default devise modules. Others available are:
|
3
3
|
# :token_authenticatable, :confirmable,
|
4
4
|
# :lockable, :timeoutable and :omniauthable
|
5
|
-
devise :database_authenticatable,
|
5
|
+
devise :database_authenticatable,
|
6
6
|
:recoverable, :rememberable, :trackable, :validatable
|
7
|
-
|
8
|
-
# Setup accessible (or protected) attributes for your model
|
9
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me
|
10
|
-
# attr_accessible :title, :body
|
11
7
|
end
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -1,15 +1,10 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
|
4
|
-
require "active_record/railtie"
|
5
|
-
require "action_controller/railtie"
|
6
|
-
require "action_mailer/railtie"
|
7
|
-
require "active_resource/railtie"
|
8
|
-
require "sprockets/railtie"
|
9
|
-
# require "rails/test_unit/railtie"
|
3
|
+
require 'rails/all'
|
10
4
|
|
11
|
-
|
12
|
-
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
13
8
|
|
14
9
|
module Dummy
|
15
10
|
class Application < Rails::Application
|
@@ -17,16 +12,6 @@ module Dummy
|
|
17
12
|
# Application configuration should go into files in config/initializers
|
18
13
|
# -- all .rb files in that directory are automatically loaded.
|
19
14
|
|
20
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
21
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
22
|
-
|
23
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
24
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
25
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
26
|
-
|
27
|
-
# Activate observers that should always be running.
|
28
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
29
|
-
|
30
15
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
31
16
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
32
17
|
# config.time_zone = 'Central Time (US & Canada)'
|
@@ -35,31 +20,7 @@ module Dummy
|
|
35
20
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
36
21
|
# config.i18n.default_locale = :de
|
37
22
|
|
38
|
-
#
|
39
|
-
config.
|
40
|
-
|
41
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
42
|
-
config.filter_parameters += [:password]
|
43
|
-
|
44
|
-
# Enable escaping HTML in JSON.
|
45
|
-
config.active_support.escape_html_entities_in_json = true
|
46
|
-
|
47
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
48
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
49
|
-
# like if you have constraints or database-specific column types
|
50
|
-
# config.active_record.schema_format = :sql
|
51
|
-
|
52
|
-
# Enforce whitelist mode for mass assignment.
|
53
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
54
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
55
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
56
|
-
config.active_record.whitelist_attributes = true
|
57
|
-
|
58
|
-
# Enable the asset pipeline
|
59
|
-
config.assets.enabled = true
|
60
|
-
|
61
|
-
# Version of your assets, change this if you want to expire all your assets
|
62
|
-
config.assets.version = '1.0'
|
23
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
24
|
+
config.active_record.raise_in_transactional_callbacks = true
|
63
25
|
end
|
64
26
|
end
|
65
|
-
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
require 'bundler'
|
7
|
-
Bundler.setup
|
8
|
-
end
|
9
|
-
|
10
|
-
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
3
|
+
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
4
|
+
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -6,32 +6,36 @@ Dummy::Application.configure do
|
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_controller.perform_caching = false
|
15
15
|
|
16
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
|
-
#
|
23
|
-
config.
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
24
|
|
25
|
-
#
|
26
|
-
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
27
29
|
|
28
|
-
#
|
29
|
-
#
|
30
|
-
config.
|
30
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
|
+
# yet still be able to expire them through the digest params.
|
32
|
+
config.assets.digest = true
|
31
33
|
|
32
|
-
#
|
33
|
-
|
34
|
+
# Adds additional error checking when serving assets at runtime.
|
35
|
+
# Checks for improperly declared sprockets dependencies.
|
36
|
+
# Raises helpful error messages.
|
37
|
+
config.assets.raise_runtime_errors = true
|
34
38
|
|
35
|
-
#
|
36
|
-
config.
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
37
41
|
end
|
@@ -1,67 +1,79 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
-
# Code is not reloaded between requests
|
4
|
+
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
|
-
#
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
8
14
|
config.consider_all_requests_local = false
|
9
15
|
config.action_controller.perform_caching = true
|
10
16
|
|
11
|
-
#
|
12
|
-
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
13
26
|
|
14
|
-
# Compress JavaScripts and CSS
|
15
|
-
config.assets.
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
16
30
|
|
17
|
-
#
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
18
32
|
config.assets.compile = false
|
19
33
|
|
20
|
-
#
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
21
36
|
config.assets.digest = true
|
22
37
|
|
23
|
-
#
|
24
|
-
# config.assets.manifest = YOUR_PATH
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
25
39
|
|
26
|
-
# Specifies the header that your server uses for sending files
|
27
|
-
# config.action_dispatch.x_sendfile_header =
|
28
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
29
43
|
|
30
44
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
45
|
# config.force_ssl = true
|
32
46
|
|
33
|
-
#
|
34
|
-
#
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
35
50
|
|
36
|
-
# Prepend all log lines with the following tags
|
51
|
+
# Prepend all log lines with the following tags.
|
37
52
|
# config.log_tags = [ :subdomain, :uuid ]
|
38
53
|
|
39
|
-
# Use a different logger for distributed setups
|
54
|
+
# Use a different logger for distributed setups.
|
40
55
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
56
|
|
42
|
-
# Use a different cache store in production
|
57
|
+
# Use a different cache store in production.
|
43
58
|
# config.cache_store = :mem_cache_store
|
44
59
|
|
45
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
-
# config.action_controller.asset_host =
|
47
|
-
|
48
|
-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
-
# config.assets.precompile += %w( search.js )
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
50
62
|
|
51
|
-
#
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
52
65
|
# config.action_mailer.raise_delivery_errors = false
|
53
66
|
|
54
|
-
# Enable threaded mode
|
55
|
-
# config.threadsafe!
|
56
|
-
|
57
67
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
-
# the I18n.default_locale when a translation
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
59
69
|
config.i18n.fallbacks = true
|
60
70
|
|
61
|
-
# Send deprecation notices to registered listeners
|
71
|
+
# Send deprecation notices to registered listeners.
|
62
72
|
config.active_support.deprecation = :notify
|
63
73
|
|
64
|
-
#
|
65
|
-
|
66
|
-
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
67
79
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,31 +7,36 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
11
|
-
|
12
|
-
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
13
14
|
|
14
|
-
#
|
15
|
-
config.
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
16
18
|
|
17
|
-
# Show full error reports and disable caching
|
19
|
+
# Show full error reports and disable caching.
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
20
22
|
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
22
24
|
config.action_dispatch.show_exceptions = false
|
23
25
|
|
24
|
-
# Disable request forgery protection in test environment
|
25
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
26
28
|
|
27
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
28
30
|
# The :test delivery method accumulates sent emails in the
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
#
|
33
|
-
config.
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
34
36
|
|
35
|
-
# Print deprecation notices to the stderr
|
37
|
+
# Print deprecation notices to the stderr.
|
36
38
|
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
37
42
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = '1.0'
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
6
7
|
# inflect.plural /^(ox)$/i, '\1en'
|
7
8
|
# inflect.singular /^(ox)en/i, '\1'
|
8
9
|
# inflect.irregular 'person', 'people'
|
9
10
|
# inflect.uncountable %w( fish sheep )
|
10
11
|
# end
|
11
|
-
|
12
|
+
|
12
13
|
# These inflection rules are supported but not enabled by default:
|
13
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
14
15
|
# inflect.acronym 'RESTful'
|
15
16
|
# end
|
@@ -1,8 +1,3 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rails generate session_migration")
|
8
|
-
# Dummy::Application.config.session_store :active_record_store
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
|
-
|
2
|
+
|
3
3
|
# This file contains settings for ActionController::ParamsWrapper which
|
4
4
|
# is enabled by default.
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json]
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
9
|
end
|
10
10
|
|
11
|
-
#
|
12
|
-
ActiveSupport.on_load(:active_record) do
|
13
|
-
self.include_root_in_json =
|
14
|
-
end
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: a62ca963571d309f1e2d63f4cc9d8e010c800b92be69003e67f5693695df7d17a221a3a34a48c6574becd9fa8d286d78aaa8b86a08bf56926f2d225cbeb13540
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 81d94b29e2ecf113e9cbfbf37074403a481f874bede01b5c7429b50f020a70aa6f39458d2a15f98c1014e6b453e8737066ef3932ad1732f18ad99b1264998a61
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -9,66 +9,66 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20121029183623) do
|
15
15
|
|
16
|
-
create_table "active_admin_comments", :
|
17
|
-
t.string "resource_id", :
|
18
|
-
t.string "resource_type", :
|
16
|
+
create_table "active_admin_comments", force: :cascade do |t|
|
17
|
+
t.string "resource_id", null: false
|
18
|
+
t.string "resource_type", null: false
|
19
19
|
t.integer "author_id"
|
20
20
|
t.string "author_type"
|
21
21
|
t.text "body"
|
22
|
-
t.datetime "created_at"
|
23
|
-
t.datetime "updated_at"
|
22
|
+
t.datetime "created_at"
|
23
|
+
t.datetime "updated_at"
|
24
24
|
t.string "namespace"
|
25
25
|
end
|
26
26
|
|
27
|
-
add_index "active_admin_comments", ["author_type", "author_id"], :
|
28
|
-
add_index "active_admin_comments", ["namespace"], :
|
29
|
-
add_index "active_admin_comments", ["resource_type", "resource_id"], :
|
27
|
+
add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id"
|
28
|
+
add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace"
|
29
|
+
add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id"
|
30
30
|
|
31
|
-
create_table "admin_users", :
|
32
|
-
t.string "email", :
|
33
|
-
t.string "encrypted_password", :
|
31
|
+
create_table "admin_users", force: :cascade do |t|
|
32
|
+
t.string "email", default: "", null: false
|
33
|
+
t.string "encrypted_password", default: "", null: false
|
34
34
|
t.string "reset_password_token"
|
35
35
|
t.datetime "reset_password_sent_at"
|
36
36
|
t.datetime "remember_created_at"
|
37
|
-
t.integer "sign_in_count", :
|
37
|
+
t.integer "sign_in_count", default: 0
|
38
38
|
t.datetime "current_sign_in_at"
|
39
39
|
t.datetime "last_sign_in_at"
|
40
40
|
t.string "current_sign_in_ip"
|
41
41
|
t.string "last_sign_in_ip"
|
42
|
-
t.datetime "created_at"
|
43
|
-
t.datetime "updated_at"
|
42
|
+
t.datetime "created_at"
|
43
|
+
t.datetime "updated_at"
|
44
44
|
end
|
45
45
|
|
46
|
-
add_index "admin_users", ["email"], :
|
47
|
-
add_index "admin_users", ["reset_password_token"], :
|
46
|
+
add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true
|
47
|
+
add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
48
48
|
|
49
|
-
create_table "orders", :
|
49
|
+
create_table "orders", force: :cascade do |t|
|
50
50
|
t.integer "quantity"
|
51
51
|
t.decimal "price"
|
52
52
|
t.string "customer"
|
53
53
|
t.date "placed"
|
54
54
|
t.date "shipped"
|
55
|
-
t.datetime "created_at"
|
56
|
-
t.datetime "updated_at"
|
55
|
+
t.datetime "created_at"
|
56
|
+
t.datetime "updated_at"
|
57
57
|
end
|
58
58
|
|
59
|
-
create_table "rules_rule_sets", :
|
59
|
+
create_table "rules_rule_sets", force: :cascade do |t|
|
60
60
|
t.integer "source_id"
|
61
61
|
t.string "source_type"
|
62
62
|
t.string "evaluation_logic"
|
63
|
-
t.datetime "created_at"
|
64
|
-
t.datetime "updated_at"
|
63
|
+
t.datetime "created_at"
|
64
|
+
t.datetime "updated_at"
|
65
65
|
end
|
66
66
|
|
67
|
-
create_table "rules_rules", :
|
67
|
+
create_table "rules_rules", force: :cascade do |t|
|
68
68
|
t.integer "rule_set_id"
|
69
69
|
t.text "expression"
|
70
|
-
t.datetime "created_at"
|
71
|
-
t.datetime "updated_at"
|
70
|
+
t.datetime "created_at"
|
71
|
+
t.datetime "updated_at"
|
72
72
|
end
|
73
73
|
|
74
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Zacharakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: protected_attributes
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rails
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +129,10 @@ files:
|
|
143
129
|
- spec/dummy/app/models/order.rb
|
144
130
|
- spec/dummy/app/views/layouts/application.html.erb
|
145
131
|
- spec/dummy/app/views/orders/show.html.haml
|
132
|
+
- spec/dummy/bin/bundle
|
133
|
+
- spec/dummy/bin/rails
|
134
|
+
- spec/dummy/bin/rake
|
135
|
+
- spec/dummy/bin/setup
|
146
136
|
- spec/dummy/config.ru
|
147
137
|
- spec/dummy/config/application.rb
|
148
138
|
- spec/dummy/config/boot.rb
|
@@ -152,8 +142,11 @@ files:
|
|
152
142
|
- spec/dummy/config/environments/production.rb
|
153
143
|
- spec/dummy/config/environments/test.rb
|
154
144
|
- spec/dummy/config/initializers/active_admin.rb
|
145
|
+
- spec/dummy/config/initializers/assets.rb
|
155
146
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
147
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
156
148
|
- spec/dummy/config/initializers/devise.rb
|
149
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
157
150
|
- spec/dummy/config/initializers/inflections.rb
|
158
151
|
- spec/dummy/config/initializers/mime_types.rb
|
159
152
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -162,6 +155,7 @@ files:
|
|
162
155
|
- spec/dummy/config/locales/devise.en.yml
|
163
156
|
- spec/dummy/config/locales/en.yml
|
164
157
|
- spec/dummy/config/routes.rb
|
158
|
+
- spec/dummy/config/secrets.yml
|
165
159
|
- spec/dummy/db/migrate/20120821181654_create_orders.rb
|
166
160
|
- spec/dummy/db/migrate/20120901044842_devise_create_admin_users.rb
|
167
161
|
- spec/dummy/db/migrate/20120901044906_create_admin_notes.rb
|
@@ -202,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
196
|
version: '0'
|
203
197
|
requirements: []
|
204
198
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.
|
199
|
+
rubygems_version: 2.4.5.1
|
206
200
|
signing_key:
|
207
201
|
specification_version: 4
|
208
202
|
summary: Rules engine that allows you to add customizable business rules to any ActiveRecord
|
@@ -222,6 +216,10 @@ test_files:
|
|
222
216
|
- spec/dummy/app/models/order.rb
|
223
217
|
- spec/dummy/app/views/layouts/application.html.erb
|
224
218
|
- spec/dummy/app/views/orders/show.html.haml
|
219
|
+
- spec/dummy/bin/bundle
|
220
|
+
- spec/dummy/bin/rails
|
221
|
+
- spec/dummy/bin/rake
|
222
|
+
- spec/dummy/bin/setup
|
225
223
|
- spec/dummy/config/application.rb
|
226
224
|
- spec/dummy/config/boot.rb
|
227
225
|
- spec/dummy/config/database.yml
|
@@ -230,8 +228,11 @@ test_files:
|
|
230
228
|
- spec/dummy/config/environments/production.rb
|
231
229
|
- spec/dummy/config/environments/test.rb
|
232
230
|
- spec/dummy/config/initializers/active_admin.rb
|
231
|
+
- spec/dummy/config/initializers/assets.rb
|
233
232
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
233
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
234
234
|
- spec/dummy/config/initializers/devise.rb
|
235
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
235
236
|
- spec/dummy/config/initializers/inflections.rb
|
236
237
|
- spec/dummy/config/initializers/mime_types.rb
|
237
238
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -240,6 +241,7 @@ test_files:
|
|
240
241
|
- spec/dummy/config/locales/devise.en.yml
|
241
242
|
- spec/dummy/config/locales/en.yml
|
242
243
|
- spec/dummy/config/routes.rb
|
244
|
+
- spec/dummy/config/secrets.yml
|
243
245
|
- spec/dummy/config.ru
|
244
246
|
- spec/dummy/db/migrate/20120821181654_create_orders.rb
|
245
247
|
- spec/dummy/db/migrate/20120901044842_devise_create_admin_users.rb
|
@@ -264,4 +266,3 @@ test_files:
|
|
264
266
|
- spec/rules/rule_set_spec.rb
|
265
267
|
- spec/rules/rule_spec.rb
|
266
268
|
- spec/spec_helper.rb
|
267
|
-
has_rdoc:
|