paid_up 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +20 -0
- data/Gemfile +5 -1
- data/Rakefile +12 -10
- data/VERSION +1 -1
- data/app/controllers/paid_up/paid_up_controller.rb +8 -3
- data/app/controllers/paid_up/plans_controller.rb +2 -1
- data/app/controllers/paid_up/subscriptions_controller.rb +19 -6
- data/app/helpers/paid_up/features_helper.rb +19 -6
- data/app/helpers/paid_up/paid_up_helper.rb +6 -3
- data/app/helpers/paid_up/plans_helper.rb +12 -5
- data/app/helpers/paid_up/subscriptions_helper.rb +10 -3
- data/app/models/paid_up/ability.rb +43 -44
- data/app/models/paid_up/plan.rb +81 -69
- data/app/models/paid_up/plan_feature_setting.rb +17 -9
- data/app/models/paid_up/unlimited.rb +15 -13
- data/app/views/devise/confirmations/new.html.haml +1 -1
- data/app/views/devise/passwords/edit.html.haml +1 -1
- data/app/views/devise/passwords/new.html.haml +1 -1
- data/app/views/devise/registrations/_new_form.html.haml +1 -1
- data/app/views/devise/registrations/new.html.haml +1 -1
- data/app/views/devise/sessions/new.html.haml +1 -1
- data/app/views/devise/unlocks/new.html.haml +1 -1
- data/app/views/layouts/mailer.html.haml +1 -1
- data/app/views/layouts/mailer.text.haml +1 -1
- data/app/views/paid_up/features/_abilities_table.html.haml +1 -1
- data/app/views/paid_up/plans/index.html.haml +1 -1
- data/app/views/paid_up/subscriptions/new.html.haml +1 -1
- data/config/initializers/stripe.rb +3 -3
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +414 -253
- data/db/migrate/20150407110101_create_paid_up_plans_table.rb +3 -3
- data/lib/generators/paid_up/install/install_generator.rb +42 -33
- data/lib/generators/paid_up/install/templates/ability.rb +1 -0
- data/lib/generators/paid_up/install/templates/initializer.rb +16 -14
- data/lib/generators/paid_up/utils.rb +11 -4
- data/lib/paid_up/configuration.rb +13 -8
- data/lib/paid_up/engine.rb +4 -3
- data/lib/paid_up/extensions/integer.rb +8 -5
- data/lib/paid_up/extensions/stripe.rb +10 -9
- data/lib/paid_up/feature.rb +27 -17
- data/lib/paid_up/localization.rb +17 -18
- data/lib/paid_up/mixins/paid_for.rb +66 -54
- data/lib/paid_up/mixins/subscriber.rb +154 -161
- data/lib/paid_up/railtie.rb +1 -1
- data/lib/paid_up/validators/rolify_rows.rb +14 -6
- data/lib/paid_up/validators/table_rows.rb +14 -6
- data/lib/paid_up/version.rb +1 -1
- data/lib/paid_up.rb +7 -8
- data/paid_up.gemspec +21 -8
- data/spec/controllers/paid_up/plans_spec.rb +6 -6
- data/spec/controllers/paid_up/subscriptions_spec.rb +68 -68
- data/spec/dummy/Rakefile +2 -1
- data/spec/dummy/app/assets/stylesheets/application.css.scss +3 -16
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/app/models/doodad.rb +1 -1
- data/spec/dummy/app/models/group.rb +1 -1
- data/spec/dummy/app/models/role.rb +4 -4
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/app/views/layouts/application.html.haml +2 -2
- data/spec/dummy/app/views/pages/index.html.haml +1 -1
- data/spec/dummy/config/application.rb +16 -12
- data/spec/dummy/config/environments/development.rb +4 -3
- data/spec/dummy/config/environments/production.rb +10 -6
- data/spec/dummy/config/environments/test.rb +3 -2
- data/spec/dummy/config/initializers/assets.rb +2 -1
- data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -2
- data/spec/dummy/config/initializers/devise.rb +58 -42
- data/spec/dummy/config/initializers/high_voltage.rb +1 -1
- data/spec/dummy/config/initializers/mime_types.rb +1 -1
- data/spec/dummy/config/initializers/paid_up.rb +16 -14
- data/spec/dummy/config/initializers/rolify.rb +3 -2
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -1
- data/spec/dummy/config/routes.rb +2 -2
- data/spec/dummy/db/migrate/20150523010827_add_devise_to_users.rb +2 -2
- data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +2 -2
- data/spec/dummy/db/migrate/20160207184112_create_paid_up_plans_table.paid_up.rb +3 -3
- data/spec/dummy/db/schema.rb +53 -53
- data/spec/dummy/db/seeds.rb +41 -56
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/tasks/system.rake +2 -2
- data/spec/factories/group.rb +1 -1
- data/spec/factories/plan.rb +1 -1
- data/spec/factories/plan_feature_setting.rb +1 -1
- data/spec/factories/user.rb +13 -11
- data/spec/models/group_spec.rb +8 -7
- data/spec/models/paid_up/feature_spec.rb +18 -4
- data/spec/models/paid_up/plan_feature_setting_spec.rb +2 -2
- data/spec/models/paid_up/plan_spec.rb +12 -8
- data/spec/models/user_spec.rb +88 -78
- data/spec/paid_up_spec.rb +1 -1
- data/spec/rails_helper.rb +5 -5
- data/spec/routing/paid_up/plans_spec.rb +3 -3
- data/spec/routing/paid_up/subscription_spec.rb +30 -7
- data/spec/spec_helper.rb +7 -52
- data/spec/support/controller_macros.rb +2 -2
- data/spec/support/factory_girl.rb +1 -1
- data/spec/support/{features.rb → loaded_site/features.rb} +2 -2
- data/spec/support/{groups.rb → loaded_site/groups.rb} +1 -1
- data/spec/support/{loaded_site.rb → loaded_site/loaded_site.rb} +1 -1
- data/spec/support/{plans.rb → loaded_site/plans.rb} +8 -4
- data/spec/support/{users.rb → loaded_site/users.rb} +1 -1
- data/spec/support/stripe.rb +10 -13
- data/spec/views/paid_up/plans_spec.rb +17 -17
- data/spec/views/paid_up/subscriptions_spec.rb +24 -14
- metadata +64 -7
@@ -1,54 +1,53 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
|
4
3
|
RSpec.describe PaidUp::SubscriptionsController do
|
5
4
|
include_context 'loaded site'
|
6
5
|
routes { PaidUp::Engine.routes }
|
7
6
|
|
8
7
|
describe 'GET #index' do
|
9
|
-
|
8
|
+
describe 'when the user is anonymous' do
|
10
9
|
before do
|
11
10
|
access_anonymous
|
12
11
|
get :index
|
13
12
|
end
|
14
|
-
|
13
|
+
describe 'redirects to the user sign up page' do
|
15
14
|
subject { response }
|
16
15
|
it { should redirect_to '/users/sign_in' }
|
17
16
|
it { should have_http_status(302) }
|
18
17
|
end
|
19
18
|
end
|
20
|
-
|
19
|
+
describe 'when the user is signed in as a subscriber' do
|
21
20
|
before do
|
22
21
|
sign_in free_subscriber
|
23
22
|
get :index
|
24
23
|
end
|
25
|
-
|
24
|
+
describe 'responds successfully with an HTTP 200 status code' do
|
26
25
|
subject { response }
|
27
26
|
it { should be_success }
|
28
27
|
it { should have_http_status(200) }
|
29
28
|
end
|
30
|
-
|
29
|
+
describe 'renders the index template' do
|
31
30
|
subject { response }
|
32
|
-
it { should render_template(
|
31
|
+
it { should render_template('index') }
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
37
|
-
describe
|
38
|
-
|
36
|
+
describe 'GET #new' do
|
37
|
+
describe 'when the user is anonymous' do
|
39
38
|
before do
|
40
39
|
access_anonymous
|
41
40
|
get :new, plan_id: professional_plan.id
|
42
41
|
end
|
43
|
-
|
42
|
+
describe 'redirects to the user sign up page' do
|
44
43
|
subject { response }
|
45
44
|
it { should redirect_to '/users/sign_in' }
|
46
45
|
it { should have_http_status(302) }
|
47
46
|
end
|
48
47
|
end
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
describe 'when the user is signed in' do
|
49
|
+
describe 'when upgrading' do
|
50
|
+
describe 'with a paid plan' do
|
52
51
|
before do
|
53
52
|
sign_in free_subscriber
|
54
53
|
get :new, plan_id: professional_plan.id
|
@@ -56,21 +55,21 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
56
55
|
after do
|
57
56
|
free_subscriber.subscribe_to_plan free_plan
|
58
57
|
end
|
59
|
-
|
58
|
+
describe 'responds successfully with an HTTP 200 status code' do
|
60
59
|
subject { response }
|
61
60
|
it { should be_success }
|
62
61
|
it { should have_http_status(200) }
|
63
62
|
end
|
64
|
-
|
63
|
+
describe 'renders the new template' do
|
65
64
|
subject { response }
|
66
|
-
it { should render_template(
|
65
|
+
it { should render_template('new') }
|
67
66
|
end
|
68
|
-
|
67
|
+
describe 'loads the requested plan into @plan' do
|
69
68
|
subject { assigns(:plan) }
|
70
69
|
it { should eq(professional_plan) }
|
71
70
|
end
|
72
71
|
end
|
73
|
-
|
72
|
+
describe 'with the free plan' do
|
74
73
|
before do
|
75
74
|
login_subscriber no_ads_subscriber
|
76
75
|
get :new, plan_id: free_plan.id
|
@@ -78,17 +77,21 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
78
77
|
after do
|
79
78
|
no_ads_subscriber.subscribe_to_plan no_ads_plan
|
80
79
|
end
|
81
|
-
|
80
|
+
describe 'redirects to the subscriptions index page' do
|
82
81
|
subject { response }
|
83
82
|
it { should redirect_to subscriptions_path }
|
84
83
|
it { should have_http_status(302) }
|
85
84
|
end
|
86
|
-
|
85
|
+
describe 'sets a flash message' do
|
87
86
|
subject { flash[:notice] }
|
88
|
-
it
|
87
|
+
it do
|
88
|
+
should(
|
89
|
+
include('You are now subscribed to the Free Plan')
|
90
|
+
)
|
91
|
+
end
|
89
92
|
end
|
90
93
|
end
|
91
|
-
|
94
|
+
describe 'when downgrading' do
|
92
95
|
before do
|
93
96
|
sign_in professional_subscriber
|
94
97
|
get :new, plan_id: no_ads_plan.id
|
@@ -96,35 +99,39 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
96
99
|
after do
|
97
100
|
professional_subscriber.subscribe_to_plan professional_plan
|
98
101
|
end
|
99
|
-
|
102
|
+
describe 'redirects to the subscriptions index page' do
|
100
103
|
subject { response }
|
101
104
|
it { should redirect_to subscriptions_path }
|
102
105
|
it { should have_http_status(302) }
|
103
106
|
end
|
104
|
-
|
107
|
+
describe 'sets a flash message' do
|
105
108
|
subject { flash[:notice] }
|
106
|
-
it
|
109
|
+
it do
|
110
|
+
should(
|
111
|
+
include('You are now subscribed to the No Ads Plan')
|
112
|
+
)
|
113
|
+
end
|
107
114
|
end
|
108
115
|
end
|
109
116
|
end
|
110
117
|
end
|
111
118
|
end
|
112
119
|
|
113
|
-
describe
|
114
|
-
|
120
|
+
describe 'POST #create' do
|
121
|
+
describe 'when the user is anonymous' do
|
115
122
|
before do
|
116
123
|
access_anonymous
|
117
124
|
get :index
|
118
125
|
end
|
119
|
-
|
126
|
+
describe 'redirects to the user sign up page' do
|
120
127
|
subject { response }
|
121
128
|
it { should redirect_to '/users/sign_in' }
|
122
129
|
it { should have_http_status(302) }
|
123
130
|
end
|
124
131
|
end
|
125
|
-
|
126
|
-
|
127
|
-
|
132
|
+
describe 'when the user is signed in' do
|
133
|
+
describe 'upgrading from the free plan' do
|
134
|
+
describe 'without a coupon code' do
|
128
135
|
before do
|
129
136
|
sign_in free_subscriber
|
130
137
|
token = working_stripe_token free_subscriber
|
@@ -133,39 +140,51 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
133
140
|
after do
|
134
141
|
free_subscriber.subscribe_to_plan free_plan
|
135
142
|
end
|
136
|
-
|
143
|
+
describe 'redirects to the subscriptions index page' do
|
137
144
|
subject { response }
|
138
145
|
it { should redirect_to subscriptions_path }
|
139
146
|
it { should have_http_status(302) }
|
140
147
|
end
|
141
|
-
|
148
|
+
describe 'sets a flash message' do
|
142
149
|
subject { flash[:notice] }
|
143
|
-
it
|
150
|
+
it do
|
151
|
+
should(
|
152
|
+
include('You are now subscribed to the Professional Plan')
|
153
|
+
)
|
154
|
+
end
|
144
155
|
end
|
145
156
|
end
|
146
|
-
|
157
|
+
describe 'with a coupon code' do
|
147
158
|
before do
|
148
159
|
sign_in free_subscriber
|
149
160
|
token = working_stripe_token free_subscriber
|
150
|
-
post
|
161
|
+
post(
|
162
|
+
:create,
|
163
|
+
plan_id: professional_plan.id,
|
164
|
+
stripeToken: token,
|
165
|
+
coupon_code: '25OFF'
|
166
|
+
)
|
151
167
|
end
|
152
168
|
after do
|
153
169
|
free_subscriber.subscribe_to_plan free_plan
|
154
170
|
end
|
155
|
-
|
171
|
+
describe 'redirects to the subscriptions index page' do
|
156
172
|
subject { response }
|
157
173
|
it { should redirect_to subscriptions_path }
|
158
174
|
it { should have_http_status(302) }
|
159
175
|
end
|
160
|
-
|
176
|
+
describe 'sets a flash message' do
|
161
177
|
subject { flash[:notice] }
|
162
|
-
it
|
178
|
+
it do
|
179
|
+
should(
|
180
|
+
include('You are now subscribed to the Professional Plan')
|
181
|
+
)
|
182
|
+
end
|
163
183
|
end
|
164
184
|
end
|
165
185
|
end
|
166
|
-
|
167
|
-
|
168
|
-
context 'without a coupon code' do
|
186
|
+
describe 'upgrading from the no ads plan' do
|
187
|
+
describe 'without a coupon code' do
|
169
188
|
before do
|
170
189
|
sign_in no_ads_subscriber
|
171
190
|
post :create, plan_id: professional_plan.id
|
@@ -173,35 +192,16 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
173
192
|
after do
|
174
193
|
no_ads_subscriber.subscribe_to_plan no_ads_plan
|
175
194
|
end
|
176
|
-
|
177
|
-
subject { response }
|
178
|
-
it { should redirect_to subscriptions_path }
|
179
|
-
it { should have_http_status(302) }
|
180
|
-
end
|
181
|
-
context "sets a flash message" do
|
182
|
-
subject { flash[:notice] }
|
183
|
-
it { should match /You are now subscribed to the #{professional_plan.title} Plan/ }
|
184
|
-
end
|
185
|
-
end
|
186
|
-
context 'with a coupon code' do
|
187
|
-
before do
|
188
|
-
sign_in no_ads_subscriber
|
189
|
-
post :create, plan_id: professional_plan.id, coupon_code: 'MINUS25'
|
190
|
-
end
|
191
|
-
after do
|
192
|
-
no_ads_subscriber.subscribe_to_plan no_ads_plan
|
193
|
-
end
|
194
|
-
context "redirects to the subscriptions index page" do
|
195
|
-
subject { response }
|
196
|
-
it { should redirect_to subscriptions_path }
|
197
|
-
it { should have_http_status(302) }
|
198
|
-
end
|
199
|
-
context "sets a flash message" do
|
195
|
+
describe 'sets a flash message' do
|
200
196
|
subject { flash[:notice] }
|
201
|
-
it
|
197
|
+
it do
|
198
|
+
should(
|
199
|
+
include('You are now subscribed to the Professional Plan')
|
200
|
+
)
|
201
|
+
end
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
205
205
|
end
|
206
206
|
end
|
207
|
-
end
|
207
|
+
end
|
data/spec/dummy/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be
|
3
|
+
# available to Rake.
|
3
4
|
|
4
5
|
require File.expand_path('../config/application', __FILE__)
|
5
6
|
|
@@ -1,16 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
-
*/
|
13
|
-
|
14
|
-
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
|
15
|
-
@import "bootstrap-sprockets";
|
16
|
-
@import "bootstrap";
|
1
|
+
// 'bootstrap-sprockets' must be imported before 'bootstrap' and 'bootstrap/variables'
|
2
|
+
@import 'bootstrap-sprockets';
|
3
|
+
@import 'bootstrap';
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class Role < ActiveRecord::Base
|
2
|
-
has_and_belongs_to_many :users, :
|
3
|
-
belongs_to :resource, :
|
2
|
+
has_and_belongs_to_many :users, join_table: :users_roles
|
3
|
+
belongs_to :resource, polymorphic: true
|
4
4
|
|
5
5
|
validates :resource_type,
|
6
|
-
:
|
7
|
-
:
|
6
|
+
inclusion: { in: Rolify.resource_types },
|
7
|
+
allow_nil: true
|
8
8
|
|
9
9
|
scopify
|
10
10
|
end
|
@@ -19,7 +19,7 @@
|
|
19
19
|
%footer
|
20
20
|
- add_widget do
|
21
21
|
.clearfix
|
22
|
-
= nav_list :
|
22
|
+
= nav_list class: 'nav-pills nav-stacked' do
|
23
23
|
= nav_item :plans.l, paid_up.plans_path
|
24
24
|
- if signed_in?
|
25
25
|
= nav_item :my_subscription.l, paid_up.subscriptions_path
|
@@ -28,4 +28,4 @@
|
|
28
28
|
= nav_item :sign_in.l, main_app.new_user_session_path
|
29
29
|
= nav_item :sign_up.l, main_app.new_user_registration_path
|
30
30
|
= render_widgets 'md', 3
|
31
|
-
= render_footer_javascript
|
31
|
+
= render_footer_javascript
|
@@ -1 +1 @@
|
|
1
|
-
= Forgery('lorem_ipsum').paragraphs(5)
|
1
|
+
= Forgery('lorem_ipsum').paragraphs(5)
|
@@ -1,27 +1,32 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
3
|
# Pick the frameworks you want:
|
4
|
-
require
|
5
|
-
require
|
6
|
-
# require
|
7
|
-
require
|
8
|
-
require
|
4
|
+
require 'active_record/railtie'
|
5
|
+
require 'action_controller/railtie'
|
6
|
+
# require 'action_mailer/railtie'
|
7
|
+
require 'action_view/railtie'
|
8
|
+
require 'sprockets/railtie'
|
9
9
|
|
10
10
|
Bundler.require(*Rails.groups)
|
11
|
-
require
|
11
|
+
require 'paid_up'
|
12
12
|
|
13
13
|
module Dummy
|
14
14
|
class Application < Rails::Application
|
15
|
-
# Settings in config/environments/* take precedence over those specified
|
15
|
+
# Settings in config/environments/* take precedence over those specified
|
16
|
+
# here.
|
16
17
|
# Application configuration should go into files in config/initializers
|
17
18
|
# -- all .rb files in that directory are automatically loaded.
|
18
19
|
|
19
|
-
# Set Time.zone default to the specified zone and make Active Record
|
20
|
-
# Run
|
20
|
+
# Set Time.zone default to the specified zone and make Active Record
|
21
|
+
# auto-convert to this zone. Run 'rake -D time' for a list of tasks for
|
22
|
+
# finding time zone names. Default is UTC.
|
21
23
|
# config.time_zone = 'Central Time (US & Canada)'
|
22
24
|
|
23
|
-
# The default locale is :en and all translations from
|
24
|
-
# config
|
25
|
+
# The default locale is :en and all translations from
|
26
|
+
# config/locales/*.rb,yml are auto loaded.
|
27
|
+
# config.i18n.load_path += Dir[
|
28
|
+
# Rails.root.join('my', 'locales', '*.{rb,yml}').to_s
|
29
|
+
# ]
|
25
30
|
# config.i18n.default_locale = :de
|
26
31
|
|
27
32
|
# Do not swallow errors in after_commit/after_rollback callbacks.
|
@@ -40,4 +45,3 @@ module Dummy
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
end
|
43
|
-
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in
|
2
|
+
# Settings specified here will take precedence over those in
|
3
|
+
# config/application.rb.
|
3
4
|
|
4
5
|
# In the development environment your application's code is reloaded on
|
5
6
|
# every request. This slows down response time but is perfect for development
|
@@ -27,8 +28,8 @@ Rails.application.configure do
|
|
27
28
|
# number of complex assets.
|
28
29
|
config.assets.debug = true
|
29
30
|
|
30
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all
|
31
|
-
# yet still be able to expire them through the digest params.
|
31
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all
|
32
|
+
# assets, yet still be able to expire them through the digest params.
|
32
33
|
config.assets.digest = true
|
33
34
|
|
34
35
|
# Adds additional error checking when serving assets at runtime.
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in
|
2
|
+
# Settings specified here will take precedence over those in
|
3
|
+
# config/application.rb.
|
3
4
|
|
4
5
|
# Code is not reloaded between requests.
|
5
6
|
config.cache_classes = true
|
@@ -31,17 +32,19 @@ Rails.application.configure do
|
|
31
32
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
33
|
config.assets.compile = false
|
33
34
|
|
34
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all
|
35
|
-
# yet still be able to expire them through the digest params.
|
35
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all
|
36
|
+
# assets, yet still be able to expire them through the digest params.
|
36
37
|
config.assets.digest = true
|
37
38
|
|
38
|
-
# `config.assets.precompile` and `config.assets.version` have moved to
|
39
|
+
# `config.assets.precompile` and `config.assets.version` have moved to
|
40
|
+
# config/initializers/assets.rb
|
39
41
|
|
40
42
|
# Specifies the header that your server uses for sending files.
|
41
43
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
44
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
43
45
|
|
44
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use
|
46
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use
|
47
|
+
# secure cookies.
|
45
48
|
# config.force_ssl = true
|
46
49
|
|
47
50
|
# Use the lowest log level to ensure availability of diagnostic information
|
@@ -61,7 +64,8 @@ Rails.application.configure do
|
|
61
64
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
65
|
|
63
66
|
# 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
|
67
|
+
# Set this to true and configure the email server for immediate delivery to
|
68
|
+
# raise delivery errors.
|
65
69
|
# config.action_mailer.raise_delivery_errors = false
|
66
70
|
|
67
71
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
@@ -1,9 +1,10 @@
|
|
1
1
|
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in
|
2
|
+
# Settings specified here will take precedence over those in
|
3
|
+
# config/application.rb.
|
3
4
|
|
4
5
|
# The test environment is used exclusively to run your application's
|
5
6
|
# test suite. You never need to work with it otherwise. Remember that
|
6
|
-
# your test database is
|
7
|
+
# your test database is 'scratch space' for the test suite and is wiped
|
7
8
|
# and recreated between test runs. Don't rely on the data there!
|
8
9
|
config.cache_classes = true
|
9
10
|
|
@@ -7,5 +7,6 @@ Rails.application.config.assets.version = '1.0'
|
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
8
8
|
|
9
9
|
# Precompile additional assets.
|
10
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are
|
11
|
+
# already added.
|
11
12
|
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish
|
4
|
+
# to see in your backtraces.
|
4
5
|
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
6
|
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that
|
7
|
+
# You can also remove all the silencers if you're trying to debug a problem that
|
8
|
+
# might stem from framework code.
|
7
9
|
# Rails.backtrace_cleaner.remove_silencers!
|