blacklight_cql 1.0.1 → 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.
Files changed (47) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/blacklight_cql/explain_controller.rb +1 -1
  3. data/app/helpers/blacklight_cql/explain_helper.rb +4 -5
  4. data/lib/blacklight_cql/blacklight_to_solr.rb +2 -2
  5. data/lib/blacklight_cql/engine.rb +5 -2
  6. data/lib/blacklight_cql/solr_helper_extension.rb +13 -7
  7. data/lib/blacklight_cql/template_helper_extension.rb +1 -1
  8. data/spec/app_root/Rakefile +7 -0
  9. data/spec/app_root/app/assets/javascripts/application.js +9 -0
  10. data/spec/app_root/app/assets/stylesheets/application.css +7 -0
  11. data/spec/app_root/app/controllers/application_controller.rb +1 -0
  12. data/spec/app_root/app/helpers/application_helper.rb +2 -0
  13. data/spec/app_root/app/views/layouts/application.html.erb +14 -0
  14. data/spec/app_root/config/application.rb +45 -0
  15. data/spec/app_root/config/boot.rb +7 -112
  16. data/spec/app_root/config/database.yml +17 -23
  17. data/spec/app_root/config/environment.rb +4 -29
  18. data/spec/app_root/config/environments/development.rb +30 -0
  19. data/spec/app_root/config/environments/production.rb +60 -0
  20. data/spec/app_root/config/environments/test.rb +39 -0
  21. data/spec/app_root/config/initializers/backtrace_silencers.rb +7 -0
  22. data/spec/app_root/config/initializers/inflections.rb +10 -0
  23. data/spec/app_root/config/initializers/mime_types.rb +5 -0
  24. data/spec/app_root/config/initializers/secret_token.rb +7 -0
  25. data/spec/app_root/config/initializers/session_store.rb +8 -0
  26. data/spec/app_root/config/initializers/wrap_parameters.rb +14 -0
  27. data/spec/app_root/config/locales/en.yml +5 -0
  28. data/spec/app_root/config/routes.rb +57 -3
  29. data/spec/app_root/config.ru +4 -0
  30. data/spec/app_root/db/test.sqlite3 +0 -0
  31. data/spec/app_root/{config/environments/in_memory.rb → log/development.log} +0 -0
  32. data/spec/app_root/{config/environments/mysql.rb → log/in_memory.log} +0 -0
  33. data/spec/app_root/log/test.log +42 -0
  34. data/spec/app_root/public/404.html +26 -0
  35. data/spec/app_root/public/422.html +26 -0
  36. data/spec/app_root/public/500.html +26 -0
  37. data/spec/app_root/{config/environments/postgresql.rb → public/favicon.ico} +0 -0
  38. data/spec/app_root/script/rails +6 -0
  39. data/spec/app_root/spec/spec_helper.rb +33 -0
  40. data/spec/lib/blacklight_to_solr_spec.rb +8 -27
  41. data/spec/spec_helper.rb +26 -42
  42. data/spec/views/explain.xml.builder_spec.rb +67 -42
  43. metadata +115 -34
  44. data/spec/app_root/config/environments/sqlite.rb +0 -0
  45. data/spec/app_root/config/environments/sqlite3.rb +0 -0
  46. data/spec/app_root/lib/blacklight/search_fields.rb +0 -97
  47. data/spec/app_root/lib/console_with_fixtures.rb +0 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.1.0
@@ -6,7 +6,7 @@ module BlacklightCql
6
6
 
7
7
  def index
8
8
  @luke_response = Blacklight.solr.luke
9
- @field_config = Blacklight
9
+ @config = CatalogController.blacklight_config
10
10
 
11
11
  render "explain.xml.builder", :content_type => "application/xml"
12
12
  end
@@ -21,13 +21,12 @@ module BlacklightCql::ExplainHelper
21
21
  end
22
22
  end
23
23
 
24
- # Expects an object in @field_config that implements
25
- # Blacklight::SearchFields to provide search field config.
26
- # argument is a Builder object we can write to.
24
+ # Expects @config to have a Blacklight::Configuration
25
+ # object.
27
26
  def blacklight_config_to_explain_index(xml)
28
- @field_config.search_field_list.each do |search_field|
27
+ @config.search_fields.values.each do |search_field|
29
28
  xml.index("search" => "true", "scan" => "false", "sort" => "false") do
30
- xml.title search_field[:display_label]
29
+ xml.title search_field[:label]
31
30
  xml.map do
32
31
  xml.name(search_field[:key], "set" => CqlRuby.to_solr_defaults[:blacklight_field_prefix])
33
32
  end
@@ -49,7 +49,7 @@ module CqlRuby
49
49
  (index_prefix, index) = parse_index(@index, config)
50
50
 
51
51
  if (index_prefix == CqlRuby.to_solr_defaults[:blacklight_field_prefix])
52
- field_def = config.search_field_def_for_key(index)
52
+ field_def = config.search_fields[index]
53
53
 
54
54
  # Merge together solr params and local ones; they're ALL
55
55
  # going to be provided as LocalParams in our nested query.
@@ -101,7 +101,7 @@ module CqlRuby
101
101
  end
102
102
  # If no prefix, we use local one if we can
103
103
  if ( index_prefix == nil)
104
- if ( config.search_field_def_for_key(index) )
104
+ if ( config.search_fields[index] )
105
105
  index_prefix = CqlRuby.to_solr_defaults[:blacklight_field_prefix]
106
106
  else
107
107
  index_prefix = CqlRuby.to_solr_defaults[:solr_field_prefix]
@@ -15,8 +15,11 @@ module BlacklightCql
15
15
  # Call in after_initialze to make sure the default search_fields are
16
16
  # already created, AND the local app has had the opportunity to customize
17
17
  # our placeholder search_field.
18
- config.after_initialize do
19
- Blacklight.config[:search_fields] << BlacklightCql::SolrHelperExtension.pseudo_search_field
18
+ config.after_initialize do
19
+ CatalogController.blacklight_config.configure do |config|
20
+ hash = BlacklightCql::SolrHelperExtension.pseudo_search_field
21
+ config.add_search_field hash[:key], hash
22
+ end
20
23
  end
21
24
 
22
25
 
@@ -6,21 +6,27 @@
6
6
  # itself, it would not, and we'd have to use some ugly monkey patching
7
7
  # alias_method_chain instead, thankfully we do not.
8
8
  module BlacklightCql::SolrHelperExtension
9
+ extend ActiveSupport::Concern
10
+
9
11
  mattr_accessor :pseudo_search_field
10
12
  # :advanced_parse_q => false, tells the AdvancedSearchPlugin not to try
11
13
  # to parse this for parens and booleans, we're taking care of it!
12
- self.pseudo_search_field = {:key => "cql", :display_label => "External Search (CQL)", :include_in_simple_select => false, :advanced_parse_q => false}
14
+ self.pseudo_search_field = {:key => "cql", :label => "External Search (CQL)", :include_in_simple_select => false, :advanced_parse_q => false}
13
15
 
16
+ included do
17
+ solr_search_params_logic << :cql_to_solr_search_params
18
+ end
19
+
14
20
  # Over-ride solr_search_params to do special CQL-to-complex-solr-query
15
21
  # processing iff the "search_field" is our pseudo-search-field indicating
16
- # a CQL query.
17
- def solr_search_params(extra_controller_params = {})
18
- solr_params = super(extra_controller_params)
19
-
20
- if params["search_field"] == self.pseudo_search_field[:key] && ! params["q"].blank?
22
+ # a CQL query.
23
+ def cql_to_solr_search_params(solr_params ={}, user_params ={})
24
+ if user_params["search_field"] == self.pseudo_search_field[:key] && ! params["q"].blank?
21
25
  parser = CqlRuby::CqlParser.new
22
- solr_params[:q] = "{!lucene} " + parser.parse( params["q"] ).to_bl_solr(Blacklight)
26
+ solr_params[:q] = "{!lucene} " + parser.parse( params["q"] ).to_bl_solr(blacklight_config)
23
27
  end
24
28
  return solr_params
25
29
  end
30
+
31
+
26
32
  end
@@ -11,7 +11,7 @@ module BlacklightCql::TemplateHelperExtension
11
11
  if params[:q].blank? || params[:search_field] != field[:key]
12
12
  super
13
13
  else
14
- super.clone.push([field[:display_label], field[:key]]).uniq
14
+ super.clone.push([field[:label], field[:key]]).uniq
15
15
  end
16
16
  end
17
17
 
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -1,2 +1,3 @@
1
1
  class ApplicationController < ActionController::Base
2
+ protect_from_forgery
2
3
  end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,45 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require "blacklight_cql"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
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
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = "utf-8"
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Enable the asset pipeline
39
+ config.assets.enabled = true
40
+
41
+ # Version of your assets, change this if you want to expire all your assets
42
+ config.assets.version = '1.0'
43
+ end
44
+ end
45
+
@@ -1,115 +1,10 @@
1
- # Allow customization of the rails framework path
2
- RAILS_FRAMEWORK_ROOT = (ENV['RAILS_FRAMEWORK_ROOT'] || "#{File.dirname(__FILE__)}/../../../../../../vendor/rails") unless defined?(RAILS_FRAMEWORK_ROOT)
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
3
 
4
- # Don't change this file!
5
- # Configure your app in config/environment.rb and config/environments/*.rb
6
-
7
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
8
-
9
- module Rails
10
- class << self
11
- def boot!
12
- unless booted?
13
- preinitialize
14
- pick_boot.run
15
- end
16
- end
17
-
18
- def booted?
19
- defined? Rails::Initializer
20
- end
21
-
22
- def pick_boot
23
- (vendor_rails? ? VendorBoot : GemBoot).new
24
- end
25
-
26
- def vendor_rails?
27
- File.exist?(RAILS_FRAMEWORK_ROOT)
28
- end
29
-
30
- def preinitialize
31
- load(preinitializer_path) if File.exist?(preinitializer_path)
32
- end
33
-
34
- def preinitializer_path
35
- "#{RAILS_ROOT}/config/preinitializer.rb"
36
- end
37
- end
38
-
39
- class Boot
40
- def run
41
- load_initializer
42
- Rails::Initializer.run(:set_load_path)
43
- end
44
- end
45
-
46
- class VendorBoot < Boot
47
- def load_initializer
48
- require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/initializer"
49
- Rails::Initializer.run(:install_gem_spec_stubs)
50
- Rails::GemDependency.add_frozen_gem_path
51
- end
52
- end
53
-
54
- class GemBoot < Boot
55
- def load_initializer
56
- self.class.load_rubygems
57
- load_rails_gem
58
- require 'initializer'
59
- end
60
-
61
- def load_rails_gem
62
- if version = self.class.gem_version
63
- gem 'rails', version
64
- else
65
- gem 'rails'
66
- end
67
- rescue Gem::LoadError => load_error
68
- $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.)
69
- exit 1
70
- end
71
-
72
- class << self
73
- def rubygems_version
74
- Gem::RubyGemsVersion rescue nil
75
- end
76
-
77
- def gem_version
78
- if defined? RAILS_GEM_VERSION
79
- RAILS_GEM_VERSION
80
- elsif ENV.include?('RAILS_GEM_VERSION')
81
- ENV['RAILS_GEM_VERSION']
82
- else
83
- parse_gem_version(read_environment_rb)
84
- end
85
- end
86
-
87
- def load_rubygems
88
- require 'rubygems'
89
- min_version = '1.3.1'
90
- unless rubygems_version >= min_version
91
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
92
- exit 1
93
- end
94
-
95
- rescue LoadError
96
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
97
- exit 1
98
- end
99
-
100
- def parse_gem_version(text)
101
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
102
- end
103
-
104
- private
105
- def read_environment_rb
106
- environment_rb = "#{RAILS_ROOT}/config/environment.rb"
107
- environment_rb = "#{HELPER_RAILS_ROOT}/config/environment.rb" unless File.exists?(environment_rb)
108
- File.read(environment_rb)
109
- end
110
- end
111
- end
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
112
8
  end
113
9
 
114
- # All that for this:
115
- Rails.boot!
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,31 +1,25 @@
1
- in_memory:
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
2
7
  adapter: sqlite3
3
- database: ":memory:"
4
- verbosity: quiet
8
+ database: db/development.sqlite3
5
9
  pool: 5
6
10
  timeout: 5000
7
- sqlite:
8
- adapter: sqlite
9
- dbfile: plugin_test.sqlite.db
10
- pool: 5
11
- timeout: 5000
12
- sqlite3:
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
13
16
  adapter: sqlite3
14
- dbfile: plugin_test.sqlite3.db
17
+ database: db/test.sqlite3
15
18
  pool: 5
16
19
  timeout: 5000
17
- postgresql:
18
- adapter: postgresql
19
- username: postgres
20
- password: postgres
21
- database: plugin_test
22
- pool: 5
23
- timeout: 5000
24
- mysql:
25
- adapter: mysql
26
- host: localhost
27
- username: root
28
- password:
29
- database: plugin_test
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
30
24
  pool: 5
31
25
  timeout: 5000
@@ -1,30 +1,5 @@
1
- require File.join(File.dirname(__FILE__), 'boot')
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
2
3
 
3
- Rails::Initializer.run do |config|
4
-
5
- config.cache_classes = false
6
- config.whiny_nils = true
7
- config.action_controller.session = {:key => 'rails_session', :secret => 'd229e4d22437432705ab3985d4d246'}
8
- config.plugin_locators.unshift(
9
- Class.new(Rails::Plugin::Locator) do
10
- def plugins
11
- [Rails::Plugin.new(File.expand_path('.'))]
12
- end
13
- end
14
- ) unless defined?(PluginTestHelper::PluginLocator)
15
-
16
- # jrochkind addition to plugin_test_helper generated rails stub.
17
- # Adds our plugin code itself to the Rails load path, so it will be
18
- # auto-loaded. Not entirely sure why plugin_test_helper doesn't do
19
- # this itself.
20
- config.load_paths << File.expand_path(File.dirname(__FILE__)+ "../../../../lib")
21
- config.load_paths << File.expand_path(File.dirname(__FILE__)+ "../../../../app/helpers")
22
- config.load_paths << File.expand_path(File.dirname(__FILE__)+ "../../../../app/models")
23
-
24
- # We only get one view path, we want it to be our plugins, not the
25
- # pseudo-app_root
26
- config.view_path = File.expand_path(File.dirname(__FILE__)+ "../../../../app/views")
27
-
28
-
29
-
30
- end
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,30 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
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 web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
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
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -0,0 +1,60 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ end
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
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
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
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!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'fa78fff0933bf4d06eaf0cc0c54daffc4b0d183652e28f8a98f6bd6593a061712932a0f759505add51ca3a8c8f9ec555a59709d353c07c57a60c681bffb4abe8'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
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
@@ -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]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"