acts_as_ferret 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +6 -0
- data/doc/demo/Gemfile +18 -0
- data/doc/demo/Rakefile +3 -6
- data/doc/demo/app/controllers/application_controller.rb +3 -0
- data/doc/demo/app/helpers/application_helper.rb +0 -1
- data/doc/demo/app/views/admin/backend/search.rhtml +1 -1
- data/doc/demo/app/views/contents/edit.rhtml +1 -1
- data/doc/demo/app/views/contents/new.rhtml +1 -1
- data/doc/demo/app/views/searches/search.html.erb +1 -1
- data/doc/demo/config.ru +4 -0
- data/doc/demo/config/application.rb +57 -0
- data/doc/demo/config/boot.rb +4 -107
- data/doc/demo/config/database.yml +16 -24
- data/doc/demo/config/environment.rb +4 -68
- data/doc/demo/config/environments/development.rb +22 -12
- data/doc/demo/config/environments/production.rb +43 -13
- data/doc/demo/config/environments/test.rb +32 -16
- data/doc/demo/config/initializers/backtrace_silencers.rb +7 -0
- data/doc/demo/config/initializers/inflections.rb +10 -0
- data/doc/demo/config/initializers/mime_types.rb +5 -0
- data/doc/demo/config/initializers/secret_token.rb +7 -0
- data/doc/demo/config/initializers/session_store.rb +13 -0
- data/doc/demo/config/locales/en.yml +5 -0
- data/doc/demo/config/routes.rb +4 -5
- data/doc/demo/public/404.html +23 -5
- data/doc/demo/public/422.html +26 -0
- data/doc/demo/public/500.html +23 -5
- data/doc/demo/public/images/rails.png +0 -0
- data/doc/demo/public/index.html +50 -88
- data/doc/demo/public/javascripts/application.js +2 -0
- data/doc/demo/public/javascripts/controls.js +965 -0
- data/doc/demo/public/javascripts/dragdrop.js +974 -0
- data/doc/demo/public/javascripts/effects.js +1123 -0
- data/doc/demo/public/javascripts/prototype.js +6001 -0
- data/doc/demo/public/javascripts/rails.js +191 -0
- data/doc/demo/public/robots.txt +5 -1
- data/doc/demo/script/rails +6 -0
- data/doc/demo/test/functional/admin/backend_controller_test.rb +1 -1
- data/doc/demo/test/functional/contents_controller_test.rb +1 -2
- data/doc/demo/test/functional/searches_controller_test.rb +1 -2
- data/doc/demo/test/performance/browsing_test.rb +9 -0
- data/doc/demo/test/test_helper.rb +13 -18
- data/doc/demo/test/unit/comment_test.rb +4 -4
- data/doc/demo/test/unit/content_test.rb +6 -4
- data/doc/demo/test/unit/ferret_result_test.rb +2 -3
- data/doc/demo/test/unit/multi_index_test.rb +2 -3
- data/doc/demo/test/unit/remote_index_test.rb +2 -2
- data/doc/demo/test/unit/shared_index1_test.rb +2 -3
- data/doc/demo/test/unit/shared_index2_test.rb +2 -3
- data/doc/demo/test/unit/sort_test.rb +2 -2
- data/doc/demo/test/unit/special_content_test.rb +3 -4
- data/lib/acts_as_ferret.rb +17 -3
- data/lib/acts_as_ferret/blank_slate.rb +11 -10
- data/lib/acts_as_ferret/class_methods.rb +9 -7
- data/lib/acts_as_ferret/ferret_find_methods.rb +5 -1
- data/lib/acts_as_ferret/ferret_result.rb +11 -4
- data/lib/acts_as_ferret/multi_index.rb +8 -1
- data/lib/acts_as_ferret/search_results.rb +0 -1
- data/lib/acts_as_ferret/version.rb +1 -1
- metadata +23 -44
- data/doc/demo/test/fixtures/remote_contents.yml +0 -9
- data/doc/demo/vendor/plugins/will_paginate/LICENSE +0 -18
- data/doc/demo/vendor/plugins/will_paginate/README +0 -108
- data/doc/demo/vendor/plugins/will_paginate/Rakefile +0 -23
- data/doc/demo/vendor/plugins/will_paginate/init.rb +0 -21
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +0 -45
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +0 -44
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +0 -159
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +0 -95
- data/doc/demo/vendor/plugins/will_paginate/test/array_pagination_test.rb +0 -23
- data/doc/demo/vendor/plugins/will_paginate/test/boot.rb +0 -27
- data/doc/demo/vendor/plugins/will_paginate/test/console +0 -10
- data/doc/demo/vendor/plugins/will_paginate/test/finder_test.rb +0 -219
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/admin.rb +0 -3
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/companies.yml +0 -24
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb +0 -23
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/developer.rb +0 -11
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +0 -13
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/project.rb +0 -4
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/projects.yml +0 -7
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/replies.yml +0 -20
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/reply.rb +0 -5
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/schema.sql +0 -44
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb +0 -19
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/topics.yml +0 -30
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/user.rb +0 -2
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/users.yml +0 -35
- data/doc/demo/vendor/plugins/will_paginate/test/helper.rb +0 -42
- data/doc/demo/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +0 -64
- data/doc/demo/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +0 -10
- data/doc/demo/vendor/plugins/will_paginate/test/pagination_test.rb +0 -136
data/README
CHANGED
@@ -117,6 +117,12 @@ Please see ActsAsFerret::ActMethods#acts_as_ferret for more information.
|
|
117
117
|
|
118
118
|
aaf is not yet ready for Rails3. Feel free to submit patches!
|
119
119
|
|
120
|
+
Rails 3 :More Like this no longer works for unsaved records (test fails in
|
121
|
+
content_test.rb test_more_like_this_new_record)
|
122
|
+
|
123
|
+
Rails 3: Sorting does not work - causes failure in sorting test & pagination test.
|
124
|
+
|
125
|
+
|
120
126
|
== License
|
121
127
|
|
122
128
|
Released under the MIT license.
|
data/doc/demo/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
# Don't use latest version of rake:
|
4
|
+
# http://stackoverflow.com/questions/6199301/global-access-to-rake-dsl-methods-is-deprecated
|
5
|
+
|
6
|
+
gem 'rake', '0.8.7'
|
7
|
+
gem 'rails', '3.0.9'
|
8
|
+
|
9
|
+
# Bundle edge Rails instead:
|
10
|
+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
11
|
+
|
12
|
+
gem 'mysql'
|
13
|
+
|
14
|
+
# Until branch is merged into master, the tests will fail.
|
15
|
+
# To get everything running use the brightchimp gem.
|
16
|
+
gem 'acts_as_ferret'
|
17
|
+
#gem 'acts_as_ferret', :git => 'git://github.com/brightchimp/acts_as_ferret.git'
|
18
|
+
gem 'will_paginate', '3.0.pre2'
|
data/doc/demo/Rakefile
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
-
# for example lib/tasks/
|
3
|
-
|
4
|
-
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
5
3
|
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
6
5
|
require 'rake'
|
7
|
-
require 'rake/testtask'
|
8
|
-
require 'rake/rdoctask'
|
9
6
|
|
10
|
-
|
7
|
+
Demo::Application.load_tasks
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1>Editing content</h1>
|
2
2
|
|
3
|
-
|
3
|
+
<%= form_for @content, content_path(@content), :html => { :method => :put } do |f| %>
|
4
4
|
<%= render :partial => 'form', :object => f %>
|
5
5
|
<%= submit_tag 'Edit' %>
|
6
6
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1>New content</h1>
|
2
2
|
|
3
|
-
|
3
|
+
<%= form_for @content, :url => contents_path, :html => { :method => :post } do |f| %>
|
4
4
|
<%= render :partial => 'form', :object => f %>
|
5
5
|
<%= submit_tag "Create" %>
|
6
6
|
<% end %>
|
data/doc/demo/config.ru
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
module Demo
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
35
|
+
|
36
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
37
|
+
config.encoding = "utf-8"
|
38
|
+
|
39
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
40
|
+
config.filter_parameters += [:password]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
ActsAsFerret::remote = false if ENV['AAF_REMOTE'] != 'true'
|
46
|
+
ActsAsFerret::raise_drb_errors = ENV['RAISE_DRB_ERRORS'] == 'true'
|
47
|
+
|
48
|
+
|
49
|
+
# define the index shared by the SharedIndex1 and SharedIndex2 classes
|
50
|
+
ActsAsFerret::define_index 'shared', :remote => ENV['AAF_REMOTE'] == 'true',
|
51
|
+
:raise_drb_errors => ENV['RAISE_DRB_ERRORS'] == 'true',
|
52
|
+
:fields => {
|
53
|
+
:name => { :store => :yes }
|
54
|
+
},
|
55
|
+
:ferret => {
|
56
|
+
:default_field => [ :name ]
|
57
|
+
}
|
data/doc/demo/config/boot.rb
CHANGED
@@ -1,109 +1,6 @@
|
|
1
|
-
|
2
|
-
# Configure your app in config/environment.rb and config/environments/*.rb
|
1
|
+
require 'rubygems'
|
3
2
|
|
4
|
-
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
5
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
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
class GemBoot < Boot
|
51
|
-
def load_initializer
|
52
|
-
self.class.load_rubygems
|
53
|
-
load_rails_gem
|
54
|
-
require 'initializer'
|
55
|
-
end
|
56
|
-
|
57
|
-
def load_rails_gem
|
58
|
-
if version = self.class.gem_version
|
59
|
-
gem 'rails', version
|
60
|
-
else
|
61
|
-
gem 'rails'
|
62
|
-
end
|
63
|
-
rescue Gem::LoadError => load_error
|
64
|
-
$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.)
|
65
|
-
exit 1
|
66
|
-
end
|
67
|
-
|
68
|
-
class << self
|
69
|
-
def rubygems_version
|
70
|
-
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
71
|
-
end
|
72
|
-
|
73
|
-
def gem_version
|
74
|
-
if defined? RAILS_GEM_VERSION
|
75
|
-
RAILS_GEM_VERSION
|
76
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
77
|
-
ENV['RAILS_GEM_VERSION']
|
78
|
-
else
|
79
|
-
parse_gem_version(read_environment_rb)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def load_rubygems
|
84
|
-
require 'rubygems'
|
85
|
-
min_version = '1.1.1'
|
86
|
-
unless rubygems_version >= min_version
|
87
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
-
exit 1
|
89
|
-
end
|
90
|
-
|
91
|
-
rescue LoadError
|
92
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
|
-
exit 1
|
94
|
-
end
|
95
|
-
|
96
|
-
def parse_gem_version(text)
|
97
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
def read_environment_rb
|
102
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# All that for this:
|
109
|
-
Rails.boot!
|
6
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
@@ -1,38 +1,30 @@
|
|
1
|
-
# MySQL
|
1
|
+
# MySQL. Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Install the MySQL driver:
|
4
|
+
# gem install mysql2
|
2
5
|
#
|
3
|
-
# Get the fast C bindings:
|
4
|
-
# gem install mysql
|
5
|
-
# (on OS X: gem install mysql -- --include=/usr/local/lib)
|
6
6
|
# And be sure to use new-style password hashing:
|
7
7
|
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
8
|
-
#
|
9
|
-
# mysql config
|
10
8
|
development:
|
11
9
|
adapter: mysql
|
10
|
+
encoding: utf8
|
11
|
+
reconnect: false
|
12
12
|
database: aaf_dev
|
13
|
+
pool: 5
|
13
14
|
username: ferret
|
14
15
|
password: ferret
|
15
|
-
|
16
|
+
socket: /tmp/mysql.sock
|
17
|
+
|
18
|
+
# Warning: The database defined as "test" will be erased and
|
19
|
+
# re-generated from your development database when you run "rake".
|
20
|
+
# Do not set this db to the same as development or production.
|
16
21
|
test:
|
17
22
|
adapter: mysql
|
23
|
+
encoding: utf8
|
24
|
+
reconnect: false
|
18
25
|
database: aaf_test
|
26
|
+
pool: 5
|
19
27
|
username: ferret
|
20
28
|
password: ferret
|
21
|
-
|
22
|
-
# since this is a demo, we won't need this one
|
23
|
-
#production:
|
24
|
-
# adapter: mysql
|
25
|
-
# database: ferret_production
|
26
|
-
# username: root
|
27
|
-
# password:
|
28
|
-
# socket: /var/run/mysqld/mysqld.sock
|
29
|
-
|
30
|
-
# SQLITE
|
31
|
-
#development:
|
32
|
-
# adapter: sqlite3
|
33
|
-
# dbfile: db/dev.sqlite
|
34
|
-
|
35
|
-
#test:
|
36
|
-
# adapter: sqlite3
|
37
|
-
# dbfile: db/test.sqlite
|
29
|
+
socket: /tmp/mysql.sock
|
38
30
|
|
@@ -1,69 +1,5 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
# Uncomment below to force Rails into production mode when
|
4
|
-
# you don't control web/app server and can't set it the proper way
|
5
|
-
# ENV['RAILS_ENV'] ||= 'production'
|
6
|
-
|
7
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
-
|
10
|
-
Rails::Initializer.run do |config|
|
11
|
-
# Settings in config/environments/* take precedence those specified here
|
12
|
-
|
13
|
-
config.action_controller.session = { :session_key => "_demo_session", :secret => "aaaaaaaaaaaaaaaabbbbbbbbbbbbbbccccccccccccccsome secret phrase" }
|
14
|
-
|
15
|
-
# Skip frameworks you're not going to use
|
16
|
-
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
17
|
-
|
18
|
-
# Add additional load paths for your own custom dirs
|
19
|
-
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
20
|
-
|
21
|
-
# Force all environments to use the same logger level
|
22
|
-
# (by default production uses :info, the others :debug)
|
23
|
-
# config.log_level = :debug
|
24
|
-
|
25
|
-
# Use the database for sessions instead of the file system
|
26
|
-
# (create the session table with 'rake create_sessions_table')
|
27
|
-
# config.action_controller.session_store = :active_record_store
|
28
|
-
|
29
|
-
# Enable page/fragment caching by setting a file-based store
|
30
|
-
# (remember to create the caching directory and make it readable to the application)
|
31
|
-
# config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
|
32
|
-
|
33
|
-
# Activate observers that should always be running
|
34
|
-
# config.active_record.observers = :cacher, :garbage_collector
|
35
|
-
|
36
|
-
# Make Active Record use UTC-base instead of local time
|
37
|
-
# config.active_record.default_timezone = :utc
|
38
|
-
|
39
|
-
# Use Active Record's schema dumper instead of SQL when creating the test database
|
40
|
-
# (enables use of different database adapters for development and test environments)
|
41
|
-
# config.active_record.schema_format = :ruby
|
42
|
-
|
43
|
-
# See Rails::Configuration for more options
|
44
|
-
end
|
45
|
-
|
46
|
-
# Add new inflection rules using the following format
|
47
|
-
# (all these examples are active by default):
|
48
|
-
# Inflector.inflections do |inflect|
|
49
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
50
|
-
# inflect.singular /^(ox)en/i, '\1'
|
51
|
-
# inflect.irregular 'person', 'people'
|
52
|
-
# inflect.uncountable %w( fish sheep )
|
53
|
-
# end
|
54
|
-
|
55
|
-
# Include your application configuration below
|
56
|
-
|
57
|
-
ActsAsFerret::remote = false if ENV['AAF_REMOTE'] != 'true'
|
58
|
-
ActsAsFerret::raise_drb_errors = ENV['RAISE_DRB_ERRORS'] == 'true'
|
59
|
-
|
60
|
-
# define the index shared by the SharedIndex1 and SharedIndex2 classes
|
61
|
-
ActsAsFerret::define_index 'shared', :remote => ENV['AAF_REMOTE'] == 'true',
|
62
|
-
:raise_drb_errors => ENV['RAISE_DRB_ERRORS'] == 'true',
|
63
|
-
:fields => {
|
64
|
-
:name => { :store => :yes }
|
65
|
-
},
|
66
|
-
:ferret => {
|
67
|
-
:default_field => [ :name ]
|
68
|
-
}
|
1
|
+
# Load the rails application
|
2
|
+
require File.expand_path('../application', __FILE__)
|
69
3
|
|
4
|
+
# Initialize the rails application
|
5
|
+
Demo::Application.initialize!
|
@@ -1,16 +1,26 @@
|
|
1
|
-
|
1
|
+
Demo::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.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
|
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
|
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.
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
14
26
|
|
15
|
-
# Don't care if the mailer can't send
|
16
|
-
config.action_mailer.raise_delivery_errors = false
|
@@ -1,19 +1,49 @@
|
|
1
|
-
|
1
|
+
Demo::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.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
|
-
#
|
8
|
-
|
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
|
9
11
|
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
10
14
|
|
11
|
-
#
|
12
|
-
config.
|
13
|
-
config.action_controller.perform_caching = true
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
14
17
|
|
15
|
-
#
|
16
|
-
#
|
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
|
17
20
|
|
18
|
-
#
|
19
|
-
# config.
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
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
|