pacecar 1.5.3 → 2.0.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.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.travis.yml +9 -1
  4. data/Appraisals +9 -17
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +93 -108
  7. data/MIT-LICENSE +1 -1
  8. data/README.md +10 -109
  9. data/Rakefile +9 -5
  10. data/TESTING.md +40 -0
  11. data/gemfiles/rails_4_mysql2_driver.gemfile +8 -0
  12. data/gemfiles/rails_4_pg_driver.gemfile +8 -0
  13. data/gemfiles/rails_4_sqlite3_driver.gemfile +8 -0
  14. data/lib/pacecar.rb +0 -10
  15. data/lib/pacecar/boolean.rb +8 -20
  16. data/lib/pacecar/helpers.rb +7 -16
  17. data/lib/pacecar/limit.rb +9 -9
  18. data/lib/pacecar/order.rb +9 -9
  19. data/lib/pacecar/polymorph.rb +5 -5
  20. data/lib/pacecar/presence.rb +8 -9
  21. data/lib/pacecar/search.rb +8 -32
  22. data/lib/pacecar/state.rb +13 -9
  23. data/lib/pacecar/version.rb +1 -1
  24. data/pacecar.gemspec +18 -16
  25. data/spec/boolean_spec.rb +6 -18
  26. data/spec/dummy/app/models/mammal.rb +1 -1
  27. data/spec/dummy/app/models/post.rb +2 -2
  28. data/spec/dummy/app/models/user.rb +1 -6
  29. data/spec/dummy/bin/bundle +3 -0
  30. data/spec/dummy/bin/rails +4 -0
  31. data/spec/dummy/bin/rake +4 -0
  32. data/spec/dummy/config/application.rb +4 -26
  33. data/spec/dummy/config/boot.rb +3 -9
  34. data/spec/dummy/config/database.yml +1 -7
  35. data/spec/dummy/config/environment.rb +2 -2
  36. data/spec/dummy/config/environments/development.rb +15 -12
  37. data/spec/dummy/config/environments/production.rb +57 -26
  38. data/spec/dummy/config/environments/test.rb +16 -15
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/spec/dummy/config/initializers/inflections.rb +9 -3
  41. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  42. data/spec/dummy/config/initializers/session_store.rb +1 -6
  43. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/spec/dummy/config/locales/en.yml +20 -2
  45. data/spec/dummy/config/routes.rb +22 -24
  46. data/spec/factories.rb +2 -2
  47. data/spec/helpers_spec.rb +18 -26
  48. data/spec/integration/navigation_spec.rb +4 -5
  49. data/spec/limit_spec.rb +11 -11
  50. data/spec/order_spec.rb +8 -8
  51. data/spec/pacecar_spec.rb +3 -3
  52. data/spec/polymorph_spec.rb +6 -6
  53. data/spec/presence_spec.rb +9 -9
  54. data/spec/search_spec.rb +14 -48
  55. data/spec/spec_helper.rb +11 -17
  56. data/spec/state_spec.rb +29 -29
  57. metadata +76 -70
  58. data/gemfiles/rails-3.0.11-database-mysql.gemfile +0 -8
  59. data/gemfiles/rails-3.0.11-database-mysql.gemfile.lock +0 -134
  60. data/gemfiles/rails-3.0.11-database-mysql2.gemfile +0 -8
  61. data/gemfiles/rails-3.0.11-database-mysql2.gemfile.lock +0 -134
  62. data/gemfiles/rails-3.0.11-database-pg.gemfile +0 -8
  63. data/gemfiles/rails-3.0.11-database-pg.gemfile.lock +0 -134
  64. data/gemfiles/rails-3.0.11-database-sqlite3-ruby.gemfile +0 -8
  65. data/gemfiles/rails-3.0.11-database-sqlite3-ruby.gemfile.lock +0 -136
  66. data/gemfiles/rails-3.0.11-database-sqlite3.gemfile +0 -8
  67. data/gemfiles/rails-3.0.11-database-sqlite3.gemfile.lock +0 -134
  68. data/gemfiles/rails-3.1.3-database-mysql.gemfile +0 -8
  69. data/gemfiles/rails-3.1.3-database-mysql.gemfile.lock +0 -144
  70. data/gemfiles/rails-3.1.3-database-mysql2.gemfile +0 -8
  71. data/gemfiles/rails-3.1.3-database-mysql2.gemfile.lock +0 -144
  72. data/gemfiles/rails-3.1.3-database-pg.gemfile +0 -8
  73. data/gemfiles/rails-3.1.3-database-pg.gemfile.lock +0 -144
  74. data/gemfiles/rails-3.1.3-database-sqlite3-ruby.gemfile +0 -8
  75. data/gemfiles/rails-3.1.3-database-sqlite3-ruby.gemfile.lock +0 -146
  76. data/gemfiles/rails-3.1.3-database-sqlite3.gemfile +0 -8
  77. data/gemfiles/rails-3.1.3-database-sqlite3.gemfile.lock +0 -144
  78. data/lib/pacecar/associations.rb +0 -39
  79. data/lib/pacecar/datetime.rb +0 -91
  80. data/lib/pacecar/duration.rb +0 -51
  81. data/lib/pacecar/numeric.rb +0 -29
  82. data/lib/pacecar/ranking.rb +0 -53
  83. data/spec/associations_spec.rb +0 -32
  84. data/spec/datetime_spec.rb +0 -92
  85. data/spec/duration_spec.rb +0 -22
  86. data/spec/numeric_spec.rb +0 -43
  87. data/spec/ranking_spec.rb +0 -63
@@ -3,28 +3,16 @@ require 'spec_helper'
3
3
  describe 'Boolean' do
4
4
 
5
5
  before do
6
- @one = Factory :user, :admin => true
7
- @two = Factory :user, :admin => true
8
- @three = Factory :user, :admin => true
9
- @four = Factory :user, :admin => false
10
- @five = Factory :user, :admin => false
6
+ @one = create :user, admin: true
7
+ @two = create :user, admin: false
11
8
  end
12
9
 
13
- it "should set the correct expected values for a boolean column method" do
14
- User.admin.should == [@one, @two, @three]
10
+ it 'Returns the matching result for a boolean columm method' do
11
+ expect(User.admin).to eq [@one]
15
12
  end
16
13
 
17
- it "should set the correct expected values for a not_ boolean column method" do
18
- User.not_admin.should == [@four, @five]
19
- end
20
-
21
- it "should return correct value for balance class method when true greater than false" do
22
- User.admin_balance.should == 1
23
- end
24
-
25
- it "should return correct value for balance class method when true less than false" do
26
- 3.times { Factory :user, :admin => false }
27
- User.admin_balance.should == -2
14
+ it 'Returns the matching result for a not_ boolean columm method' do
15
+ expect(User.not_admin).to eq [@two]
28
16
  end
29
17
 
30
18
  end
@@ -2,6 +2,6 @@ class Mammal < ActiveRecord::Base
2
2
 
3
3
  include Pacecar
4
4
 
5
- has_many :posts, :as => :owner
5
+ has_many :posts, as: :owner
6
6
 
7
7
  end
@@ -5,10 +5,10 @@ class Post < ActiveRecord::Base
5
5
  PUBLICATION_STATES = %w(Draft Submitted Rejected Accepted).freeze
6
6
  TYPES = %w(Free Open Private Anonymous PostModern).freeze
7
7
 
8
- belongs_to :owner, :polymorphic => true
8
+ belongs_to :owner, polymorphic: true
9
9
 
10
10
  has_state :publication_state
11
- has_state :post_type, :with => TYPES
11
+ has_state :post_type, with: TYPES
12
12
  has_polymorph :owner
13
13
 
14
14
  end
@@ -2,13 +2,8 @@ class User < ActiveRecord::Base
2
2
 
3
3
  include Pacecar
4
4
 
5
- has_many :posts, :as => :owner
5
+ has_many :posts, as: :owner
6
6
  has_many :comments
7
7
  has_many :articles
8
8
 
9
- has_ranking :comments
10
- has_recent_records :comments
11
- has_recent_records :posts, :comments
12
- has_calculated_records :comments, :on => :rating
13
-
14
9
  end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -1,13 +1,10 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require "active_model/railtie"
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_view/railtie"
7
- require "action_mailer/railtie"
3
+ require 'rails/all'
8
4
 
9
- Bundler.require
10
- require "pacecar"
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env)
11
8
 
12
9
  module Dummy
13
10
  class Application < Rails::Application
@@ -15,16 +12,6 @@ module Dummy
15
12
  # Application configuration should go into files in config/initializers
16
13
  # -- all .rb files in that directory are automatically loaded.
17
14
 
18
- # Custom directories with classes and modules you want to be autoloadable.
19
- # config.autoload_paths += %W(#{config.root}/extras)
20
-
21
- # Only load the plugins named here, in the order given (default is alphabetical).
22
- # :all can be used as a placeholder for all plugins not explicitly named.
23
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
-
25
- # Activate observers that should always be running.
26
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
-
28
15
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
16
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
17
  # config.time_zone = 'Central Time (US & Canada)'
@@ -32,14 +19,5 @@ module Dummy
32
19
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
20
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
21
  # config.i18n.default_locale = :de
35
-
36
- # JavaScript files you want as :defaults (application.js is always included).
37
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
38
-
39
- # Configure the default encoding used in templates for Ruby 1.9.
40
- config.encoding = "utf-8"
41
-
42
- # Configure sensitive parameters which will be filtered from the log file.
43
- config.filter_parameters += [:password]
44
22
  end
45
23
  end
@@ -1,10 +1,4 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
3
 
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -6,12 +6,6 @@ development:
6
6
  pool: 5
7
7
  timeout: 5000
8
8
 
9
- sqlite3-ruby: &sqlite3-ruby
10
- adapter: sqlite3
11
- database: db/test.sqlite3
12
- pool: 5
13
- timeout: 5000
14
-
15
9
  sqlite3: &sqlite3
16
10
  adapter: sqlite3
17
11
  database: db/test.sqlite3
@@ -42,7 +36,7 @@ pg: &pg
42
36
 
43
37
  # This is because of appraisal - find the gem which was loaded, and use that driver
44
38
  test:
45
- <<: *<%= Gem.loaded_specs.keys.select { |key| ['sqlite3-ruby', 'sqlite3', 'mysql', 'mysql2', 'pg'].include? key }.first %>
39
+ <<: *<%= Gem.loaded_specs.keys.select { |key| ['sqlite3', 'mysql', 'mysql2', 'pg'].include? key }.first or raise('Database gem was not loaded') %>
46
40
 
47
41
  production:
48
42
  adapter: sqlite3
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
4
+ # Initialize the Rails application.
5
5
  Dummy::Application.initialize!
@@ -1,26 +1,29 @@
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
  # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the webserver when you make code changes.
5
+ # every request. This slows down response time but is perfect for development
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
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
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
- config.action_view.debug_rjs = true
15
14
  config.action_controller.perform_caching = false
16
15
 
17
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
18
17
  config.action_mailer.raise_delivery_errors = false
19
18
 
20
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
21
20
  config.active_support.deprecation = :log
22
21
 
23
- # Only use best-standards-support built into browsers
24
- config.action_dispatch.best_standards_support = :builtin
25
- end
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
26
24
 
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
29
+ end
@@ -1,49 +1,80 @@
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
- # The production environment is meant for finished, "live" apps.
5
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
6
5
  config.cache_classes = true
7
6
 
8
- # Full error reports are disabled and caching is turned on
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread 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.
9
14
  config.consider_all_requests_local = false
10
15
  config.action_controller.perform_caching = true
11
16
 
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
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 nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
14
21
 
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
17
24
 
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
20
28
 
21
- # See everything in the log (default is :info)
22
- # config.log_level = :debug
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
23
31
 
24
- # Use a different logger for distributed setups
25
- # config.logger = SyslogLogger.new
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
26
34
 
27
- # Use a different cache store in production
28
- # config.cache_store = :mem_cache_store
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
29
37
 
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
38
+ # Specifies the header that your server uses for sending files.
39
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
+
42
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
+ # config.force_ssl = true
44
+
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
47
+
48
+ # Prepend all log lines with the following tags.
49
+ # config.log_tags = [ :subdomain, :uuid ]
33
50
 
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
51
+ # Use a different logger for distributed setups.
52
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53
+
54
+ # Use a different cache store in production.
55
+ # config.cache_store = :mem_cache_store
56
+
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
35
58
  # config.action_controller.asset_host = "http://assets.example.com"
36
59
 
37
- # Disable delivery errors, bad email addresses will be ignored
38
- # config.action_mailer.raise_delivery_errors = false
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
+ # config.assets.precompile += %w( search.js )
39
63
 
40
- # Enable threaded mode
41
- # config.threadsafe!
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
+ # config.action_mailer.raise_delivery_errors = false
42
67
 
43
68
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
- # the I18n.default_locale when a translation can not be found)
69
+ # the I18n.default_locale when a translation can not be found).
45
70
  config.i18n.fallbacks = true
46
71
 
47
- # Send deprecation notices to registered listeners
72
+ # Send deprecation notices to registered listeners.
48
73
  config.active_support.deprecation = :notify
74
+
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
49
80
  end
@@ -1,35 +1,36 @@
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
- # test suite. You never need to work with it otherwise. Remember that
5
+ # test suite. You never need to work with it otherwise. Remember that
6
6
  # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
7
+ # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
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
12
14
 
13
- # Show full error reports and disable caching
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
18
+
19
+ # Show full error reports and disable caching.
14
20
  config.consider_all_requests_local = true
15
21
  config.action_controller.perform_caching = false
16
22
 
17
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
18
24
  config.action_dispatch.show_exceptions = false
19
25
 
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
22
28
 
23
29
  # Tell Action Mailer not to deliver emails to the real world.
24
30
  # The :test delivery method accumulates sent emails in the
25
31
  # ActionMailer::Base.deliveries array.
26
32
  config.action_mailer.delivery_method = :test
27
33
 
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
34
+ # Print deprecation notices to the stderr.
34
35
  config.active_support.deprecation = :stderr
35
36
  end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,10 +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
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
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
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -1,7 +1,12 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Your secret key for verifying the integrity of signed cookies.
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
4
  # If you change this key, all old signed cookies will become invalid!
5
+
5
6
  # Make sure the secret is at least 30 characters and all random,
6
7
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = 'c3cd37229cbffa5cac592d2d511a60bc1cbd27ac529f49894372c39a6e08c2f99ff7a5eecbeb13533c6aa08f37639a94453f2c1c761bdbdd91c2c4c4ffa2faf8'
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = 'ebf87436412eed5ee92025d81559ce94f704a92248c79acf2a3b6f8079f03decf5b7239d62dcd0fa281594de864ee47b85f3f8b333f5de5086ceda6738072f50'
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
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
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
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