From 2983330e5704e04841856b6fef06f54a827e41f9 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 21:33:03 +0200 Subject: [PATCH 01/40] Fix link in reservation mail --- app/views/reservation_mailer/user_email.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reservation_mailer/user_email.html.haml b/app/views/reservation_mailer/user_email.html.haml index b1ccd509..91dccc32 100644 --- a/app/views/reservation_mailer/user_email.html.haml +++ b/app/views/reservation_mailer/user_email.html.haml @@ -1,3 +1,3 @@ %p Liebe/r #{@reservation.first_name} #{@reservation.last_name} %p Vielen Dank für Ihre Reservation. Sie können das Dossier #{@reservation.dossier}, #{@reservation.dossier_years} ab #{@reservation.pickup} 10.00 Uhr bei doku-zug.ch konsultieren. -%p Mit freundlichen Grüssen Team doku-zug.ch +%p Mit freundlichen Grüssen Team http://www.doku-zug.ch From 245d568fe38f4e83da791c11f9752f2ec263bd71 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 21:33:24 +0200 Subject: [PATCH 02/40] Change default host for URLs in mails --- config/environments/fallback.rb | 2 +- config/environments/production.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/fallback.rb b/config/environments/fallback.rb index 854b657e..c9e9ffda 100644 --- a/config/environments/fallback.rb +++ b/config/environments/fallback.rb @@ -62,6 +62,6 @@ config.active_support.deprecation = :notify # Mail configuration - config.action_mailer.default_url_options = { host: 'doku-zug.cyt.ch' } + config.action_mailer.default_url_options = { host: 'katalog.doku-zug.ch' } config.action_mailer.delivery_method = :sendmail end diff --git a/config/environments/production.rb b/config/environments/production.rb index 854b657e..c9e9ffda 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -62,6 +62,6 @@ config.active_support.deprecation = :notify # Mail configuration - config.action_mailer.default_url_options = { host: 'doku-zug.cyt.ch' } + config.action_mailer.default_url_options = { host: 'katalog.doku-zug.ch' } config.action_mailer.delivery_method = :sendmail end From 35993a03182356a6b497d87e49bde1bfc24b7786 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 21:33:48 +0200 Subject: [PATCH 03/40] Simplify mailer settings --- app/mailers/reservation_mailer.rb | 5 ++--- config/application.yml.example | 5 +---- config/initializers/devise.rb | 2 +- config/initializers/email.rb | 3 --- 4 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 config/initializers/email.rb diff --git a/app/mailers/reservation_mailer.rb b/app/mailers/reservation_mailer.rb index f9041913..136791d9 100644 --- a/app/mailers/reservation_mailer.rb +++ b/app/mailers/reservation_mailer.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 class ReservationMailer < ActionMailer::Base - default from: Settings.mail.reservation.sender + default from: Settings.mail.sender def user_email(reservation) @reservation = reservation @@ -16,8 +16,7 @@ def editor_email(reservation) @reservation = reservation mail( - from: Settings.mail.reservation.internal_sender, - to: Settings.mail.reservation.sender, + to: Settings.mail.sender, subject: "#{I18n.t('activerecord.attributes.reservation.title')}: #{@reservation.dossier}" ) end diff --git a/config/application.yml.example b/config/application.yml.example index dc5a5a95..fabc90ac 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -6,10 +6,7 @@ defaults: &defaults airbrake: api_key: mail: - reservation: - recipient: to@example.com - sender: from@example.com - internal_sender: internal_from@example.com + sender: info@example.com development: <<: *defaults diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 6f6c1d7e..dadc3205 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -5,7 +5,7 @@ Devise.setup do |config| # ==> Mailer Configuration # Configure the e-mail address which will be shown in DeviseMailer. - config.mailer_sender = Settings.mail.reservation.sender + config.mailer_sender = Settings.mail.sender # Configure the class responsible to send e-mails. # config.mailer = "Devise::Mailer" diff --git a/config/initializers/email.rb b/config/initializers/email.rb deleted file mode 100644 index e3d2cbd3..00000000 --- a/config/initializers/email.rb +++ /dev/null @@ -1,3 +0,0 @@ -ActionMailer::Base.delivery_method = :sendmail -RESERVATION_EMAIL_RECIPIENT = Settings.mail.reservation.recipient -RESERVATION_EMAIL_SENDER = Settings.mail.reservation.sender From 6bd5e6a00bee5d3df89c637bb5d469389d83d314 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 22:00:52 +0200 Subject: [PATCH 04/40] Tweak link in reservation mail --- app/views/reservation_mailer/user_email.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reservation_mailer/user_email.html.haml b/app/views/reservation_mailer/user_email.html.haml index 91dccc32..d156673d 100644 --- a/app/views/reservation_mailer/user_email.html.haml +++ b/app/views/reservation_mailer/user_email.html.haml @@ -1,3 +1,3 @@ %p Liebe/r #{@reservation.first_name} #{@reservation.last_name} %p Vielen Dank für Ihre Reservation. Sie können das Dossier #{@reservation.dossier}, #{@reservation.dossier_years} ab #{@reservation.pickup} 10.00 Uhr bei doku-zug.ch konsultieren. -%p Mit freundlichen Grüssen Team http://www.doku-zug.ch +%p Mit freundlichen Grüssen Team doku-zug.ch From 841a1ab2db6b77947fc437f1215528a4f9b934a7 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 22:01:04 +0200 Subject: [PATCH 05/40] Fix links in error pages --- public/404.html | 2 +- public/500.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/404.html b/public/404.html index 9553b3b0..f4124414 100644 --- a/public/404.html +++ b/public/404.html @@ -13,7 +13,7 @@ -
doku-zug.ch +
doku-zug.ch > Katalog
diff --git a/public/500.html b/public/500.html index 8d4dd3bc..17382b62 100644 --- a/public/500.html +++ b/public/500.html @@ -13,7 +13,7 @@ -
doku-zug.ch +
doku-zug.ch > Katalog
From 97920528cb256cd073bc090c658a579753943052 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Tue, 31 Mar 2015 22:12:17 +0200 Subject: [PATCH 06/40] Use Reply-To: header in mails --- app/mailers/reservation_mailer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/mailers/reservation_mailer.rb b/app/mailers/reservation_mailer.rb index 136791d9..4df68704 100644 --- a/app/mailers/reservation_mailer.rb +++ b/app/mailers/reservation_mailer.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 class ReservationMailer < ActionMailer::Base - default from: Settings.mail.sender + default from: Settings.mail.sender, reply_to: Settings.mail.recipient def user_email(reservation) @reservation = reservation @@ -16,7 +16,7 @@ def editor_email(reservation) @reservation = reservation mail( - to: Settings.mail.sender, + to: Settings.mail.recipient, subject: "#{I18n.t('activerecord.attributes.reservation.title')}: #{@reservation.dossier}" ) end From e29874f97f39c6ac4184a9c946fb0b4f7a00281f Mon Sep 17 00:00:00 2001 From: Andi Staub Date: Wed, 26 Nov 2014 21:19:59 +0100 Subject: [PATCH 07/40] Add rails 4 files. --- .gitignore | 39 ++- .rspec | 1 + Capfile | 17 +- Gemfile | 194 +++++------ Gemfile.lock | 304 +++++++++--------- Rakefile | 5 +- .../controllers/concerns/.keep | 0 app/models/concerns/.keep | 0 bin/bundle | 3 + bin/rails | 8 + bin/rake | 8 + bin/spring | 18 ++ config.ru | 2 +- config/application.rb | 61 +--- config/boot.rb | 17 +- config/database.yml | 54 ++++ config/database.yml.example | 41 --- config/deploy/database.yml.erb | 33 -- config/environment.rb | 8 +- config/environments/development.rb | 48 ++- config/environments/fallback.rb | 67 ---- config/environments/production.rb | 81 +++-- config/environments/staging.rb | 61 ---- config/environments/test.rb | 39 ++- config/initializers/assets.rb | 9 + config/initializers/backtrace_silencers.rb | 2 - config/initializers/cookies_serializer.rb | 3 + config/initializers/devise.rb | 240 ++++++++++---- .../initializers/filter_parameter_logging.rb | 4 + config/initializers/formtastic.rb | 100 ++++-- config/initializers/inflections.rb | 14 +- config/initializers/mime_types.rb | 3 - config/initializers/session_store.rb | 9 +- config/initializers/wrap_parameters.rb | 14 + config/routes.rb | 11 +- config/secrets.yml | 22 ++ config/unicorn.rb | 56 ---- doc/README_FOR_APP | 2 - lib/assets/.keep | 0 lib/formtastic_faux_model.rb | 2 - lib/pagination_list_link_renderer.rb | 2 - lib/recipes/aspell.rb | 2 - lib/recipes/katalog.rb | 2 - lib/templates/haml/scaffold/_form.html.haml | 8 + log/.keep | 0 public/422.html | 68 +++- public/robots.txt | 16 +- script/delayed_job | 5 - script/rails | 9 - vendor/assets/javascripts/.keep | 0 vendor/assets/stylesheets/.keep | 0 51 files changed, 896 insertions(+), 816 deletions(-) rename lib/tasks/.gitkeep => app/controllers/concerns/.keep (100%) create mode 100644 app/models/concerns/.keep create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/spring create mode 100644 config/database.yml delete mode 100644 config/database.yml.example delete mode 100644 config/deploy/database.yml.erb delete mode 100644 config/environments/fallback.rb delete mode 100644 config/environments/staging.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/secrets.yml delete mode 100644 config/unicorn.rb delete mode 100644 doc/README_FOR_APP create mode 100644 lib/assets/.keep create mode 100644 lib/templates/haml/scaffold/_form.html.haml create mode 100644 log/.keep mode change 120000 => 100644 public/422.html delete mode 100755 script/delayed_job delete mode 100755 script/rails create mode 100644 vendor/assets/javascripts/.keep create mode 100644 vendor/assets/stylesheets/.keep diff --git a/.gitignore b/.gitignore index 9da0843d..88c89a75 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,21 @@ -# Rails -# ===== -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' -# Passenger -tmp/restart.txt +# Ignore bundler config. +/.bundle -# Vendor -vendor/cache -vendor/bundle +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal -# Volatile -doc/api -doc/app -public/stylesheets/all.css +# Ignore all logfiles and tempfiles. +/log/*.log +/tmp/**/* # Local -config/database.yml config/application.yml config/deploy/production.rb config/deploy/staging.rb @@ -32,7 +29,15 @@ public/stylesheets/compiled db/sphinx config/*.sphinx.conf config/sphinx/ -config/initializers/mail.rb # Aspell db/aspell/aspell.de_CH.pws + +# Ignore mac ds_store files +.DS_Store + +# Sensitive data. +.env* + +# Ignore coverage report +/doc/coverage diff --git a/.rspec b/.rspec index 4e1e0d2f..83e16f80 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,2 @@ --color +--require spec_helper diff --git a/Capfile b/Capfile index 04d8d05f..805f7404 100644 --- a/Capfile +++ b/Capfile @@ -1,7 +1,14 @@ -require 'bundler/setup' +# Load DSL and Setup Up Stages +require 'capistrano/setup' -load 'deploy' if respond_to?(:namespace) # cap2 differentiator -Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } -Dir['lib/recipes/*.rb'].each { |plugin| load(plugin) } +# Includes default deployment tasks +require 'capistrano/deploy' -load 'config/deploy' # remove this line to skip loading any of the default tasks +# Includes tasks from other gems included in your Gemfile +require 'capistrano/rbenv' +require 'capistrano/bundler' +require 'capistrano/rails/assets' +require 'capistrano/rails/migrations' + +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } diff --git a/Gemfile b/Gemfile index fc948d20..81a50a0b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,128 +1,142 @@ # Settings # ======== -source 'http://rubygems.org' +source 'https://rubygems.org' # Rails # ===== gem 'rails' - -# Unicorn -# ======= -gem 'unicorn' - # Database +# ======== gem 'mysql2' -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails' - gem 'coffee-rails' - gem 'therubyracer' - gem 'uglifier' - gem 'compass-rails' -end +# Journaling +# ========== +gem 'paper_trail' +#gem 'revertible_paper_trail', path: '../revertible_paper_trail', branch: 'master' + +# Asset Pipeline +# ============== +gem 'sass-rails' +gem 'uglifier' +gem 'coffee-rails' +gem 'therubyracer', platforms: :ruby +gem 'quiet_assets' +gem 'compass-rails' + +# CRUD +# ==== +gem 'inherited_resources', '~> 1.5.0' # Dependency on has_scope release candidate +gem 'jbuilder' +gem 'has_scope' +gem 'show_for' +gem 'will_paginate' +gem 'nokogiri' +gem 'holidays' +# I18n +# ==== +gem 'i18n_rails_helpers', github: 'huerlisi/i18n_rails_helpers' + +# UI +# == +gem 'simple-navigation' gem 'jquery-rails' gem 'jquery-ui-rails' +gem 'formtastic' -# Test -# === -group :test do - # Matchers/Helpers - gem 'shoulda' -end +# WYSIWYG Editor +# ============== +gem 'ckeditor' -group :test, :development do - # Framework - gem 'rspec-rails' +# Model extensions +# ============= +gem 'acts-as-taggable-on' - # Fixtures - gem 'factory_girl_rails' - gem 'database_cleaner' +# Search +# ====== +gem 'thinking-sphinx' - # Debugger - gem 'pry-rails' - gem 'pry-byebug' -end +# Spellchecking +# ============= +gem 'ffi-aspell' -# Development +# PDF reports # =========== -group :development do - # RDoc - gem 'rdoc' +gem 'prawn_rails' +gem 'prawn' +gem 'prawn-table' - # Deployment - gem 'capistrano', '~> 2.15.5' - gem 'capistrano-rbenv', '~> 1.0' - gem 'capones_recipes' +# Generate excel files +# ==================== +gem 'spreadsheet' - gem 'quiet_assets' +# Page fetcher +# ============ +gem 'mechanize' - # Code quality - gem 'rubocop', require: false +# Docs +# ==== +group :doc do + # Docs + gem 'sdoc', require: false end -# Standard helpers -# ================ -gem 'haml-rails' - -gem 'formtastic' -gem 'will_paginate', git: 'https://github.com/huerlisi/will_paginate.git', branch: 'show_always' -gem 'inherited_resources' -gem 'has_scope' -gem 'i18n_rails_helpers', github: 'huerlisi/i18n_rails_helpers' -gem 'simple-navigation' -gem 'nokogiri' -# Katalog -# ======= -# Authentication +# Access Control +# ============== gem 'devise' +gem 'cancancan' -# Authorization -gem 'cancan' +# Deployment +# ========== +gem 'unicorn-rails' -# Tagging -gem 'acts-as-taggable-on' +# Exception Notifier +# ================== +gem 'airbrake' -# Search -gem 'thinking-sphinx' +# Profiling +# ========= +gem 'rack-google-analytics' -# Spellchecking -gem 'ffi-aspell' +# Application settings +# ==================== +gem 'settingslogic' -# Reports -gem 'prawn_rails' -gem 'prawn' -gem 'prawn-table' +group :development do + # Generators + gem 'haml-rails' -# CRUD helpers -gem 'show_for' + # Debugging + gem 'better_errors' + gem 'binding_of_caller' # Needed by binding_of_caller to enable html console -# WYSIWYG Editor -gem 'ckeditor' - -# Change log for model data -gem 'paper_trail' + # Deployment + gem 'capistrano', '~> 3.2.0' + gem 'capistrano-rails' + gem 'capistrano-bundler' + gem 'capistrano-rbenv' + #gem 'capones_recipes' +end -gem 'revertible_paper_trail' +group :development, :test do + # (Pre-)loading + gem 'spring' + gem 'spring-commands-rspec' -# Generate excel files -gem 'spreadsheet' + # Testing Framework + gem 'rspec-rails' -# Load html content -gem 'mechanize' + # Matchers/Helpers + gem 'shoulda' -# Date handling -gem 'holidays' + # QA + gem 'simplecov', require: false + gem 'rubocop', require: false -# Monitoring -# ========== -gem 'settingslogic' -group :staging, :production do - # Traffic - gem 'rack-google-analytics' + # Debugger + gem 'pry-rails' + gem 'pry-byebug' - # Exceptions - gem 'airbrake' + # Fixtures + gem 'factory_girl_rails' end diff --git a/Gemfile.lock b/Gemfile.lock index 58b2f4be..fc650016 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,79 +5,70 @@ GIT i18n_rails_helpers (2.0.0.beta1) rails (> 3.0.0) -GIT - remote: https://github.com/huerlisi/will_paginate.git - revision: dca0b70fbaa44c4dffd2631a229ed304ef7f8d40 - branch: show_always - specs: - will_paginate (3.0.3) - GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - actionmailer (3.2.21) - actionpack (= 3.2.21) - mail (~> 2.5.4) - actionpack (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) - builder (~> 3.0.0) + actionmailer (4.1.6) + actionpack (= 4.1.6) + actionview (= 4.1.6) + mail (~> 2.5, >= 2.5.4) + actionpack (4.1.6) + actionview (= 4.1.6) + activesupport (= 4.1.6) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + actionview (4.1.6) + activesupport (= 4.1.6) + builder (~> 3.1) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.21) - activesupport (= 3.2.21) - builder (~> 3.0.0) - activerecord (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) - activesupport (3.2.21) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) + activemodel (4.1.6) + activesupport (= 4.1.6) + builder (~> 3.1) + activerecord (4.1.6) + activemodel (= 4.1.6) + activesupport (= 4.1.6) + arel (~> 5.0.0) + activesupport (4.1.6) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) acts-as-taggable-on (3.4.2) activerecord (>= 3.2, < 5) airbrake (4.1.0) builder multi_json - arel (3.0.3) + arel (5.0.1.20140414130214) ast (2.0.0) astrolabe (1.3.0) parser (>= 2.2.0.pre.3, < 3.0) bcrypt (3.1.9) - builder (3.0.4) + better_errors (2.0.0) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.2) byebug (3.5.1) columnize (~> 0.8) debugger-linecache (~> 1.2) slop (~> 3.6) - cancan (1.6.10) - cap-recipes (0.3.39) - capistrano (2.15.5) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capistrano-ext (1.2.1) - capistrano (>= 1.0.0) - capistrano-platform-resources (0.1.3) - capistrano (< 3) - capistrano-rbenv (1.0.5) - capistrano (< 3) - capistrano-platform-resources (>= 0.1.3) - capistrano_colors (0.5.5) - capones_recipes (1.20.1) - cap-recipes - capistrano (~> 2.0) - capistrano-ext - capistrano_colors + cancancan (1.9.2) + capistrano (3.2.1) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-bundler (1.1.3) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.2) + capistrano (~> 3.1) + capistrano-bundler (~> 1.1) + capistrano-rbenv (2.0.2) + capistrano (~> 3.1) + sshkit (~> 1.3) chunky_png (1.3.3) ckeditor (4.1.1) cocaine @@ -87,29 +78,22 @@ GEM cocaine (0.5.7) climate_control (>= 0.0.3, < 1.0) coderay (1.1.0) - coffee-rails (3.2.2) + coffee-rails (4.0.1) coffee-script (>= 2.2.0) - railties (~> 3.2.0) + railties (>= 4.0.0, < 5.0) coffee-script (2.3.0) coffee-script-source execjs coffee-script-source (1.8.0) + colorize (0.7.3) columnize (0.8.9) - compass (1.0.1) + compass (0.12.7) chunky_png (~> 1.2) - compass-core (~> 1.0.1) - compass-import-once (~> 1.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - sass (>= 3.3.13, < 3.5) - compass-core (1.0.1) - multi_json (~> 1.0) - sass (>= 3.3.0, < 3.5) - compass-import-once (1.0.5) - sass (>= 3.2, < 3.5) - compass-rails (2.0.1) - compass (~> 1.0.0) - database_cleaner (1.3.0) + fssm (>= 0.2.7) + sass (~> 3.2.19) + compass-rails (2.0.0) + compass (>= 0.12.2) + debug_inspector (0.0.2) debugger-linecache (1.2.0) devise (3.4.1) bcrypt (~> 3.0) @@ -119,6 +103,7 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.5) + docile (1.1.5) domain_name (0.5.22) unf (>= 0.0.5, < 1.0.0) erubis (2.7.0) @@ -133,27 +118,33 @@ GEM ffi formtastic (3.1.2) actionpack (>= 3.2.13) + fssm (0.2.10) haml (4.0.5) tilt - haml-rails (0.4) - actionpack (>= 3.1, < 4.1) - activesupport (>= 3.1, < 4.1) - haml (>= 3.1, < 4.1) - railties (>= 3.1, < 4.1) - has_scope (0.5.1) - highline (1.6.21) + haml-rails (0.5.3) + actionpack (>= 4.0.1) + activesupport (>= 4.0.1) + haml (>= 3.1, < 5.0) + railties (>= 4.0.1) + has_scope (0.6.0.rc) + actionpack (>= 3.2, < 5) + activesupport (>= 3.2, < 5) hike (1.2.3) holidays (1.2.0) http-cookie (1.0.2) domain_name (~> 0.5) i18n (0.6.11) - inherited_resources (1.4.0) - has_scope (~> 0.5.0) - responders (~> 0.9) + inherited_resources (1.5.1) + actionpack (>= 3.2, < 4.2) + has_scope (~> 0.6.0.rc) + railties (>= 3.2, < 4.2) + responders (~> 1.0) innertube (1.1.0) - joiner (0.2.0) - activerecord (>= 3.1.0, < 4.1.0) - journey (1.0.4) + jbuilder (2.2.5) + activesupport (>= 3.0.0, < 5) + multi_json (~> 1.2) + joiner (0.3.4) + activerecord (>= 4.1.0) jquery-rails (3.1.2) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) @@ -162,13 +153,12 @@ GEM json (1.8.1) kgio (2.9.2) libv8 (3.16.14.7) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mechanize (2.7.2) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mechanize (2.7.3) domain_name (~> 0.5, >= 0.5.1) - http-cookie (~> 1.0.0) - mime-types (~> 1.17, >= 1.17.2) + http-cookie (~> 1.0) + mime-types (~> 2.0) net-http-digest_auth (~> 1.1, >= 1.1.1) net-http-persistent (~> 2.5, >= 2.5.2) nokogiri (~> 1.4) @@ -176,31 +166,27 @@ GEM webrobots (>= 0.0.9, < 0.2) method_source (0.8.2) middleware (0.1.0) - mime-types (1.25.1) + mime-types (2.4.3) mini_portile (0.6.1) + minitest (5.4.3) multi_json (1.10.1) mysql2 (0.3.17) net-http-digest_auth (1.4) net-http-persistent (2.9.4) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) net-ssh (2.9.1) - net-ssh-gateway (1.2.0) - net-ssh (>= 2.6.5) nokogiri (1.6.4.1) mini_portile (~> 0.6.0) ntlm-http (0.1.1) orm_adapter (0.5.0) - paper_trail (2.7.2) - activerecord (~> 3.0) - railties (~> 3.0) + paper_trail (3.0.6) + activerecord (>= 3.0, < 5.0) + activesupport (>= 3.0, < 5.0) parser (2.2.0.pre.8) ast (>= 1.1, < 3.0) slop (~> 3.4, >= 3.4.5) pdf-core (0.4.0) - polyglot (0.3.5) powerpack (0.0.9) prawn (1.3.0) pdf-core (~> 0.4.0) @@ -220,46 +206,35 @@ GEM pry (>= 0.9.10) quiet_assets (1.0.3) railties (>= 3.1, < 5.0) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) + rack (1.5.2) rack-google-analytics (1.2.0) actionpack activesupport - rack-ssl (1.3.4) - rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.21) - actionmailer (= 3.2.21) - actionpack (= 3.2.21) - activerecord (= 3.2.21) - activeresource (= 3.2.21) - activesupport (= 3.2.21) - bundler (~> 1.0) - railties (= 3.2.21) - railties (3.2.21) - actionpack (= 3.2.21) - activesupport (= 3.2.21) - rack-ssl (~> 1.3.2) + rails (4.1.6) + actionmailer (= 4.1.6) + actionpack (= 4.1.6) + actionview (= 4.1.6) + activemodel (= 4.1.6) + activerecord (= 4.1.6) + activesupport (= 4.1.6) + bundler (>= 1.3.0, < 2.0) + railties (= 4.1.6) + sprockets-rails (~> 2.0) + railties (4.1.6) + actionpack (= 4.1.6) + activesupport (= 4.1.6) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (>= 0.18.1, < 2.0) rainbow (2.0.0) raindrops (0.13.0) - rake (10.4.0) - rb-fsevent (0.9.4) - rb-inotify (0.9.5) - ffi (>= 0.5.0) - rdoc (3.12.2) + rake (10.3.2) + rdoc (4.1.2) json (~> 1.4) ref (1.0.5) - responders (0.9.3) - railties (~> 3.1) - revertible_paper_trail (0.3.3) - paper_trail (~> 2.2) - paper_trail (~> 2.2) - rails (~> 3.0) + responders (1.1.2) + railties (>= 3.2, < 4.2) riddle (1.5.11) rspec-core (3.1.7) rspec-support (~> 3.1.0) @@ -285,11 +260,15 @@ GEM ruby-progressbar (~> 1.4) ruby-ole (1.2.11.7) ruby-progressbar (1.7.0) - sass (3.4.9) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) + sass (3.2.19) + sass-rails (4.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 2.12) + sprockets-rails (~> 2.0) + sdoc (0.4.1) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) settingslogic (2.0.9) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) @@ -302,14 +281,30 @@ GEM activemodel (>= 3.2, < 5) simple-navigation (3.13.0) activesupport (>= 2.3.2) + simplecov (0.9.1) + docile (~> 1.1.0) + multi_json (~> 1.0) + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) slop (3.6.0) spreadsheet (1.0.0) ruby-ole (>= 1.0) - sprockets (2.2.3) + spring (1.2.0) + spring-commands-rspec (1.0.2) + spring (>= 0.9.1) + sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + sprockets-rails (2.2.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) + sshkit (1.5.1) + colorize + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref @@ -323,11 +318,9 @@ GEM thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) ttfunk (1.4.0) - tzinfo (0.3.42) + tzinfo (1.2.2) + thread_safe (~> 0.1) uglifier (2.5.3) execjs (>= 0.3.0) json (>= 1.8.0) @@ -338,9 +331,13 @@ GEM kgio (~> 2.6) rack raindrops (~> 0.7) + unicorn-rails (2.2.0) + rack + unicorn warden (1.2.3) rack (>= 1.0) webrobots (0.1.1) + will_paginate (3.0.7) PLATFORMS ruby @@ -348,14 +345,16 @@ PLATFORMS DEPENDENCIES acts-as-taggable-on airbrake - cancan - capistrano (~> 2.15.5) - capistrano-rbenv (~> 1.0) - capones_recipes + better_errors + binding_of_caller + cancancan + capistrano (~> 3.2.0) + capistrano-bundler + capistrano-rails + capistrano-rbenv ckeditor coffee-rails compass-rails - database_cleaner devise factory_girl_rails ffi-aspell @@ -364,7 +363,8 @@ DEPENDENCIES has_scope holidays i18n_rails_helpers! - inherited_resources + inherited_resources (~> 1.5.0) + jbuilder jquery-rails jquery-ui-rails mechanize @@ -379,18 +379,20 @@ DEPENDENCIES quiet_assets rack-google-analytics rails - rdoc - revertible_paper_trail rspec-rails rubocop sass-rails + sdoc settingslogic shoulda show_for simple-navigation + simplecov spreadsheet + spring + spring-commands-rspec therubyracer thinking-sphinx uglifier - unicorn - will_paginate! + unicorn-rails + will_paginate diff --git a/Rakefile b/Rakefile index 0943b5bc..ba6b733d 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,4 @@ require File.expand_path('../config/application', __FILE__) -require 'rake' -require 'rdoc/task' if Rails.env.development? - -Katalog::Application.load_tasks +Rails.application.load_tasks diff --git a/lib/tasks/.gitkeep b/app/controllers/concerns/.keep similarity index 100% rename from lib/tasks/.gitkeep rename to app/controllers/concerns/.keep diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 00000000..e69de29b diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 00000000..66e9889e --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 00000000..7feb6a30 --- /dev/null +++ b/bin/rails @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000..8017a027 --- /dev/null +++ b/bin/rake @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/spring b/bin/spring new file mode 100755 index 00000000..7f24d96f --- /dev/null +++ b/bin/spring @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast +# It gets overwritten when you run the `spring binstub` command + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) + ENV["GEM_HOME"] = "" + Gem.paths = ENV + + gem "spring", match[1] + require "spring/binstub" + end +end diff --git a/config.ru b/config.ru index 7f611e3d..5bc2a619 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run Katalog::Application +run Rails.application diff --git a/config/application.rb b/config/application.rb index 2937d6ad..3acab823 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,15 +1,17 @@ -# encoding: UTF-8 - require File.expand_path('../boot', __FILE__) -require 'rails/all' +# Pick the frameworks you want: +require "active_model/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(assets: %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) module Katalog class Application < Rails::Application @@ -17,50 +19,13 @@ class Application < Rails::Application # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # Add additional load paths for your own custom dirs - config.autoload_paths += ["#{config.root}/lib", "#{config.root}/app/models/ckeditor", "#{config.root}/app/prawn"] - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - - # Activate observers that should always be running - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. config.time_zone = 'Bern' - config.i18n.enforce_available_locales = true - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - config.i18n.fallbacks = [:'de-CH', :de] + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] config.i18n.default_locale = 'de-CH' - - # Configure generators values. Many other options are available, be sure to check the documentation. - # config.generators do |g| - # g.orm :active_record - # g.template_engine :erb - # g.test_framework :test_unit, :fixture => true - # end - - # Configure the default encoding used in templates for Ruby 1.9. - config.encoding = 'utf-8' - - # Configure sensitive parameters which will be filtered from the log file. - config.filter_parameters += [:password] - - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.1' - - # List of assets to precompile - config.assets.precompile += %w( ie6.css katalog_internal.css print.css) - config.assets.precompile += Ckeditor.assets - - # Allow target in links, used in description - config.action_view.sanitized_allowed_attributes = ['target'] + config.i18n.fallbacks = [:'de-CH', :de] end end diff --git a/config/boot.rb b/config/boot.rb index f3d8a22e..5e5f0c1f 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,15 +1,4 @@ -# encoding: UTF-8 - -require 'rubygems' - # Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts 'Try running `bundle install`.' - exit! -end if File.exist?(gemfile) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 00000000..6d11a861 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,54 @@ +# MySQL. Versions 5.0+ are recommended. +# +# Install the MYSQL driver +# gem install mysql2 +# +# Ensure the MySQL gem is defined in your Gemfile +# gem 'mysql2' +# +# And be sure to use new-style password hashing: +# http://dev.mysql.com/doc/refman/5.0/en/old-client.html +# +default: &default + adapter: mysql2 + encoding: utf8 + pool: 5 + username: root + password: + socket: /tmp/mysql.sock + +development: + <<: *default + database: katalog_development + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: katalog_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: katalog_production + username: katalog + password: <%= ENV['KATALOG_DATABASE_PASSWORD'] %> diff --git a/config/database.yml.example b/config/database.yml.example deleted file mode 100644 index 76153020..00000000 --- a/config/database.yml.example +++ /dev/null @@ -1,41 +0,0 @@ -# Database configuration -# ====================== -# This file can be use as a template for the database.yml file. -# -# We're currently not supporting SQLite as we're using Sphinx for -# freetext search. -# -# You need to setup the databases and adapt this file: -# -# 1. create the database and grant access -# 2. update host, username and password settings in the 'Common -# settings' section - -# Common settings -# =============== -# MySQL -mysql: &mysql - adapter: mysql2 - encoding: utf8 - pool: 5 - timeout: 5000 - host: localhost - -# Environments -# ============ -development: - <<: *mysql - database: katalog_development - username: katalog - password: - -test: - <<: *mysql - database: katalog_test - username: root - -production: - <<: *mysql - database: katalog_production - username: katalog - password: diff --git a/config/deploy/database.yml.erb b/config/deploy/database.yml.erb deleted file mode 100644 index 78cc192d..00000000 --- a/config/deploy/database.yml.erb +++ /dev/null @@ -1,33 +0,0 @@ -# Database configuration -# ====================== -# This file can be use as a template for the database.yml file. -# -# If you're using the SQLite3 file-based database, all you have -# to do is copy this file to database.yml. -# -# While you may use the SQLite3 database, it has some issues -# with date handling. It's sometimes giving strange amounts -# in account views for opening balance etc. -# -# For production environments MySQL is a better fit. In this -# case you need to setup the databases and adapt this file: -# -# 1. create the database and grant access -# 3. set username and password and possibly host settings in -# the environment config. - -# Common settings -# =============== -# MySQL -mysql: &mysql - adapter: mysql2 - encoding: utf8 - -# Environments -# ============ -<%= rails_env %>: - <<: *mysql - host: '<%= db_host %>' - database: '<%= db_database %>' - username: '<%= db_username %>' - password: '<%= db_password %>' diff --git a/config/environment.rb b/config/environment.rb index 74ada250..ee8d90dc 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,5 @@ -# encoding: UTF-8 - -# Load the rails application +# Load the Rails application. require File.expand_path('../application', __FILE__) -# Initialize the rails application -Katalog::Application.initialize! +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 966783f3..ddf0e90c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,43 +1,37 @@ -# encoding: UTF-8 - -Katalog::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the webserver when you make code changes. + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + # Do not eager load code on boot. + config.eager_load = false - # Show full error reports and disable caching + # Show full error reports and disable caching. config.consider_all_requests_local = true - config.action_controller.perform_caching = true + config.action_controller.perform_caching = false - # Don't care if the mailer can't send + # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false - # Print deprecation notices to the Rails logger + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin - - # Do not compress assets - config.assets.compress = false + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load - # Expands the lines which load the assets + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. config.assets.debug = true - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true - # Mail configuration - config.action_mailer.default_url_options = { host: 'localhost:3000' } - config.action_mailer.delivery_method = :sendmail + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/fallback.rb b/config/environments/fallback.rb deleted file mode 100644 index c9e9ffda..00000000 --- a/config/environments/fallback.rb +++ /dev/null @@ -1,67 +0,0 @@ -# encoding: UTF-8 - -Katalog::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The production environment is meant for finished, "live" apps. - # Code is not reloaded between requests - config.cache_classes = true - - # Full error reports are disabled and caching is turned on - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false - - # Compress JavaScripts and CSS - config.assets.compress = true - - # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false - - # Generate digests for assets URLs - config.assets.digest = true - - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH - - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # See everything in the log (default is :info) - # config.log_level = :debug - - # Use a different logger for distributed setups - # config.logger = SyslogLogger.new - - # Use a different cache store in production - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and javascripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - - # Disable delivery errors, bad email addresses will be ignored - # config.action_mailer.raise_delivery_errors = false - - # Enable threaded mode - # config.threadsafe! - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners - config.active_support.deprecation = :notify - - # Mail configuration - config.action_mailer.default_url_options = { host: 'katalog.doku-zug.ch' } - config.action_mailer.delivery_method = :sendmail -end diff --git a/config/environments/production.rb b/config/environments/production.rb index c9e9ffda..40c6589c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,67 +1,82 @@ -# encoding: UTF-8 +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. -Katalog::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The production environment is meant for finished, "live" apps. - # Code is not reloaded between requests + # Code is not reloaded between requests. config.cache_classes = true - # Full error reports are disabled and caching is turned on + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Disable Rails's static asset server (Apache or nginx will already do this) + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable Rails's static asset server (Apache or nginx will already do this). config.serve_static_assets = false - # Compress JavaScripts and CSS - config.assets.compress = true + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass - # Don't fallback to assets pipeline if a precompiled asset is missed + # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false - # Generate digests for assets URLs + # Generate digests for assets URLs. config.assets.digest = true - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # See everything in the log (default is :info) - # config.log_level = :debug + # Set to :debug to see everything in the log. + config.log_level = :info + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] - # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - # Use a different cache store in production + # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Enable serving of images, stylesheets, and javascripts from an asset server + # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) + # Mail configuration + config.action_mailer.default_url_options = { host: 'katalog.doku-zug.ch' } + config.action_mailer.delivery_method = :sendmail - # Disable delivery errors, bad email addresses will be ignored + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false - # Enable threaded mode - # config.threadsafe! - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) + # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners + # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify - # Mail configuration - config.action_mailer.default_url_options = { host: 'katalog.doku-zug.ch' } - config.action_mailer.delivery_method = :sendmail + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/staging.rb b/config/environments/staging.rb deleted file mode 100644 index da5d8c0d..00000000 --- a/config/environments/staging.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -Katalog::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # Code is not reloaded between requests - config.cache_classes = true - - # Full error reports are disabled and caching is turned on - config.action_controller.perform_caching = true - - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false - - # Compress JavaScripts and CSS - config.assets.compress = true - - # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false - - # Generate digests for assets URLs - config.assets.digest = true - - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH - - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # See everything in the log (default is :info) - # config.log_level = :debug - - # Use a different logger for distributed setups - # config.logger = SyslogLogger.new - - # Use a different cache store in production - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and javascripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - - # Disable delivery errors, bad email addresses will be ignored - # config.action_mailer.raise_delivery_errors = false - - # Enable threaded mode - # config.threadsafe! - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners - config.active_support.deprecation = :notify -end diff --git a/config/environments/test.rb b/config/environments/test.rb index bea25502..053f5b66 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,40 +1,39 @@ -# encoding: UTF-8 - -Katalog::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that + # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! + # and recreated between test runs. Don't rely on the data there! config.cache_classes = true - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static asset server for tests with Cache-Control for performance. + config.serve_static_assets = true + config.static_cache_control = 'public, max-age=3600' - # Show full error reports and disable caching + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - # Raise exceptions instead of rendering exception templates + # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 00000000..21912428 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,9 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +Rails.application.config.assets.precompile += %w( ie6.css katalog_internal.css print.css ) +Rails.application.config.assets.precompile += Ckeditor.assets diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index b0ae6ea4..59385cdf 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,5 +1,3 @@ -# encoding: UTF-8 - # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 00000000..7a06a89f --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index dadc3205..185d6f32 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -1,72 +1,160 @@ -# encoding: UTF-8 - -# Use this hook to configure devise mailer, warden hooks and so forth. The first -# four configuration values can also be set straight in your models. +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. Devise.setup do |config| + # The secret key used by Devise. Devise uses this key to generate + # random tokens. Changing this key will render invalid all existing + # confirmation, reset password and unlock tokens in the database. + config.secret_key = 'b1c990981d991f801849fbdf90dcbd4e658442ab475f836e170fa870eb00ca6ba3cdc54ef968711984bf5ff109408ff49060091574893788e7addc773391f889' + # ==> Mailer Configuration - # Configure the e-mail address which will be shown in DeviseMailer. + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class + # with default "from" parameter. config.mailer_sender = Settings.mail.sender + config.mailer_sender = Settings.mail.reservation.sender # Configure the class responsible to send e-mails. - # config.mailer = "Devise::Mailer" + # config.mailer = 'Devise::Mailer' # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default), :mongoid - # (bson_ext recommended) and :data_mapper (experimental). + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. require 'devise/orm/active_record' # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating an user. By default is + # Configure which keys are used when authenticating a user. The default is # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating an user, both parameters are required. Remember that those + # authenticating a user, both parameters are required. Remember that those # parameters are used only when authenticating and not when retrieving from # session. If you need permissions, you should implement that in a before filter. - # config.authentication_keys = [ :email ] + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. config.authentication_keys = [:login] + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [ :email ] + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. # config.params_authenticatable = true - # Tell if authentication through HTTP Basic Auth is enabled. True by default. - # config.http_authenticatable = true + # Tell if authentication through HTTP Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:database]` will + # enable it only for database authentication. The supported strategies are: + # :database = Support basic authentication with authentication key + password + # config.http_authenticatable = false + + # If 401 status code should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true - # The realm used in Http Basic Authentication + # The realm used in Http Basic Authentication. 'Application' by default. config.http_authentication_realm = 'doku-zug.ch Katalog' + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # particular strategies by setting this option. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing skip: :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # By default, Devise cleans up the CSRF token on authentication to + # avoid CSRF token fixation attacks. This means that, when using AJAX + # requests for sign in and sign up, you need to get a new CSRF token + # from the server. You can disable this option at your own risk. + # config.clean_up_csrf_token_on_authentication = true + # ==> Configuration for :database_authenticatable # For bcrypt, this is the cost for hashing the password and defaults to 10. If # using other encryptors, it sets how many times you want the password re-encrypted. - config.stretches = 10 + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. Note that, for bcrypt (the default + # encryptor), the cost increases exponentially with the number of stretches (e.g. + # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). + config.stretches = Rails.env.test? ? 1 : 10 # Setup a pepper to generate the encrypted password. config.pepper = '8a70a9054cc3496f8dc038f60442b91935c57ed4b62018f835649dc156313da65cb01d27cccabf4ec39183df55d44f2cc067ad993964873b123c68299707d5ac' - config.secret_key = 'b1c990981d991f801849fbdf90dcbd4e658442ab475f836e170fa870eb00ca6ba3cdc54ef968711984bf5ff109408ff49060091574893788e7addc773391f889' - # ==> Configuration for :confirmable - # The time you want to give your user to confirm his account. During this time - # he will be able to access your application without confirming. Default is nil. - # When confirm_within is zero, the user won't be able to sign in without confirming. - # You can use this to let your user access some features of your application - # without confirming the account, but blocking it after a certain period - # (ie 2 days). - # config.confirm_within = 2.days + # A period that the user is allowed to access the website even without + # confirming their account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming their account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming their account. + # config.allow_unconfirmed_access_for = 2.days + + # A period that the user is allowed to confirm their account before their + # token becomes invalid. For example, if set to 3.days, the user can confirm + # their account within 3 days after the mail was sent, but on the fourth day + # their account can't be confirmed with the token any more. + # Default is nil, meaning there is no restriction on how long a user can take + # before confirming their account. + # config.confirm_within = 3.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed, new email is stored in + # unconfirmed_email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [ :email ] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. # config.remember_for = 2.weeks + # Invalidates all the remember me tokens when the user signs out. + config.expire_all_remember_me_on_sign_out = true + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # secure: true in order to force SSL only cookies. + # config.rememberable_options = {} + # ==> Configuration for :validatable - # Range for password length - # config.password_length = 6..20 + # Range for password length. + config.password_length = 8..128 - # Regex to use to validate the email address - # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i + # Email regex used to validate email formats. It simply asserts that + # one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. - # config.timeout_in = 10.minutes + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # If true, expires auth token on session timeout. + # config.expire_auth_token_on_timeout = false # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. @@ -74,6 +162,9 @@ # :none = No lock strategy. You should handle locking by yourself. # config.lock_strategy = :failed_attempts + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [ :email ] + # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email # :time = Re-enables login after a certain amount of time (see :unlock_in below) @@ -88,47 +179,82 @@ # Time interval to unlock the account if :time is enabled as unlock_strategy. # config.unlock_in = 1.hour - # ==> Configuration for :token_authenticatable - # Defines name of the authentication token params key - # config.token_authentication_key = :auth_token + # Warn on the last attempt before the account is locked. + # config.last_attempt_warning = true + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [ :email ] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper). + # + # Require the `devise-encryptable` gem when using anything other than bcrypt + # config.encryptor = :sha512 # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "sessions/users/new". It's turned off by default because it's slower if you + # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. - # config.scoped_views = true - - # By default, devise detects the role accessed based on the url. So whenever - # accessing "/users/sign_in", it knows you are accessing an User. This makes - # routes as "/sign_in" not possible, unless you tell Devise to use the default - # scope, setting true below. - # Note that devise does not generate default routes. You also have to - # specify them in config/routes.rb - # config.use_default_scope = true - - # Configure the default scope used by Devise. By default it's the first devise - # role declared in your routes. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). # config.default_scope = :user + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = true + # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like # :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. + # # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. Default is [:html] - # config.navigational_formats = [:html, :iphone] + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ['*/*', :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' # ==> Warden configuration - # If you want to use other strategies, that are not (yet) supported by Devise, - # you can configure them inside the config.warden block. The example below - # allows you to setup OAuth, using http://github.com/roman/warden_oauth + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. # # config.warden do |manager| - # manager.oauth(:twitter) do |twitter| - # twitter.consumer_secret = - # twitter.consumer_key = - # twitter.options :site => 'http://twitter.com' - # end - # manager.default_strategies(:scope => :user).unshift :twitter_oauth + # manager.intercept_401 = false + # manager.default_strategies(scope: :user).unshift :some_external_strategy # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: '/my_engine' + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using omniauth, Devise cannot automatically set Omniauth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = '/my_engine/users/auth' end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 00000000..4a994e1e --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb index 86f92f38..59b1f3e6 100644 --- a/config/initializers/formtastic.rb +++ b/config/initializers/formtastic.rb @@ -1,56 +1,108 @@ -# encoding: UTF-8 - -# Set the default text field size when input is a string. Default is 50. -# Formtastic::SemanticFormBuilder.default_text_field_size = 50 +# Set the default text field size when input is a string. Default is nil. +# Formtastic::FormBuilder.default_text_field_size = 50 # Set the default text area height when input is a text. Default is 20. -# Formtastic::SemanticFormBuilder.default_text_area_height = 5 +# Formtastic::FormBuilder.default_text_area_height = 5 + +# Set the default text area width when input is a text. Default is nil. +# Formtastic::FormBuilder.default_text_area_width = 50 # Should all fields be considered "required" by default? -# Defaults to true, see ValidationReflection notes below. +# Defaults to true. Formtastic::FormBuilder.all_fields_required_by_default = false # Should select fields have a blank option/prompt by default? # Defaults to true. -# Formtastic::SemanticFormBuilder.include_blank_for_select_by_default = true +# Formtastic::FormBuilder.include_blank_for_select_by_default = true # Set the string that will be appended to the labels/fieldsets which are required # It accepts string or procs and the default is a localized version of # '*'. In other words, if you configure formtastic.required # in your locale, it will replace the abbr title properly. But if you don't want to use # abbr tag, you can simply give a string as below -# Formtastic::SemanticFormBuilder.required_string = "(required)" +# Formtastic::FormBuilder.required_string = "(required)" # Set the string that will be appended to the labels/fieldsets which are optional # Defaults to an empty string ("") and also accepts procs (see required_string above) -# Formtastic::SemanticFormBuilder.optional_string = "(optional)" +# Formtastic::FormBuilder.optional_string = "(optional)" # Set the way inline errors will be displayed. -# Defaults to :sentence, valid options are :sentence, :list and :none -# Formtastic::SemanticFormBuilder.inline_errors = :sentence +# Defaults to :sentence, valid options are :sentence, :list, :first and :none +# Formtastic::FormBuilder.inline_errors = :sentence +# Formtastic uses the following classes as default for hints, inline_errors and error list + +# If you override the class here, please ensure to override it in your stylesheets as well +# Formtastic::FormBuilder.default_hint_class = "inline-hints" +# Formtastic::FormBuilder.default_inline_error_class = "inline-errors" +# Formtastic::FormBuilder.default_error_list_class = "errors" # Set the method to call on label text to transform or format it for human-friendly -# reading when formtastic is user without object. Defaults to :humanize. -# Formtastic::SemanticFormBuilder.label_str_method = :humanize +# reading when formtastic is used without object. Defaults to :humanize. +# Formtastic::FormBuilder.label_str_method = :humanize # Set the array of methods to try calling on parent objects in :select and :radio inputs # for the text inside each @