casino 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/.gitignore +23 -0
  2. data/.powrc +4 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +48 -0
  5. data/.travis.yml +3 -0
  6. data/Gemfile +2 -0
  7. data/Gemfile.lock +129 -0
  8. data/LICENSE.txt +20 -0
  9. data/README.md +72 -0
  10. data/Rakefile +14 -0
  11. data/app/assets/images/rails.png +0 -0
  12. data/app/assets/javascripts/casino/index.js +15 -0
  13. data/app/assets/javascripts/casino/sessions.js.coffee +15 -0
  14. data/app/assets/stylesheets/casino/index.css.scss +28 -0
  15. data/app/controllers/casino/api/v1/tickets_controller.rb +48 -0
  16. data/app/controllers/casino/application_controller.rb +19 -0
  17. data/app/controllers/casino/proxy_tickets_controller.rb +9 -0
  18. data/app/controllers/casino/service_tickets_controller.rb +9 -0
  19. data/app/controllers/casino/sessions_controller.rb +23 -0
  20. data/app/helpers/application_helper.rb +2 -0
  21. data/app/helpers/casino/sessions_helper.rb +5 -0
  22. data/app/helpers/service_tickets_helper.rb +2 -0
  23. data/app/mailers/.gitkeep +0 -0
  24. data/app/models/.gitkeep +0 -0
  25. data/app/views/casino/service_tickets/validate.text.erb +2 -0
  26. data/app/views/casino/sessions/index.html.erb +43 -0
  27. data/app/views/casino/sessions/logout.html.erb +8 -0
  28. data/app/views/casino/sessions/new.html.erb +12 -0
  29. data/app/views/layouts/application.html.erb +18 -0
  30. data/casino.gemspec +29 -0
  31. data/config/.gitignore +3 -0
  32. data/config/initializers/inflections.rb +19 -0
  33. data/config/initializers/mime_types.rb +5 -0
  34. data/config/initializers/wrap_parameters.rb +9 -0
  35. data/config/initializers/yaml.rb +1 -0
  36. data/config/locales/en.yml +10 -0
  37. data/config/routes.rb +82 -0
  38. data/db/seeds.rb +7 -0
  39. data/doc/README_FOR_APP +2 -0
  40. data/lib/assets/.gitkeep +0 -0
  41. data/lib/casino.rb +6 -0
  42. data/lib/casino/engine.rb +7 -0
  43. data/lib/casino/listener.rb +25 -0
  44. data/lib/casino/listener/legacy_validator.rb +11 -0
  45. data/lib/casino/listener/login_credential_acceptor.rb +28 -0
  46. data/lib/casino/listener/login_credential_requestor.rb +16 -0
  47. data/lib/casino/listener/logout.rb +8 -0
  48. data/lib/casino/listener/proxy_ticket_provider.rb +11 -0
  49. data/lib/casino/listener/session_destroyer.rb +11 -0
  50. data/lib/casino/listener/session_overview.rb +11 -0
  51. data/lib/casino/listener/ticket_validator.rb +11 -0
  52. data/lib/casino/version.rb +3 -0
  53. data/lib/generators/casino/install_generator.rb +37 -0
  54. data/lib/generators/casino/templates/README +28 -0
  55. data/lib/generators/casino/templates/cas.yml +44 -0
  56. data/lib/generators/casino/templates/casino.css +3 -0
  57. data/lib/generators/casino/templates/casino.js +1 -0
  58. data/lib/generators/casino/templates/casino_core.rb +1 -0
  59. data/lib/generators/casino/templates/database.yml +25 -0
  60. data/lib/tasks/.gitkeep +0 -0
  61. data/lib/tasks/login_tickets.rake +7 -0
  62. data/lib/tasks/service_tickets.rake +9 -0
  63. data/log/.gitkeep +0 -0
  64. data/public/404.html +26 -0
  65. data/public/422.html +26 -0
  66. data/public/500.html +25 -0
  67. data/public/favicon.ico +0 -0
  68. data/public/robots.txt +5 -0
  69. data/script/rails +8 -0
  70. data/spec/controllers/api/v1/tickets_controller_spec.rb +100 -0
  71. data/spec/controllers/listener/legacy_validator_spec.rb +22 -0
  72. data/spec/controllers/listener/login_credential_acceptor_spec.rb +62 -0
  73. data/spec/controllers/listener/login_credential_requestor_spec.rb +39 -0
  74. data/spec/controllers/listener/logout_spec.rb +21 -0
  75. data/spec/controllers/listener/proxy_ticket_provider_spec.rb +22 -0
  76. data/spec/controllers/listener/session_destroyer_spec.rb +25 -0
  77. data/spec/controllers/listener/session_overview_spec.rb +26 -0
  78. data/spec/controllers/listener/ticket_validator_spec.rb +22 -0
  79. data/spec/controllers/proxy_tickets_controller_spec.rb +25 -0
  80. data/spec/controllers/service_tickets_controller_spec.rb +25 -0
  81. data/spec/controllers/sessions_controller_spec.rb +52 -0
  82. data/spec/dummy/Rakefile +7 -0
  83. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  84. data/spec/dummy/app/assets/stylesheets/application.css +14 -0
  85. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  86. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  87. data/spec/dummy/app/mailers/.gitkeep +0 -0
  88. data/spec/dummy/app/models/.gitkeep +0 -0
  89. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  90. data/spec/dummy/config.ru +4 -0
  91. data/spec/dummy/config/application.rb +59 -0
  92. data/spec/dummy/config/boot.rb +10 -0
  93. data/spec/dummy/config/cas.yml +29 -0
  94. data/spec/dummy/config/database.yml +25 -0
  95. data/spec/dummy/config/environment.rb +5 -0
  96. data/spec/dummy/config/environments/development.rb +37 -0
  97. data/spec/dummy/config/environments/production.rb +67 -0
  98. data/spec/dummy/config/environments/test.rb +37 -0
  99. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  100. data/spec/dummy/config/initializers/casino_core.rb +1 -0
  101. data/spec/dummy/config/initializers/inflections.rb +15 -0
  102. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  103. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  104. data/spec/dummy/config/initializers/session_store.rb +8 -0
  105. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  106. data/spec/dummy/config/locales/en.yml +5 -0
  107. data/spec/dummy/config/routes.rb +4 -0
  108. data/spec/dummy/db/.gitkeep +0 -0
  109. data/spec/dummy/lib/assets/.gitkeep +0 -0
  110. data/spec/dummy/log/.gitkeep +0 -0
  111. data/spec/dummy/public/404.html +26 -0
  112. data/spec/dummy/public/422.html +26 -0
  113. data/spec/dummy/public/500.html +25 -0
  114. data/spec/dummy/public/favicon.ico +0 -0
  115. data/spec/dummy/script/rails +6 -0
  116. data/spec/spec_helper.rb +38 -0
  117. data/spec/support/.gitkeep +0 -0
  118. data/spec/support/sign_in.rb +11 -0
  119. data/vendor/assets/javascripts/.gitkeep +0 -0
  120. data/vendor/assets/stylesheets/.gitkeep +0 -0
  121. data/vendor/plugins/.gitkeep +0 -0
  122. metadata +351 -0
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::LegacyValidator do
4
+ let(:controller) { Object.new }
5
+ let(:listener) { described_class.new(controller) }
6
+ let(:text) { "foobar\nbla\n" }
7
+ let(:render_parameters) { { text: text, content_type: 'text/plain' } }
8
+
9
+ describe '#validation_succeeded' do
10
+ it 'tells the controller to render the response text' do
11
+ controller.should_receive(:render).with(render_parameters)
12
+ listener.validation_succeeded(text)
13
+ end
14
+ end
15
+
16
+ describe '#validation_failed' do
17
+ it 'tells the controller to render the response text' do
18
+ controller.should_receive(:render).with(render_parameters)
19
+ listener.validation_failed(text)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::LoginCredentialAcceptor do
4
+ include CASino::Engine.routes.url_helpers
5
+ let(:controller) { Struct.new(:cookies).new(cookies: {}) }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ before(:each) do
9
+ controller.stub(:redirect_to)
10
+ end
11
+
12
+ describe '#user_logged_in' do
13
+ let(:ticket_granting_ticket) { 'TGT-123' }
14
+ context 'with a service url' do
15
+ let(:url) { 'http://www.example.com/?ticket=ST-123' }
16
+ it 'tells the controller to redirect the client' do
17
+ controller.should_receive(:redirect_to).with(url, status: :see_other)
18
+ listener.user_logged_in(url, ticket_granting_ticket)
19
+ end
20
+ end
21
+
22
+ context 'without a service url' do
23
+ let(:url) { nil }
24
+ it 'tells the controller to redirect to the session overview' do
25
+ controller.should_receive(:redirect_to).with(sessions_path, status: :see_other)
26
+ listener.user_logged_in(url, ticket_granting_ticket)
27
+ end
28
+
29
+ it 'creates the tgt cookie' do
30
+ listener.user_logged_in(url, ticket_granting_ticket)
31
+ controller.cookies[:tgt].should == ticket_granting_ticket
32
+ end
33
+ end
34
+ end
35
+
36
+ [:invalid_login_credentials, :invalid_login_ticket].each do |method|
37
+ context "##{method}" do
38
+ let(:login_ticket) { Object.new }
39
+ let(:flash) { ActionDispatch::Flash::FlashHash.new }
40
+
41
+ before(:each) do
42
+ controller.stub(:render)
43
+ controller.stub(:flash).and_return(flash)
44
+ end
45
+
46
+ it 'tells the controller to render the new template' do
47
+ controller.should_receive(:render).with('new', status: 403)
48
+ listener.send(method, login_ticket)
49
+ end
50
+
51
+ it 'assigns a new login ticket' do
52
+ listener.send(method, login_ticket)
53
+ controller.instance_variable_get(:@login_ticket).should == login_ticket
54
+ end
55
+
56
+ it 'should add an error message' do
57
+ listener.send(method, login_ticket)
58
+ flash[:error].should == I18n.t("login_credential_acceptor.#{method}")
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::LoginCredentialRequestor do
4
+ include CASino::Engine.routes.url_helpers
5
+ let(:controller) { Struct.new(:cookies).new(cookies: {}) }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ describe '#user_not_logged_in' do
9
+ let(:login_ticket) { Object.new }
10
+ it 'assigns the login ticket' do
11
+ listener.user_not_logged_in(login_ticket)
12
+ controller.instance_variable_get(:@login_ticket).should == login_ticket
13
+ end
14
+
15
+ it 'deletes an existing ticket-granting ticket cookie' do
16
+ controller.cookies = { tgt: 'TGT-12345' }
17
+ listener.user_not_logged_in(login_ticket)
18
+ controller.cookies[:tgt].should be_nil
19
+ end
20
+ end
21
+
22
+ describe '#user_logged_in' do
23
+ context 'with a service url' do
24
+ let(:url) { 'http://www.example.com/?ticket=ST-123' }
25
+ it 'tells the controller to redirect the client' do
26
+ controller.should_receive(:redirect_to).with(url, status: :see_other)
27
+ listener.user_logged_in(url)
28
+ end
29
+ end
30
+
31
+ context 'without a service url' do
32
+ let(:url) { nil }
33
+ it 'tells the controller to redirect to the session overview' do
34
+ controller.should_receive(:redirect_to).with(sessions_path)
35
+ listener.user_logged_in(url)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::Logout do
4
+ include Rails.application.routes.url_helpers
5
+ let(:controller) { Struct.new(:cookies).new(cookies: {}) }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ describe '#user_logged_out' do
9
+ let(:url) { 'http://www.example.com/test' }
10
+ it 'assigns the url' do
11
+ listener.user_logged_out(url)
12
+ controller.instance_variable_get(:@url).should == url
13
+ end
14
+
15
+ it 'deletes an existing ticket-granting ticket cookie' do
16
+ controller.cookies = { tgt: 'TGT-12345' }
17
+ listener.user_logged_out(url)
18
+ controller.cookies[:tgt].should be_nil
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::ProxyTicketProvider do
4
+ let(:controller) { Object.new }
5
+ let(:listener) { described_class.new(controller) }
6
+ let(:xml) { "<foo><bar>bla</bar></foo>" }
7
+ let(:render_parameters) { { xml: xml } }
8
+
9
+ describe '#request_succeeded' do
10
+ it 'tells the controller to render the response xml' do
11
+ controller.should_receive(:render).with(render_parameters)
12
+ listener.request_succeeded(xml)
13
+ end
14
+ end
15
+
16
+ describe '#request_failed' do
17
+ it 'tells the controller to render the response xml' do
18
+ controller.should_receive(:render).with(render_parameters)
19
+ listener.request_failed(xml)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::SessionDestroyer do
4
+ include CASino::Engine.routes.url_helpers
5
+ let(:controller) { Struct.new(:cookies).new(cookies: {}) }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ before(:each) do
9
+ controller.stub(:redirect_to)
10
+ end
11
+
12
+ describe '#ticket_not_found' do
13
+ it 'redirects back to the session overview' do
14
+ controller.should_receive(:redirect_to).with(sessions_path)
15
+ listener.ticket_not_found
16
+ end
17
+ end
18
+
19
+ describe '#ticket_deleted' do
20
+ it 'redirects back to the session overview' do
21
+ controller.should_receive(:redirect_to).with(sessions_path)
22
+ listener.ticket_deleted
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::SessionOverview do
4
+ include CASino::Engine.routes.url_helpers
5
+ let(:controller) { Object.new }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ describe '#user_not_logged_in' do
9
+ before(:each) do
10
+ controller.stub(:redirect_to)
11
+ end
12
+
13
+ it 'redirects to the login page' do
14
+ controller.should_receive(:redirect_to).with(login_path)
15
+ listener.user_not_logged_in
16
+ end
17
+ end
18
+
19
+ describe '#ticket_granting_tickets_found' do
20
+ let(:ticket_granting_tickets) { [ Object.new, Object.new ] }
21
+ it 'assigns the ticket-granting tickets' do
22
+ listener.ticket_granting_tickets_found(ticket_granting_tickets)
23
+ controller.instance_variable_get(:@ticket_granting_tickets).should == ticket_granting_tickets
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::TicketValidator do
4
+ let(:controller) { Object.new }
5
+ let(:listener) { described_class.new(controller) }
6
+ let(:xml) { "<foo><bar>bla</bar></foo>" }
7
+ let(:render_parameters) { { xml: xml } }
8
+
9
+ describe '#validation_succeeded' do
10
+ it 'tells the controller to render the response xml' do
11
+ controller.should_receive(:render).with(render_parameters)
12
+ listener.validation_succeeded(xml)
13
+ end
14
+ end
15
+
16
+ describe '#validation_failed' do
17
+ it 'tells the controller to render the response xml' do
18
+ controller.should_receive(:render).with(render_parameters)
19
+ listener.validation_failed(xml)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::ProxyTicketsController do
4
+ describe 'GET "serviceValidate"' do
5
+ let(:params) { { service: 'https://www.example.com/' } }
6
+ it 'calls the process method of the ProxyTicketValidator' do
7
+ CASinoCore::Processor::ProxyTicketValidator.any_instance.should_receive(:process).with(kind_of(Hash)) do |params|
8
+ params.should == controller.params
9
+ controller.render nothing: true
10
+ end
11
+ get :proxy_validate, params
12
+ end
13
+ end
14
+
15
+ describe 'GET "proxy"' do
16
+ let(:params) { { service: 'https://www.example.com/' } }
17
+ it 'calls the process method of the ProxyTicketProvider' do
18
+ CASinoCore::Processor::ProxyTicketProvider.any_instance.should_receive(:process).with(kind_of(Hash)) do |params|
19
+ params.should == controller.params
20
+ controller.render nothing: true
21
+ end
22
+ get :create, params
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::ServiceTicketsController do
4
+ describe 'GET "validate"' do
5
+ let(:params) { { service: 'https://www.example.com/' } }
6
+ it 'calls the process method of the LegacyValidator' do
7
+ CASinoCore::Processor::LegacyValidator.any_instance.should_receive(:process).with(kind_of(Hash)) do |params|
8
+ params.should == controller.params
9
+ controller.render nothing: true
10
+ end
11
+ get :validate, params
12
+ end
13
+ end
14
+
15
+ describe 'GET "serviceValidate"' do
16
+ let(:params) { { service: 'https://www.example.com/' } }
17
+ it 'calls the process method of the LegacyValidator' do
18
+ CASinoCore::Processor::ServiceTicketValidator.any_instance.should_receive(:process).with(kind_of(Hash)) do |params|
19
+ params.should == controller.params
20
+ controller.render nothing: true
21
+ end
22
+ get :service_validate, params
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::SessionsController do
4
+ describe 'GET "new"' do
5
+ it 'calls the process method of the LoginCredentialRequestor' do
6
+ CASinoCore::Processor::LoginCredentialRequestor.any_instance.should_receive(:process)
7
+ get :new
8
+ end
9
+ end
10
+
11
+ describe 'POST "create"' do
12
+ it 'calls the process method of the LoginCredentialAcceptor' do
13
+ CASinoCore::Processor::LoginCredentialAcceptor.any_instance.should_receive(:process) do
14
+ @controller.render nothing: true
15
+ end
16
+ post :create
17
+ end
18
+ end
19
+
20
+ describe 'GET "logout"' do
21
+ it 'calls the process method of the Logout processor' do
22
+ CASinoCore::Processor::Logout.any_instance.should_receive(:process) do |params, cookies, user_agent|
23
+ params.should == controller.params
24
+ cookies.should == controller.cookies
25
+ user_agent.should == request.user_agent
26
+ end
27
+ get :logout
28
+ end
29
+ end
30
+
31
+ describe 'GET "index"' do
32
+ it 'calls the process method of the SessionOverview processor' do
33
+ CASinoCore::Processor::SessionOverview.any_instance.should_receive(:process)
34
+ get :index
35
+ end
36
+ end
37
+
38
+ describe 'DELETE "destroy"' do
39
+ let(:id) { '123' }
40
+ let(:tgt) { 'TGT-foobar' }
41
+ it 'calls the process method of the SessionOverview processor' do
42
+ request.cookies[:tgt] = tgt
43
+ CASinoCore::Processor::SessionDestroyer.any_instance.should_receive(:process) do |params, cookies, user_agent|
44
+ params[:id].should == id
45
+ cookies[:tgt].should == tgt
46
+ user_agent.should == request.user_agent
47
+ @controller.render nothing: true
48
+ end
49
+ delete :destroy, id: id
50
+ end
51
+ end
52
+ end
@@ -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,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require casino
16
+ //= require_tree .
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require casino
13
+ *= require_tree .
14
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,59 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require 'casino'
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 escaping HTML in JSON.
39
+ config.active_support.escape_html_entities_in_json = true
40
+
41
+ # Use SQL instead of Active Record's schema dumper when creating the database.
42
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
43
+ # like if you have constraints or database-specific column types
44
+ # config.active_record.schema_format = :sql
45
+
46
+ # Enforce whitelist mode for mass assignment.
47
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
48
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
49
+ # parameters by using an attr_accessible or attr_protected declaration.
50
+ config.active_record.whitelist_attributes = true
51
+
52
+ # Enable the asset pipeline
53
+ config.assets.enabled = true
54
+
55
+ # Version of your assets, change this if you want to expire all your assets
56
+ config.assets.version = '1.0'
57
+ end
58
+ end
59
+