ack-mongoid-forums 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +35 -0
- data/app/assets/javascripts/mongoid_forums/admin/base.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/categories.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/forums.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/groups.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/users.js +2 -0
- data/app/assets/javascripts/mongoid_forums/application.js +15 -0
- data/app/assets/javascripts/mongoid_forums/forums.js +2 -0
- data/app/assets/javascripts/mongoid_forums/posts.js +2 -0
- data/app/assets/javascripts/mongoid_forums/topics.js +2 -0
- data/app/assets/stylesheets/mongoid_forums/admin/base.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/categories.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/forums.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/groups.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/users.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/application.css +15 -0
- data/app/assets/stylesheets/mongoid_forums/forums.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/posts.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/topics.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/mongoid_forums/admin/base_controller.rb +18 -0
- data/app/controllers/mongoid_forums/admin/categories_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/forums_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/groups_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/topics_controller.rb +48 -0
- data/app/controllers/mongoid_forums/admin/users_controller.rb +34 -0
- data/app/controllers/mongoid_forums/application_controller.rb +57 -0
- data/app/controllers/mongoid_forums/forums_controller.rb +66 -0
- data/app/controllers/mongoid_forums/posts_controller.rb +133 -0
- data/app/controllers/mongoid_forums/redirect_controller.rb +33 -0
- data/app/controllers/mongoid_forums/topics_controller.rb +83 -0
- data/app/decorators/lib/mongoid_forums/user_class_decorator.rb +1 -0
- data/app/helpers/mongoid_forums/admin/base_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/categories_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/forums_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/groups_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/users_helper.rb +4 -0
- data/app/helpers/mongoid_forums/application_helper.rb +20 -0
- data/app/helpers/mongoid_forums/formatting_helper.rb +28 -0
- data/app/helpers/mongoid_forums/forums_helper.rb +15 -0
- data/app/helpers/mongoid_forums/posts_helper.rb +4 -0
- data/app/helpers/mongoid_forums/topics_helper.rb +4 -0
- data/app/models/mongoid_forums/ability.rb +65 -0
- data/app/models/mongoid_forums/alert.rb +80 -0
- data/app/models/mongoid_forums/category.rb +31 -0
- data/app/models/mongoid_forums/concerns/subscribable.rb +76 -0
- data/app/models/mongoid_forums/concerns/viewable.rb +60 -0
- data/app/models/mongoid_forums/forum.rb +67 -0
- data/app/models/mongoid_forums/group.rb +15 -0
- data/app/models/mongoid_forums/post.rb +40 -0
- data/app/models/mongoid_forums/subscription.rb +65 -0
- data/app/models/mongoid_forums/topic.rb +55 -0
- data/app/models/mongoid_forums/view.rb +30 -0
- data/app/views/layouts/mongoid_forums/application.haml +21 -0
- data/app/views/mongoid_forums/admin/base/index.haml +6 -0
- data/app/views/mongoid_forums/admin/categories/edit.haml +4 -0
- data/app/views/mongoid_forums/admin/categories/index.haml +21 -0
- data/app/views/mongoid_forums/admin/categories/new.haml +4 -0
- data/app/views/mongoid_forums/admin/categories/show.haml +21 -0
- data/app/views/mongoid_forums/admin/forums/edit.haml +5 -0
- data/app/views/mongoid_forums/admin/forums/index.haml +25 -0
- data/app/views/mongoid_forums/admin/forums/new.haml +5 -0
- data/app/views/mongoid_forums/admin/forums/show.haml +21 -0
- data/app/views/mongoid_forums/admin/groups/edit.haml +4 -0
- data/app/views/mongoid_forums/admin/groups/index.haml +23 -0
- data/app/views/mongoid_forums/admin/groups/new.haml +5 -0
- data/app/views/mongoid_forums/admin/groups/show.haml +26 -0
- data/app/views/mongoid_forums/admin/users/index.haml +24 -0
- data/app/views/mongoid_forums/forums/index.haml +46 -0
- data/app/views/mongoid_forums/forums/new.haml +15 -0
- data/app/views/mongoid_forums/forums/show.haml +47 -0
- data/app/views/mongoid_forums/posts/_form.haml +4 -0
- data/app/views/mongoid_forums/posts/_post.haml +24 -0
- data/app/views/mongoid_forums/posts/_quoted.haml +9 -0
- data/app/views/mongoid_forums/posts/edit.haml +17 -0
- data/app/views/mongoid_forums/posts/new.haml +17 -0
- data/app/views/mongoid_forums/topics/_topic.haml +2 -0
- data/app/views/mongoid_forums/topics/my_posts.haml +6 -0
- data/app/views/mongoid_forums/topics/my_subscriptions.haml +5 -0
- data/app/views/mongoid_forums/topics/my_topics.haml +6 -0
- data/app/views/mongoid_forums/topics/show.haml +16 -0
- data/config/locales/en.yml +196 -0
- data/config/routes.rb +62 -0
- data/lib/ack_mongoid_forums.rb +1 -0
- data/lib/generators/mongoid_forums/install/templates/initializer.rb +5 -0
- data/lib/generators/mongoid_forums/install_generator.rb +90 -0
- data/lib/generators/mongoid_forums/views_generator.rb +27 -0
- data/lib/mongoid_forums.rb +53 -0
- data/lib/mongoid_forums/default_permissions.rb +63 -0
- data/lib/mongoid_forums/engine.rb +20 -0
- data/lib/mongoid_forums/sanitizer.rb +10 -0
- data/lib/mongoid_forums/version.rb +3 -0
- data/lib/tasks/mongoid_forums_tasks.rake +4 -0
- data/test/controllers/mongoid_forums/admin/base_controller_test.rb +11 -0
- data/test/controllers/mongoid_forums/admin/categories_controller_test.rb +31 -0
- data/test/controllers/mongoid_forums/admin/forums_controller_test.rb +31 -0
- data/test/controllers/mongoid_forums/admin/groups_controller_test.rb +41 -0
- data/test/controllers/mongoid_forums/admin/users_controller_test.rb +11 -0
- data/test/controllers/mongoid_forums/forums_controller_test.rb +16 -0
- data/test/controllers/mongoid_forums/posts_controller_test.rb +36 -0
- data/test/controllers/mongoid_forums/topics_controller_test.rb +36 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/welcome.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +11 -0
- data/test/dummy/app/controllers/welcome_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/welcome_helper.rb +2 -0
- data/test/dummy/app/models/concerns/zero_oid_fix.rb +10 -0
- data/test/dummy/app/models/user.rb +43 -0
- data/test/dummy/app/views/layouts/application.haml +13 -0
- data/test/dummy/app/views/partials/_nav.haml +6 -0
- data/test/dummy/app/views/welcome/index.html.erb +2 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +29 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +76 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/devise.rb +259 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/kaminari_config.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/mongoid_forums.rb +5 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/simple_form.rb +166 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/devise.en.yml +60 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/locales/simple_form.en.yml +31 -0
- data/test/dummy/config/mongoid.yml +69 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/controllers/welcome_controller_test.rb +9 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/models/user_test.rb +7 -0
- data/test/fixtures/mongoid_forums/categories.yml +11 -0
- data/test/fixtures/mongoid_forums/forums.yml +11 -0
- data/test/fixtures/mongoid_forums/posts.yml +11 -0
- data/test/fixtures/mongoid_forums/ranks.yml +11 -0
- data/test/fixtures/mongoid_forums/topics.yml +11 -0
- data/test/integration/navigation_test.rb +9 -0
- data/test/models/mongoid_forums/category_test.rb +9 -0
- data/test/models/mongoid_forums/forum_test.rb +9 -0
- data/test/models/mongoid_forums/post_test.rb +9 -0
- data/test/models/mongoid_forums/rank_test.rb +9 -0
- data/test/models/mongoid_forums/topic_test.rb +9 -0
- data/test/mongoid_forums_test.rb +7 -0
- data/test/test_helper.rb +17 -0
- metadata +442 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class TopicsControllerTest < ActionController::TestCase
|
5
|
+
test "should get show" do
|
6
|
+
get :show
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get new" do
|
11
|
+
get :new
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get create" do
|
16
|
+
get :create
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get update" do
|
21
|
+
get :update
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get edit" do
|
26
|
+
get :edit
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
test "should get destroy" do
|
31
|
+
get :destroy
|
32
|
+
assert_response :success
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
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 any plugin's vendor/assets/javascripts directory 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
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
|
3
|
+
def mongoid_forums_user
|
4
|
+
current_user
|
5
|
+
end
|
6
|
+
helper_method :mongoid_forums_user
|
7
|
+
|
8
|
+
# Prevent CSRF attacks by raising an exception.
|
9
|
+
# For APIs, you may want to use :null_session instead.
|
10
|
+
protect_from_forgery with: :exception
|
11
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class User
|
2
|
+
include Mongoid::Document
|
3
|
+
# Include default devise modules. Others available are:
|
4
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
5
|
+
devise :database_authenticatable, :registerable,
|
6
|
+
:recoverable, :rememberable, :trackable, :validatable
|
7
|
+
|
8
|
+
include ZeroOidFix
|
9
|
+
|
10
|
+
|
11
|
+
## Database authenticatable
|
12
|
+
field :email, type: String, default: ""
|
13
|
+
field :encrypted_password, type: String, default: ""
|
14
|
+
|
15
|
+
## Recoverable
|
16
|
+
field :reset_password_token, type: String
|
17
|
+
field :reset_password_sent_at, type: Time
|
18
|
+
|
19
|
+
## Rememberable
|
20
|
+
field :remember_created_at, type: Time
|
21
|
+
|
22
|
+
## Trackable
|
23
|
+
field :sign_in_count, type: Integer, default: 0
|
24
|
+
field :current_sign_in_at, type: Time
|
25
|
+
field :last_sign_in_at, type: Time
|
26
|
+
field :current_sign_in_ip, type: String
|
27
|
+
field :last_sign_in_ip, type: String
|
28
|
+
|
29
|
+
## Confirmable
|
30
|
+
# field :confirmation_token, type: String
|
31
|
+
# field :confirmed_at, type: Time
|
32
|
+
# field :confirmation_sent_at, type: Time
|
33
|
+
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
34
|
+
|
35
|
+
## Lockable
|
36
|
+
# field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
37
|
+
# field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
38
|
+
# field :locked_at, type: Time
|
39
|
+
|
40
|
+
def to_s
|
41
|
+
email
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title Dummy
|
5
|
+
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
6
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
7
|
+
= csrf_meta_tags
|
8
|
+
%body
|
9
|
+
= render "partials/nav"
|
10
|
+
- flash.each do |name, msg|
|
11
|
+
= content_tag :p, msg if msg.is_a?(String)
|
12
|
+
|
13
|
+
= yield
|
data/test/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
# require "active_record/railtie"
|
5
|
+
require "action_view/railtie"
|
6
|
+
require "sprockets/railtie"
|
7
|
+
require "action_controller/railtie"
|
8
|
+
require "action_mailer/railtie"
|
9
|
+
require "rails/test_unit/railtie"
|
10
|
+
require "sprockets/railtie" # Uncomment this line for Rails 3.1+
|
11
|
+
|
12
|
+
Bundler.require(*Rails.groups)
|
13
|
+
#require "mongoid_forums"
|
14
|
+
#require "kaminari" # TODO: Generator should do this
|
15
|
+
module Dummy
|
16
|
+
class Application < Rails::Application
|
17
|
+
# Settings in config/environments/* take precedence over those specified here.
|
18
|
+
# Application configuration should go into files in config/initializers
|
19
|
+
# -- all .rb files in that directory are automatically loaded.
|
20
|
+
|
21
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
22
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
23
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
24
|
+
|
25
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
26
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
27
|
+
# config.i18n.default_locale = :de
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
23
|
+
# This option may cause significant delays in view rendering with a large
|
24
|
+
# number of complex assets.
|
25
|
+
config.assets.debug = true
|
26
|
+
|
27
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
28
|
+
# yet still be able to expire them through the digest params.
|
29
|
+
config.assets.digest = true
|
30
|
+
|
31
|
+
# Adds additional error checking when serving assets at runtime.
|
32
|
+
# Checks for improperly declared sprockets dependencies.
|
33
|
+
# Raises helpful error messages.
|
34
|
+
config.assets.raise_runtime_errors = true
|
35
|
+
|
36
|
+
# Devise
|
37
|
+
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
38
|
+
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
41
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Rails.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
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
26
|
+
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
30
|
+
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
33
|
+
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
36
|
+
config.assets.digest = true
|
37
|
+
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
|
+
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
43
|
+
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
46
|
+
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
50
|
+
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
53
|
+
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
56
|
+
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
59
|
+
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
end
|