active_scaffold 3.3.2 → 3.3.3
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 +7 -0
- data/CHANGELOG +9 -0
- data/app/assets/javascripts/active_scaffold.js.erb +5 -2
- data/app/assets/javascripts/jquery/active_scaffold.js +4 -6
- data/app/assets/javascripts/jquery/date_picker_bridge.js.erb +16 -14
- data/app/assets/javascripts/prototype/active_scaffold.js +0 -5
- data/app/assets/stylesheets/active_scaffold.css.scss +1 -1
- data/app/assets/stylesheets/active_scaffold_jquery_ui.css.erb +7 -0
- data/lib/active_scaffold.rb +1 -1
- data/lib/active_scaffold/actions/update.rb +2 -1
- data/lib/active_scaffold/attribute_params.rb +2 -2
- data/lib/active_scaffold/bridges/date_picker.rb +1 -1
- data/lib/active_scaffold/config/core.rb +0 -2
- data/lib/active_scaffold/config/nested.rb +6 -3
- data/lib/active_scaffold/constraints.rb +2 -2
- data/lib/active_scaffold/data_structures/action_columns.rb +68 -72
- data/lib/active_scaffold/data_structures/column.rb +7 -3
- data/lib/active_scaffold/data_structures/sorting.rb +2 -1
- data/lib/active_scaffold/finder.rb +2 -14
- data/lib/active_scaffold/helpers/form_column_helpers.rb +1 -0
- data/lib/active_scaffold/helpers/list_column_helpers.rb +1 -1
- data/lib/active_scaffold/helpers/pagination_helpers.rb +1 -1
- data/lib/active_scaffold/helpers/search_column_helpers.rb +2 -2
- data/lib/active_scaffold/helpers/view_helpers.rb +7 -5
- data/lib/active_scaffold/tableless.rb +2 -2
- data/lib/active_scaffold/version.rb +1 -1
- data/test/bridges/bridge_test.rb +22 -33
- data/test/bridges/date_picker_test.rb +29 -0
- data/test/bridges/paperclip_test.rb +10 -11
- data/test/bridges/tiny_mce_test.rb +7 -7
- data/test/{bridges/company.rb → company.rb} +14 -13
- data/test/config/base_test.rb +14 -12
- data/test/config/core_test.rb +59 -53
- data/test/config/create_test.rb +56 -54
- data/test/config/delete_test.rb +31 -29
- data/test/config/field_search_test.rb +45 -43
- data/test/config/list_test.rb +119 -117
- data/test/config/nested_test.rb +50 -58
- data/test/config/search_test.rb +58 -56
- data/test/config/show_test.rb +42 -40
- data/test/config/subform_test.rb +15 -13
- data/test/config/update_test.rb +40 -38
- data/test/const_mocker.rb +14 -18
- data/test/data_structures/action_columns_test.rb +3 -3
- data/test/data_structures/action_link_test.rb +1 -1
- data/test/data_structures/action_links_test.rb +3 -3
- data/test/data_structures/actions_test.rb +2 -2
- data/test/data_structures/association_column_test.rb +5 -6
- data/test/data_structures/column_test.rb +8 -4
- data/test/data_structures/columns_test.rb +2 -3
- data/test/data_structures/error_message_test.rb +2 -2
- data/test/data_structures/set_test.rb +2 -3
- data/test/data_structures/sorting_test.rb +1 -2
- data/test/data_structures/standard_column_test.rb +2 -3
- data/test/data_structures/validation_reflection_test.rb +51 -0
- data/test/data_structures/virtual_column_test.rb +1 -1
- data/test/extensions/active_record_test.rb +2 -3
- data/test/extensions/array_test.rb +2 -2
- data/test/helpers/form_column_helpers_test.rb +6 -6
- data/test/helpers/list_column_helpers_test.rb +4 -1
- data/test/helpers/pagination_helpers_test.rb +7 -3
- data/test/misc/active_record_permissions_test.rb +1 -1
- data/test/misc/attribute_params_test.rb +3 -4
- data/test/misc/configurable_test.rb +2 -2
- data/test/misc/constraints_test.rb +29 -29
- data/test/misc/finder_test.rb +13 -10
- data/test/misc/lang_test.rb +1 -1
- data/test/mock_app/Rakefile +7 -0
- data/test/mock_app/config.ru +4 -0
- data/test/mock_app/config/application.rb +11 -0
- data/test/mock_app/config/boot.rb +6 -109
- data/test/mock_app/config/database.yml +2 -2
- data/test/mock_app/config/environment.rb +4 -42
- data/test/mock_app/config/environments/development.rb +21 -13
- data/test/mock_app/config/environments/production.rb +41 -20
- data/test/mock_app/config/environments/test.rb +27 -22
- data/test/mock_app/config/initializers/backtrace_silencers.rb +2 -2
- data/test/mock_app/config/initializers/inflections.rb +1 -1
- data/test/mock_app/config/initializers/secret_token.rb +7 -0
- data/test/mock_app/config/initializers/session_store.rb +2 -9
- data/test/mock_app/config/initializers/wrap_parameters.rb +14 -0
- data/test/mock_app/config/routes.rb +2 -42
- data/test/model_stub.rb +2 -3
- data/test/test_helper.rb +13 -11
- data/vendor/assets/stylesheets/jquery-ui-theme.css.erb +47 -0
- data/vendor/assets/stylesheets/jquery-ui.css +2 -36
- metadata +92 -103
- data/test/bridges/active_scaffold_dependent_protect_test.rb +0 -34
- data/test/bridges/unobtrusive_date_picker_test.rb +0 -49
- data/test/bridges/validation_reflection_test.rb +0 -57
- data/test/mock_app/config/initializers/new_rails_defaults.rb +0 -19
data/test/misc/finder_test.rb
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
# require 'test/model_stub'
|
|
1
|
+
require 'test_helper'
|
|
3
2
|
|
|
4
3
|
class ClassWithFinder
|
|
5
4
|
include ActiveScaffold::Finder
|
|
@@ -33,16 +32,16 @@ class FinderTest < Test::Unit::TestCase
|
|
|
33
32
|
]
|
|
34
33
|
|
|
35
34
|
expected_conditions = [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
['"model_stubs"."a" LIKE ? OR "model_stubs"."b" LIKE ?', '%foo%', '%foo%'],
|
|
36
|
+
['"model_stubs"."a" LIKE ? OR "model_stubs"."b" LIKE ?', '%bar%', '%bar%']
|
|
37
|
+
]
|
|
39
38
|
assert_equal expected_conditions, ClassWithFinder.create_conditions_for_columns(tokens, columns)
|
|
40
39
|
|
|
41
40
|
expected_conditions = [
|
|
42
|
-
'
|
|
41
|
+
'"model_stubs"."a" LIKE ? OR "model_stubs"."b" LIKE ?',
|
|
43
42
|
'%foo%', '%foo%'
|
|
44
43
|
]
|
|
45
|
-
assert_equal expected_conditions, ClassWithFinder.create_conditions_for_columns('foo', columns)
|
|
44
|
+
assert_equal [expected_conditions], ClassWithFinder.create_conditions_for_columns('foo', columns)
|
|
46
45
|
|
|
47
46
|
assert_equal nil, ClassWithFinder.create_conditions_for_columns('foo', [])
|
|
48
47
|
end
|
|
@@ -69,8 +68,9 @@ class FinderTest < Test::Unit::TestCase
|
|
|
69
68
|
|
|
70
69
|
def test_count_with_group
|
|
71
70
|
@klass.expects(:custom_finder_options).returns({:group => :a})
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
ActiveRecord::Relation.any_instance.expects(:count).returns(ActiveSupport::OrderedHash['foo', 5])
|
|
72
|
+
ActiveRecord::Relation.any_instance.expects(:limit).with(20).returns(ModelStub.where(nil))
|
|
73
|
+
ActiveRecord::Relation.any_instance.expects(:offset).with(0).returns(ModelStub.where(nil))
|
|
74
74
|
page = @klass.send :find_page, :per_page => 20, :pagination => true
|
|
75
75
|
page.items
|
|
76
76
|
|
|
@@ -80,7 +80,10 @@ class FinderTest < Test::Unit::TestCase
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def test_disabled_pagination
|
|
83
|
-
|
|
83
|
+
ActiveRecord::Relation.any_instance.expects(:count).never
|
|
84
|
+
ActiveRecord::Relation.any_instance.expects(:limit).never
|
|
85
|
+
ActiveRecord::Relation.any_instance.expects(:offset).never
|
|
86
|
+
ModelStub.expects(:count).never
|
|
84
87
|
page = @klass.send :find_page, :per_page => 20, :pagination => false
|
|
85
88
|
page.items
|
|
86
89
|
end
|
data/test/misc/lang_test.rb
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
3
|
+
|
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
|
5
|
+
require 'rake'
|
|
6
|
+
|
|
7
|
+
RailsApp::Application.load_tasks
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require "rails/all"
|
|
4
|
+
require "rails/test_unit/railtie"
|
|
5
|
+
|
|
6
|
+
module RailsApp
|
|
7
|
+
class Application < Rails::Application
|
|
8
|
+
config.filter_parameters << :password
|
|
9
|
+
config.action_mailer.default_url_options = { :host => "localhost:3000" }
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,110 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class << self
|
|
8
|
-
def boot!
|
|
9
|
-
unless booted?
|
|
10
|
-
preinitialize
|
|
11
|
-
pick_boot.run
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def booted?
|
|
16
|
-
defined? Rails::Initializer
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def pick_boot
|
|
20
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def vendor_rails?
|
|
24
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def preinitialize
|
|
28
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def preinitializer_path
|
|
32
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
class Boot
|
|
37
|
-
def run
|
|
38
|
-
load_initializer
|
|
39
|
-
Rails::Initializer.run(:set_load_path)
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
class VendorBoot < Boot
|
|
44
|
-
def load_initializer
|
|
45
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
|
46
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
|
47
|
-
Rails::GemDependency.add_frozen_gem_path
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
class GemBoot < Boot
|
|
52
|
-
def load_initializer
|
|
53
|
-
self.class.load_rubygems
|
|
54
|
-
load_rails_gem
|
|
55
|
-
require 'initializer'
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def load_rails_gem
|
|
59
|
-
if version = self.class.gem_version
|
|
60
|
-
gem 'rails', version
|
|
61
|
-
else
|
|
62
|
-
gem 'rails'
|
|
63
|
-
end
|
|
64
|
-
rescue Gem::LoadError => load_error
|
|
65
|
-
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
|
66
|
-
exit 1
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
class << self
|
|
70
|
-
def rubygems_version
|
|
71
|
-
Gem::RubyGemsVersion rescue nil
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def gem_version
|
|
75
|
-
if defined? RAILS_GEM_VERSION
|
|
76
|
-
RAILS_GEM_VERSION
|
|
77
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
|
78
|
-
ENV['RAILS_GEM_VERSION']
|
|
79
|
-
else
|
|
80
|
-
parse_gem_version(read_environment_rb)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def load_rubygems
|
|
85
|
-
require 'rubygems'
|
|
86
|
-
min_version = '1.3.1'
|
|
87
|
-
unless rubygems_version >= min_version
|
|
88
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
|
89
|
-
exit 1
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
rescue LoadError
|
|
93
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
|
94
|
-
exit 1
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def parse_gem_version(text)
|
|
98
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
private
|
|
102
|
-
def read_environment_rb
|
|
103
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
end
|
|
1
|
+
begin
|
|
2
|
+
require File.expand_path("../../../../.bundle/environment", __FILE__)
|
|
3
|
+
rescue LoadError
|
|
4
|
+
require 'rubygems'
|
|
5
|
+
require 'bundler'
|
|
6
|
+
Bundler.setup :default, :test, :rails
|
|
107
7
|
end
|
|
108
|
-
|
|
109
|
-
# All that for this:
|
|
110
|
-
Rails.boot!
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
|
3
3
|
development:
|
|
4
4
|
adapter: sqlite3
|
|
5
|
-
database:
|
|
5
|
+
database: ":memory:"
|
|
6
6
|
pool: 5
|
|
7
7
|
timeout: 5000
|
|
8
8
|
|
|
@@ -11,6 +11,6 @@ development:
|
|
|
11
11
|
# Do not set this db to the same as development or production.
|
|
12
12
|
test:
|
|
13
13
|
adapter: sqlite3
|
|
14
|
-
database:
|
|
14
|
+
database: ":memory:"
|
|
15
15
|
pool: 5
|
|
16
16
|
timeout: 5000
|
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Load the rails application
|
|
2
|
+
require File.expand_path('../application', __FILE__)
|
|
2
3
|
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
7
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
|
8
|
-
|
|
9
|
-
Rails::Initializer.run do |config|
|
|
10
|
-
# Settings in config/environments/* take precedence over those specified here.
|
|
11
|
-
# Application configuration should go into files in config/initializers
|
|
12
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
13
|
-
|
|
14
|
-
# Add additional load paths for your own custom dirs
|
|
15
|
-
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
|
16
|
-
|
|
17
|
-
# Specify gems that this application depends on and have them installed with rake gems:install
|
|
18
|
-
# config.gem "bj"
|
|
19
|
-
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
|
20
|
-
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
|
21
|
-
# config.gem "aws-s3", :lib => "aws/s3"
|
|
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
|
-
config.plugin_paths += %W(#{RAILS_ROOT}/../../..)
|
|
27
|
-
config.plugins = [:active_scaffold]
|
|
28
|
-
|
|
29
|
-
# Skip frameworks you're not going to use. To use Rails without a database,
|
|
30
|
-
# you must remove the Active Record framework.
|
|
31
|
-
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
|
32
|
-
|
|
33
|
-
# Activate observers that should always be running
|
|
34
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
35
|
-
|
|
36
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
37
|
-
# Run "rake -D time" for a list of tasks for finding time zone names.
|
|
38
|
-
config.time_zone = 'UTC'
|
|
39
|
-
|
|
40
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
41
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
|
42
|
-
# config.i18n.default_locale = :de
|
|
43
|
-
end
|
|
4
|
+
# Initialize the rails application
|
|
5
|
+
RailsApp::Application.initialize!
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
RailsApp::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
3
|
|
|
3
|
-
# In the development environment your application's code is reloaded on
|
|
4
|
-
# every request. This slows down response time but is perfect for development
|
|
5
|
-
# since you don't have to restart the webserver when you make code changes.
|
|
6
|
-
config.cache_classes = false
|
|
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.
|
|
7
|
+
config.cache_classes = false
|
|
7
8
|
|
|
8
|
-
# Log error messages when you accidentally call methods on nil.
|
|
9
|
-
config.whiny_nils = true
|
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
|
10
|
+
config.whiny_nils = true
|
|
10
11
|
|
|
11
|
-
# Show full error reports and disable caching
|
|
12
|
-
config.
|
|
13
|
-
config.
|
|
14
|
-
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = false
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
|
18
|
+
|
|
19
|
+
# Print deprecation notices to the Rails logger
|
|
20
|
+
config.active_support.deprecation = :log
|
|
21
|
+
|
|
22
|
+
# Only use best-standards-support built into browsers
|
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
+
end
|
|
15
25
|
|
|
16
|
-
# Don't care if the mailer can't send
|
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
|
@@ -1,28 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
RailsApp::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
3
|
|
|
3
|
-
# The production environment is meant for finished, "live" apps.
|
|
4
|
-
# Code is not reloaded between requests
|
|
5
|
-
config.cache_classes = true
|
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
|
5
|
+
# Code is not reloaded between requests
|
|
6
|
+
config.cache_classes = true
|
|
6
7
|
|
|
7
|
-
# Full error reports are disabled and caching is turned on
|
|
8
|
-
config.
|
|
9
|
-
config.action_controller.perform_caching
|
|
10
|
-
config.action_view.cache_template_loading = true
|
|
8
|
+
# Full error reports are disabled and caching is turned on
|
|
9
|
+
config.consider_all_requests_local = false
|
|
10
|
+
config.action_controller.perform_caching = true
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
|
|
12
|
+
# Specifies the header that your server uses for sending files
|
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
# config.
|
|
15
|
+
# For nginx:
|
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
|
17
17
|
|
|
18
|
-
#
|
|
19
|
-
#
|
|
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
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
# config.
|
|
21
|
+
# See everything in the log (default is :info)
|
|
22
|
+
# config.log_level = :debug
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
# config.
|
|
24
|
+
# Use a different logger for distributed setups
|
|
25
|
+
# config.logger = SyslogLogger.new
|
|
26
26
|
|
|
27
|
-
#
|
|
28
|
-
# config.
|
|
27
|
+
# Use a different cache store in production
|
|
28
|
+
# config.cache_store = :mem_cache_store
|
|
29
|
+
|
|
30
|
+
# Disable Rails's static asset server
|
|
31
|
+
# In production, Apache or nginx will already do this
|
|
32
|
+
config.serve_static_assets = false
|
|
33
|
+
|
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
36
|
+
|
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
39
|
+
|
|
40
|
+
# Enable threaded mode
|
|
41
|
+
# config.threadsafe!
|
|
42
|
+
|
|
43
|
+
# 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)
|
|
45
|
+
config.i18n.fallbacks = true
|
|
46
|
+
|
|
47
|
+
# Send deprecation notices to registered listeners
|
|
48
|
+
config.active_support.deprecation = :notify
|
|
49
|
+
end
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
RailsApp::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
3
|
|
|
3
|
-
# The test environment is used exclusively to run your application's
|
|
4
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
5
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
6
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
7
|
-
config.cache_classes = true
|
|
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
|
|
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!
|
|
8
|
+
config.cache_classes = true
|
|
9
|
+
config.eager_load = false
|
|
8
10
|
|
|
9
|
-
#
|
|
10
|
-
config.
|
|
11
|
+
# Show full error reports and disable caching
|
|
12
|
+
config.consider_all_requests_local = true
|
|
13
|
+
config.action_controller.perform_caching = false
|
|
11
14
|
|
|
12
|
-
#
|
|
13
|
-
config.
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
15
|
-
config.action_view.cache_template_loading = true
|
|
15
|
+
# Raise exceptions instead of rendering exception templates
|
|
16
|
+
config.action_dispatch.show_exceptions = false
|
|
16
17
|
|
|
17
|
-
# Disable request forgery protection in test environment
|
|
18
|
-
config.action_controller.allow_forgery_protection = false
|
|
18
|
+
# Disable request forgery protection in test environment
|
|
19
|
+
config.action_controller.allow_forgery_protection = false
|
|
19
20
|
|
|
20
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
21
|
-
# The :test delivery method accumulates sent emails in the
|
|
22
|
-
# ActionMailer::Base.deliveries array.
|
|
23
|
-
config.action_mailer.delivery_method = :test
|
|
21
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
|
22
|
+
# The :test delivery method accumulates sent emails in the
|
|
23
|
+
# ActionMailer::Base.deliveries array.
|
|
24
|
+
config.action_mailer.delivery_method = :test
|
|
24
25
|
|
|
25
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
26
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
27
|
-
# like if you have constraints or database-specific column types
|
|
28
|
-
# config.active_record.schema_format = :sql
|
|
26
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
27
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
28
|
+
# like if you have constraints or database-specific column types
|
|
29
|
+
# config.active_record.schema_format = :sql
|
|
30
|
+
|
|
31
|
+
# Print deprecation notices to the stderr
|
|
32
|
+
config.active_support.deprecation = :stderr
|
|
33
|
+
end
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
|
4
4
|
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
5
5
|
|
|
6
|
-
# You can also remove all the silencers if you're trying
|
|
7
|
-
|
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|