cornerstone 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.rspec +1 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +168 -0
- data/Guardfile +22 -0
- data/README.rdoc +4 -1
- data/Rakefile +11 -1
- data/TODO +11 -0
- data/VERSION +1 -0
- data/app/assets/images/.gitkeep +0 -0
- data/app/assets/javascripts/.gitkeep +0 -0
- data/app/assets/javascripts/cornerstone.js +11 -0
- data/app/assets/javascripts/cornerstone/discussions.js +2 -0
- data/app/assets/javascripts/cornerstone/help.js +2 -0
- data/app/assets/stylesheets/.gitkeep +0 -0
- data/app/assets/stylesheets/cornerstone.css +8 -0
- data/app/assets/stylesheets/cornerstone/discussions.css +4 -0
- data/app/assets/stylesheets/cornerstone/help.css +4 -0
- data/app/controllers/.gitkeep +0 -0
- data/app/controllers/cornerstone/admin/application_controller.rb +7 -0
- data/app/controllers/cornerstone/admin/articles_controller.rb +61 -0
- data/app/controllers/cornerstone/admin/categories_controller.rb +46 -0
- data/app/controllers/cornerstone/admin/discussions_controller.rb +32 -0
- data/app/controllers/cornerstone/application_controller.rb +6 -0
- data/app/controllers/cornerstone/discussions_controller.rb +58 -0
- data/app/controllers/cornerstone/help_controller.rb +11 -0
- data/app/controllers/cornerstone/posts_controller.rb +66 -0
- data/app/helpers/.gitkeep +0 -0
- data/app/helpers/cornerstone/application_helper.rb +5 -0
- data/app/helpers/cornerstone/discussions_helper.rb +16 -0
- data/app/helpers/cornerstone/help_helper.rb +4 -0
- data/app/mailers/cornerstone/cornerstone_mailer.rb +31 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/cornerstone/article.rb +20 -0
- data/app/models/cornerstone/category.rb +45 -0
- data/app/models/cornerstone/discussion.rb +90 -0
- data/app/models/cornerstone/post.rb +103 -0
- data/app/models/cornerstone/post_observer.rb +23 -0
- data/app/views/.gitkeep +0 -0
- data/app/views/cornerstone/admin/articles/_article.html.erb +9 -0
- data/app/views/cornerstone/admin/articles/_form.html.erb +22 -0
- data/app/views/cornerstone/admin/articles/edit.html.erb +7 -0
- data/app/views/cornerstone/admin/articles/index.html.erb +25 -0
- data/app/views/cornerstone/admin/articles/new.html.erb +6 -0
- data/app/views/cornerstone/admin/articles/show.html.erb +4 -0
- data/app/views/cornerstone/admin/categories/_category.html.erb +12 -0
- data/app/views/cornerstone/admin/categories/_form.html.erb +17 -0
- data/app/views/cornerstone/admin/categories/edit.html.erb +6 -0
- data/app/views/cornerstone/admin/categories/index.html.erb +11 -0
- data/app/views/cornerstone/admin/categories/new.html.erb +6 -0
- data/app/views/cornerstone/admin/discussions/edit.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion.html.erb +14 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion.text.erb +5 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion_user.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_post.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_post.text.erb +8 -0
- data/app/views/cornerstone/discussions/_discussion.html.erb +12 -0
- data/app/views/cornerstone/discussions/_discussion_category.html.erb +14 -0
- data/app/views/cornerstone/discussions/_form.html.erb +33 -0
- data/app/views/cornerstone/discussions/_latest_discussion.html.erb +4 -0
- data/app/views/cornerstone/discussions/categorical_index.html.erb +27 -0
- data/app/views/cornerstone/discussions/index.html.erb +25 -0
- data/app/views/cornerstone/discussions/new.html.erb +6 -0
- data/app/views/cornerstone/discussions/show.html.erb +19 -0
- data/app/views/cornerstone/help/index.html.erb +7 -0
- data/app/views/cornerstone/posts/_fields.html.erb +44 -0
- data/app/views/cornerstone/posts/_form.html.erb +19 -0
- data/app/views/cornerstone/posts/_post.html.erb +17 -0
- data/app/views/cornerstone/posts/edit.html.erb +9 -0
- data/app/views/cornerstone/shared/_errors.html.erb +11 -0
- data/app/views/cornerstone/shared/_flash_messages.html.erb +15 -0
- data/app/views/layouts/cornerstone/application.html.erb +16 -0
- data/config/cucumber.yml +8 -0
- data/config/locales/cornerstone.action_mailer.en.yml +9 -0
- data/config/routes.rb +24 -0
- data/cornerstone-0.0.1.gem +0 -0
- data/cornerstone.gemspec +33 -0
- data/db/migrate/20110723004024_create_cornerstone_discussions.rb +17 -0
- data/db/migrate/20110804190853_create_cornerstone_categories.rb +15 -0
- data/db/migrate/20110809233551_create_cornerstone_posts.rb +13 -0
- data/db/migrate/20111006172857_create_cornerstone_articles.rb +12 -0
- data/lib/cornerstone.rb +6 -0
- data/lib/cornerstone/acts_as_cornerstone_user.rb +79 -0
- data/lib/cornerstone/config.rb +33 -0
- data/lib/cornerstone/controller_additions.rb +25 -0
- data/lib/cornerstone/engine.rb +8 -1
- data/lib/cornerstone/exceptions.rb +16 -0
- data/lib/cornerstone/helpers.rb +35 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/templates/cornerstone_config.rb +31 -0
- data/script/cucumber +10 -0
- data/script/rails +7 -0
- data/spec/controllers/cornerstone/admin/articles_controller_spec.rb +250 -0
- data/spec/controllers/cornerstone/admin/categories_controller_spec.rb +205 -0
- data/spec/controllers/cornerstone/admin/discussions_controller_spec.rb +95 -0
- data/spec/controllers/cornerstone/application_controller_spec.rb +34 -0
- data/spec/controllers/cornerstone/discussions_controller_spec.rb +157 -0
- data/spec/controllers/cornerstone/help_controller_spec.rb +20 -0
- data/spec/controllers/cornerstone/posts_controller_spec.rb +212 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/javascripts/tester.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/tester.css +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/tester_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/tester_helper.rb +6 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/user.rb +23 -0
- data/spec/dummy/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/dummy/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/dummy/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/dummy/app/views/devise/registrations/new.html.erb +22 -0
- data/spec/dummy/app/views/devise/sessions/new.html.erb +19 -0
- data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
- data/spec/dummy/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/tester/index.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +42 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +28 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +31 -0
- data/spec/dummy/config/environments/production.rb +54 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cornerstone_config.rb +30 -0
- data/spec/dummy/config/initializers/devise.rb +204 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/devise.en.yml +53 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +65 -0
- data/spec/dummy/db/migrate/20110724011421_create_user.rb +11 -0
- data/spec/dummy/db/migrate/20110724194307_devise_create_users.rb +41 -0
- data/spec/dummy/db/migrate/20110804174004_add_name_to_user.rb +5 -0
- data/spec/dummy/db/schema.rb +76 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/functional/tester_controller_test.rb +9 -0
- data/spec/dummy/test/unit/helpers/tester_helper_test.rb +4 -0
- data/spec/fixtures/cornerstone/cornerstone_mailer/new_discussion +3 -0
- data/spec/lib/cornerstone/acts_as_cornerstone_user_spec.rb +56 -0
- data/spec/lib/cornerstone/helpers_spec.rb +32 -0
- data/spec/mailers/cornerstone/cornerstone_mailer_spec.rb +55 -0
- data/spec/models/cornerstone/article_spec.rb +25 -0
- data/spec/models/cornerstone/category_spec.rb +97 -0
- data/spec/models/cornerstone/discussion_spec.rb +243 -0
- data/spec/models/cornerstone/post_observer_spec.rb +65 -0
- data/spec/models/cornerstone/post_spec.rb +210 -0
- data/spec/requests/emails_spec.rb +51 -0
- data/spec/requests/interact_discussions_spec.rb +103 -0
- data/spec/requests/manage_articles_spec.rb +59 -0
- data/spec/requests/manage_categories_spec.rb +64 -0
- data/spec/requests/view_home_spec.rb +26 -0
- data/spec/spec_helper.rb +40 -0
- data/spec/support/devise.rb +4 -0
- data/spec/support/factories.rb +62 -0
- data/spec/support/general_helper_methods.rb +20 -0
- data/spec/support/mailer_macros.rb +15 -0
- data/spec/support/mass_assignment.rb +46 -0
- data/tmp/log/development.log +0 -0
- metadata +301 -20
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
File without changes
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
include Cornerstone::ActsAsCornerstoneUser
|
3
|
+
|
4
|
+
# Include default devise modules. Others available are:
|
5
|
+
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
|
6
|
+
devise :database_authenticatable, :registerable,
|
7
|
+
:recoverable, :rememberable, :trackable, :validatable
|
8
|
+
|
9
|
+
# Setup accessible (or protected) attributes for your model
|
10
|
+
attr_accessible :name, :email, :password, :password_confirmation, :remember_me
|
11
|
+
|
12
|
+
acts_as_cornerstone_user :user_name => :name, :user_email => :email,
|
13
|
+
:admin => Proc.new {self.admin?}
|
14
|
+
|
15
|
+
|
16
|
+
def self.admin?
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email %></p>
|
8
|
+
|
9
|
+
<p><%= f.submit "Resend confirmation instructions" %></p>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<p><%= f.label :password, "New password" %><br />
|
8
|
+
<%= f.password_field :password %></p>
|
9
|
+
|
10
|
+
<p><%= f.label :password_confirmation, "Confirm new password" %><br />
|
11
|
+
<%= f.password_field :password_confirmation %></p>
|
12
|
+
|
13
|
+
<p><%= f.submit "Change my password" %></p>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email %></p>
|
8
|
+
|
9
|
+
<p><%= f.submit "Send me reset password instructions" %></p>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :name %><br />
|
7
|
+
<%= f.text_field :name %>
|
8
|
+
|
9
|
+
<p><%= f.label :email %><br />
|
10
|
+
<%= f.email_field :email %></p>
|
11
|
+
|
12
|
+
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
13
|
+
<%= f.password_field :password %></p>
|
14
|
+
|
15
|
+
<p><%= f.label :password_confirmation %><br />
|
16
|
+
<%= f.password_field :password_confirmation %></p>
|
17
|
+
|
18
|
+
<p><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
19
|
+
<%= f.password_field :current_password %></p>
|
20
|
+
|
21
|
+
<p><%= f.submit "Update" %></p>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<h3>Cancel my account</h3>
|
25
|
+
|
26
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
|
27
|
+
|
28
|
+
<%= link_to "Back", :back %>
|
29
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h2>Sign up</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :name %><br />
|
7
|
+
<%= f.text_field :name %>
|
8
|
+
|
9
|
+
<p><%= f.label :email %><br />
|
10
|
+
<%= f.email_field :email %></p>
|
11
|
+
|
12
|
+
<p><%= f.label :password %><br />
|
13
|
+
<%= f.password_field :password %></p>
|
14
|
+
|
15
|
+
<p><%= f.label :password_confirmation %><br />
|
16
|
+
<%= f.password_field :password_confirmation %></p>
|
17
|
+
|
18
|
+
<p><%= f.submit "Sign up" %></p>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%= render :partial => "devise/shared/links" %>
|
22
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
4
|
+
|
5
|
+
<p><%= f.label :email %><br />
|
6
|
+
<%= f.email_field :email %></p>
|
7
|
+
|
8
|
+
<p><%= f.label :password %><br />
|
9
|
+
<%= f.password_field :password %></p>
|
10
|
+
|
11
|
+
<% if devise_mapping.rememberable? -%>
|
12
|
+
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
|
13
|
+
<% end -%>
|
14
|
+
|
15
|
+
<p><%= f.submit "Sign in" %></p>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render :partial => "devise/shared/links" %>
|
19
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email %></p>
|
8
|
+
|
9
|
+
<p><%= f.submit "Resend unlock instructions" %></p>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require
|
6
|
+
require "cornerstone"
|
7
|
+
require "devise"
|
8
|
+
|
9
|
+
module Dummy
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
34
|
+
config.encoding = "utf-8"
|
35
|
+
|
36
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
37
|
+
config.filter_parameters += [:password]
|
38
|
+
|
39
|
+
# Enable the asset pipeline
|
40
|
+
config.assets.enabled = true
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# MySQL. Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Install the MYSQL driver
|
4
|
+
# gem install mysql2
|
5
|
+
#
|
6
|
+
# Ensure the MySQL gem is defined in your Gemfile
|
7
|
+
# gem 'mysql2'
|
8
|
+
#
|
9
|
+
# And be sure to use new-style password hashing:
|
10
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
11
|
+
development:
|
12
|
+
adapter: sqlite3
|
13
|
+
encoding: utf8
|
14
|
+
database: db/dummy_development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
adapter: sqlite3
|
21
|
+
encoding: utf8
|
22
|
+
database: db/dummy_test.sqlite3
|
23
|
+
|
24
|
+
production:
|
25
|
+
adapter: sqlite3
|
26
|
+
encoding: utf8
|
27
|
+
database: db/dummy_production.sqlite3
|
28
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
|
8
|
+
# TODO: Need to turn this true otherwise relationships with cornerstone_user are lost
|
9
|
+
# after 2nd request to server - model relationships are not re-loaded
|
10
|
+
config.cache_classes = true
|
11
|
+
|
12
|
+
# Log error messages when you accidentally call methods on nil.
|
13
|
+
config.whiny_nils = true
|
14
|
+
|
15
|
+
# Show full error reports and disable caching
|
16
|
+
config.consider_all_requests_local = true
|
17
|
+
config.action_controller.perform_caching = false
|
18
|
+
|
19
|
+
# Don't care if the mailer can't send
|
20
|
+
config.action_mailer.raise_delivery_errors = false
|
21
|
+
|
22
|
+
# Print deprecation notices to the Rails logger
|
23
|
+
config.active_support.deprecation = :log
|
24
|
+
|
25
|
+
# Only use best-standards-support built into browsers
|
26
|
+
config.action_dispatch.best_standards_support = :builtin
|
27
|
+
|
28
|
+
# Do not compress assets
|
29
|
+
config.assets.compress = false
|
30
|
+
end
|
31
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Specify the default JavaScript compressor
|
18
|
+
config.assets.js_compressor = :uglifier
|
19
|
+
|
20
|
+
# Specifies the header that your server uses for sending files
|
21
|
+
# (comment out if your front-end server doesn't support this)
|
22
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
|
23
|
+
|
24
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
25
|
+
# config.force_ssl = true
|
26
|
+
|
27
|
+
# See everything in the log (default is :info)
|
28
|
+
# config.log_level = :debug
|
29
|
+
|
30
|
+
# Use a different logger for distributed setups
|
31
|
+
# config.logger = SyslogLogger.new
|
32
|
+
|
33
|
+
# Use a different cache store in production
|
34
|
+
# config.cache_store = :mem_cache_store
|
35
|
+
|
36
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
37
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
38
|
+
|
39
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
40
|
+
# config.assets.precompile += %w( search.js )
|
41
|
+
|
42
|
+
# Disable delivery errors, bad email addresses will be ignored
|
43
|
+
# config.action_mailer.raise_delivery_errors = false
|
44
|
+
|
45
|
+
# Enable threaded mode
|
46
|
+
# config.threadsafe!
|
47
|
+
|
48
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
49
|
+
# the I18n.default_locale when a translation can not be found)
|
50
|
+
config.i18n.fallbacks = true
|
51
|
+
|
52
|
+
# Send deprecation notices to registered listeners
|
53
|
+
config.active_support.deprecation = :notify
|
54
|
+
end
|