disco_app 0.15.0 → 0.16.1.pre.sidekiq.pre.6.pre.release

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/.DS_Store +0 -0
  3. data/app/clients/disco_app/graphql_client.rb +85 -0
  4. data/app/controllers/disco_app/flow/actions_controller.rb +7 -0
  5. data/app/controllers/disco_app/flow/concerns/actions_controller.rb +47 -0
  6. data/app/jobs/disco_app/flow/process_action_job.rb +11 -0
  7. data/app/jobs/disco_app/flow/process_trigger_job.rb +11 -0
  8. data/app/jobs/disco_app/shop_job.rb +8 -9
  9. data/app/models/disco_app/concerns/renders_assets.rb +1 -1
  10. data/app/models/disco_app/concerns/shop.rb +4 -5
  11. data/app/models/disco_app/flow/action.rb +7 -0
  12. data/app/models/disco_app/flow/concerns/action.rb +24 -0
  13. data/app/models/disco_app/flow/concerns/trigger.rb +24 -0
  14. data/app/models/disco_app/flow/trigger.rb +7 -0
  15. data/app/services/disco_app/flow/create_action.rb +35 -0
  16. data/app/services/disco_app/flow/create_trigger.rb +34 -0
  17. data/app/services/disco_app/flow/process_action.rb +50 -0
  18. data/app/services/disco_app/flow/process_trigger.rb +52 -0
  19. data/config/routes.rb +7 -1
  20. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +80 -80
  21. data/db/migrate/20170315062548_create_disco_app_sources.rb +2 -0
  22. data/db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb +2 -0
  23. data/db/migrate/20170327214540_create_disco_app_users.rb +2 -1
  24. data/db/migrate/20170606160751_fix_disco_app_users_index.rb +2 -0
  25. data/db/migrate/20181229100327_create_flow_actions_and_triggers.rb +32 -0
  26. data/lib/.DS_Store +0 -0
  27. data/lib/disco_app/configuration.rb +4 -0
  28. data/lib/disco_app/version.rb +1 -1
  29. data/lib/generators/disco_app/disco_app_generator.rb +24 -8
  30. data/lib/generators/disco_app/templates/config/appsignal.yml +12 -0
  31. data/lib/generators/disco_app/templates/config/cable.yml.tt +11 -0
  32. data/lib/generators/disco_app/templates/config/database.yml.tt +6 -3
  33. data/lib/generators/disco_app/templates/config/environments/staging.rb +108 -0
  34. data/lib/generators/disco_app/templates/config/newrelic.yml +3 -0
  35. data/lib/generators/disco_app/templates/controllers/home_controller.rb +1 -0
  36. data/lib/generators/disco_app/templates/initializers/session_store.rb +1 -1
  37. data/lib/generators/disco_app/templates/root/.env +3 -0
  38. data/{.github → lib/generators/disco_app/templates/root/.github}/PULL_REQUEST_TEMPLATE.md +1 -1
  39. data/lib/generators/disco_app/templates/root/.rubocop.yml +223 -158
  40. data/test/dummy/config/database.yml +3 -0
  41. data/test/dummy/config/environments/staging.rb +85 -0
  42. data/test/dummy/config/secrets.yml +3 -0
  43. data/test/dummy/db/schema.rb +39 -11
  44. data/test/dummy/log/test.log +0 -0
  45. data/test/services/disco_app/flow/create_action_test.rb +51 -0
  46. data/test/services/disco_app/flow/create_trigger_test.rb +56 -0
  47. data/test/services/disco_app/flow/process_action_test.rb +68 -0
  48. data/test/services/disco_app/flow/process_trigger_test.rb +61 -0
  49. data/test/vcr/flow_trigger_invalid_title.yml +35 -0
  50. data/test/vcr/flow_trigger_valid.yml +38 -0
  51. metadata +194 -135
  52. data/app/clients/disco_app/rollbar_client.rb +0 -53
  53. data/app/clients/disco_app/rollbar_client_error.rb +0 -2
  54. data/lib/generators/disco_app/templates/initializers/rollbar.rb +0 -23
  55. data/lib/tasks/rollbar.rake +0 -24
@@ -1,11 +1,146 @@
1
1
  AllCops:
2
2
  Exclude:
3
+ - bin/*
3
4
  - db/schema.rb
5
+ - vendor/ruby/**/*
6
+ TargetRubyVersion: 2.5
4
7
 
5
- Style/AccessorMethodName:
8
+ # Layout
9
+
10
+ Layout/AccessModifierIndentation:
11
+ Enabled: true
12
+
13
+ Layout/AlignParameters:
14
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
15
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
16
+ Enabled: true,
17
+ EnforcedStyle: with_fixed_indentation
18
+
19
+ Layout/ClassStructure:
20
+ Categories:
21
+ associations:
22
+ - belongs_to
23
+ - has_one
24
+ - has_many
25
+ attributes:
26
+ - attr_accessor
27
+ - attr_reader
28
+ - attr_writer
29
+ - attr_accessible
30
+ callbacks:
31
+ - before_validation
32
+ - after_validation
33
+ - before_save
34
+ - around_save
35
+ - before_create
36
+ - around_create
37
+ - after_create
38
+ - after_save
39
+ - after_commit
40
+ module_inclusion:
41
+ - include
42
+ - prepend
43
+ - extend
44
+ validations:
45
+ - validates
46
+ ExpectedOrder:
47
+ - module_inclusion
48
+ - constants
49
+ - attributes
50
+ - associations
51
+ - validations
52
+ - callbacks
53
+ - public_class_methods
54
+ - initializer
55
+ - public_methods
56
+ - protected_methods
57
+ - private_methods
58
+ Enabled: true
59
+
60
+ Layout/DotPosition:
61
+ Description: 'Checks the position of the dot in multi-line method calls.'
62
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
63
+ EnforcedStyle: leading
64
+
65
+ Layout/EmptyLinesAroundClassBody:
66
+ Enabled: true
67
+ EnforcedStyle: empty_lines
68
+
69
+ Layout/EmptyLinesAroundModuleBody:
70
+ Enabled: true
71
+ EnforcedStyle: empty_lines_except_namespace
72
+
73
+ Layout/ExtraSpacing:
74
+ Description: 'Do not use unnecessary spacing.'
75
+ Enabled: true
76
+
77
+ Layout/InitialIndentation:
78
+ Description: >-
79
+ Checks the indentation of the first non-blank non-comment line in a file.
80
+ Enabled: false
81
+
82
+ Layout/IndentHash:
83
+ Enabled: true
84
+ EnforcedStyle: consistent
85
+
86
+ Layout/IndentationConsistency:
87
+ EnforcedStyle: rails
88
+ Enabled: true
89
+
90
+ Layout/MultilineBlockLayout:
91
+ Enabled: false
92
+
93
+ Layout/MultilineOperationIndentation:
94
+ Description: >-
95
+ Checks indentation of binary operations that span more than
96
+ one line.
97
+ Enabled: true
98
+ EnforcedStyle: indented
99
+
100
+ Layout/MultilineMethodCallIndentation:
101
+ Description: >-
102
+ Checks indentation of method calls with the dot operator
103
+ that span more than one line.
104
+ Enabled: true
105
+ EnforcedStyle: indented
106
+
107
+ Layout/SpaceBeforeBlockBraces:
108
+ Description: >-
109
+ Checks that block braces have or don't have a space before
110
+ the opening brace depending on configuration.
111
+ Enabled: false
112
+
113
+ # Naming
114
+
115
+ Naming/AccessorMethodName:
6
116
  Description: Check the naming of accessor methods for get_/set_.
7
117
  Enabled: false
8
118
 
119
+ Naming/AsciiIdentifiers:
120
+ Description: 'Use only ascii symbols in identifiers.'
121
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
122
+ Enabled: true
123
+
124
+ Naming/BinaryOperatorParameterName:
125
+ Description: 'When defining binary operators, name the argument other.'
126
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
127
+ Enabled: false
128
+
129
+ Naming/FileName:
130
+ Description: 'Use snake_case for source file names.'
131
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
132
+ Enabled: true
133
+
134
+ Naming/PredicateName:
135
+ Description: 'Check the names of predicate methods.'
136
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
137
+ NamePrefixBlacklist:
138
+ - is_
139
+ Exclude:
140
+ - spec/**/*
141
+
142
+ # Style
143
+
9
144
  Style/Alias:
10
145
  Description: 'Use alias_method instead of alias.'
11
146
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
@@ -21,21 +156,11 @@ Style/AsciiComments:
21
156
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
22
157
  Enabled: true
23
158
 
24
- Style/AsciiIdentifiers:
25
- Description: 'Use only ascii symbols in identifiers.'
26
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
27
- Enabled: true
28
-
29
159
  Style/Attr:
30
160
  Description: 'Checks for uses of Module#attr.'
31
161
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
32
162
  Enabled: true
33
163
 
34
- Metrics/BlockNesting:
35
- Description: 'Avoid excessive block nesting'
36
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
37
- Enabled: true
38
-
39
164
  Style/CaseEquality:
40
165
  Description: 'Avoid explicit use of the case equality operator(===).'
41
166
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
@@ -51,14 +176,6 @@ Style/ClassAndModuleChildren:
51
176
  Enabled: true
52
177
  EnforcedStyle: nested
53
178
 
54
- Metrics/ClassLength:
55
- Description: 'Avoid classes longer than 100 lines of code.'
56
- Enabled: false
57
-
58
- Metrics/ModuleLength:
59
- Description: 'Avoid modules longer than 100 lines of code.'
60
- Enabled: false
61
-
62
179
  Style/ClassVars:
63
180
  Description: 'Avoid the use of class variables.'
64
181
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
@@ -67,7 +184,7 @@ Style/ClassVars:
67
184
  Style/CollectionMethods:
68
185
  Enabled: true
69
186
  PreferredMethods:
70
- find: find
187
+ detect: find
71
188
  inject: reduce
72
189
  collect: map
73
190
  find_all: select
@@ -77,11 +194,6 @@ Style/ColonMethodCall:
77
194
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
78
195
  Enabled: true
79
196
 
80
- Style/MutableConstant:
81
- Description: 'Avoids assignment of mutable literals to constants..'
82
- StyleGuide: 'http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/MutableConstant'
83
- Enabled: false
84
-
85
197
  Style/CommentAnnotation:
86
198
  Description: >-
87
199
  Checks formatting of special comments
@@ -89,27 +201,6 @@ Style/CommentAnnotation:
89
201
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
90
202
  Enabled: false
91
203
 
92
- Metrics/AbcSize:
93
- Description: >-
94
- A calculated magnitude based on number of assignments,
95
- branches, and conditions.
96
- Enabled: false
97
-
98
- Metrics/CyclomaticComplexity:
99
- Description: >-
100
- A complexity metric that is strongly correlated to the number
101
- of test cases needed to validate a method.
102
- Enabled: false
103
-
104
- Rails/Delegate:
105
- Description: 'Prefer delegate method for delegations.'
106
- Enabled: false
107
-
108
- Style/PreferredHashMethods:
109
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
110
- StyleGuide: '#hash-key'
111
- Enabled: true
112
-
113
204
  Style/Documentation:
114
205
  Description: 'Document classes and non-namespace modules.'
115
206
  Enabled: false
@@ -128,6 +219,9 @@ Style/EmptyLiteral:
128
219
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
129
220
  Enabled: true
130
221
 
222
+ Style/EmptyMethod:
223
+ EnforcedStyle: expanded
224
+
131
225
  # Checks whether the source file has a utf-8 encoding comment or not
132
226
  # AutoCorrectEncodingComment must match the regex
133
227
  # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
@@ -139,11 +233,6 @@ Style/EvenOdd:
139
233
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
140
234
  Enabled: true
141
235
 
142
- Style/FileName:
143
- Description: 'Use snake_case for source file names.'
144
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
145
- Enabled: true
146
-
147
236
  Style/FrozenStringLiteralComment:
148
237
  Description: >-
149
238
  Add the frozen_string_literal comment to the top of files
@@ -203,16 +292,11 @@ Style/LineEndConcatenation:
203
292
  line end.
204
293
  Enabled: true
205
294
 
206
- Metrics/LineLength:
207
- Description: 'Limit lines to 80 characters.'
208
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
209
- Max: 80
210
- Enabled: false
211
-
212
- Metrics/MethodLength:
213
- Description: 'Avoid methods longer than 10 lines of code.'
214
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
215
- Enabled: false
295
+ Style/MixinUsage:
296
+ Description: 'Checks that `include` statements appaear inside classes.'
297
+ Enabled: true
298
+ Exclude:
299
+ - bin/*
216
300
 
217
301
  Style/ModuleFunction:
218
302
  Description: 'Checks for usage of `extend self` in modules.'
@@ -224,6 +308,11 @@ Style/MultilineBlockChain:
224
308
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
225
309
  Enabled: false
226
310
 
311
+ Style/MutableConstant:
312
+ Description: 'Avoids assignment of mutable literals to constants..'
313
+ StyleGuide: 'http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/MutableConstant'
314
+ Enabled: true
315
+
227
316
  Style/NegatedIf:
228
317
  Description: >-
229
318
  Favor unless over if for negative conditions
@@ -256,7 +345,7 @@ Style/NumericLiterals:
256
345
  Add underscores to large numeric literals to improve their
257
346
  readability.
258
347
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
259
- Enabled: true
348
+ Enabled: false
260
349
 
261
350
  Style/OneLineConditional:
262
351
  Description: >-
@@ -265,16 +354,6 @@ Style/OneLineConditional:
265
354
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
266
355
  Enabled: true
267
356
 
268
- Style/OpMethod:
269
- Description: 'When defining binary operators, name the argument other.'
270
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
271
- Enabled: false
272
-
273
- Metrics/ParameterLists:
274
- Description: 'Avoid parameter lists longer than three or four parameters.'
275
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
276
- Enabled: true
277
-
278
357
  Style/PercentLiteralDelimiters:
279
358
  Description: 'Use `%`-literal delimiters consistently'
280
359
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
@@ -285,13 +364,10 @@ Style/PerlBackrefs:
285
364
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
286
365
  Enabled: true
287
366
 
288
- Style/PredicateName:
289
- Description: 'Check the names of predicate methods.'
290
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
291
- NamePrefixBlacklist:
292
- - is_
293
- Exclude:
294
- - spec/**/*
367
+ Style/PreferredHashMethods:
368
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
369
+ StyleGuide: '#hash-key'
370
+ Enabled: true
295
371
 
296
372
  Style/Proc:
297
373
  Description: 'Use proc instead of Proc.new.'
@@ -344,13 +420,19 @@ Style/StringLiterals:
344
420
  Style/TrailingCommaInArguments:
345
421
  Description: 'Checks for trailing comma in argument lists.'
346
422
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
347
- EnforcedStyleForMultiline: comma
423
+ EnforcedStyleForMultiline: no_comma
348
424
  Enabled: true
349
425
 
350
- Style/TrailingCommaInLiteral:
351
- Description: 'Checks for trailing comma in array and hash literals.'
426
+ Style/TrailingCommaInArrayLiteral:
427
+ Description: 'Checks for trailing comma in array literals.'
352
428
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
353
- EnforcedStyleForMultiline: comma
429
+ EnforcedStyleForMultiline: no_comma
430
+ Enabled: false
431
+
432
+ Style/TrailingCommaInHashLiteral:
433
+ Description: 'Checks for trailing comma in hash literals.'
434
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
435
+ EnforcedStyleForMultiline: no_comma
354
436
  Enabled: false
355
437
 
356
438
  Style/TrivialAccessors:
@@ -377,13 +459,62 @@ Style/WhileUntilModifier:
377
459
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
378
460
  Enabled: true
379
461
 
462
+ Style/SymbolArray:
463
+ MinSize: 4
464
+
380
465
  Style/WordArray:
381
466
  Description: 'Use %w or %W for arrays of words.'
382
467
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
383
468
  Enabled: true
469
+ MinSize: 4
384
470
 
385
- Style/SymbolArray:
386
- MinSize: 3
471
+ # Metrics
472
+
473
+ Metrics/AbcSize:
474
+ Description: >-
475
+ A calculated magnitude based on number of assignments,
476
+ branches, and conditions.
477
+ Enabled: false
478
+
479
+ Metrics/BlockLength:
480
+ Enabled: true
481
+ Exclude:
482
+ - config/environments/*
483
+
484
+ Metrics/BlockNesting:
485
+ Description: 'Avoid excessive block nesting'
486
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
487
+ Enabled: true
488
+
489
+ Metrics/ClassLength:
490
+ Description: 'Avoid classes longer than 100 lines of code.'
491
+ Enabled: false
492
+
493
+ Metrics/CyclomaticComplexity:
494
+ Description: >-
495
+ A complexity metric that is strongly correlated to the number
496
+ of test cases needed to validate a method.
497
+ Enabled: false
498
+
499
+ Metrics/LineLength:
500
+ Description: 'Limit lines to 80 characters.'
501
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
502
+ Max: 80
503
+ Enabled: false
504
+
505
+ Metrics/MethodLength:
506
+ Description: 'Avoid methods longer than 10 lines of code.'
507
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
508
+ Enabled: false
509
+
510
+ Metrics/ModuleLength:
511
+ Description: 'Avoid modules longer than 100 lines of code.'
512
+ Enabled: false
513
+
514
+ Metrics/ParameterLists:
515
+ Description: 'Avoid parameter lists longer than three or four parameters.'
516
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
517
+ Enabled: true
387
518
 
388
519
  # Lint
389
520
 
@@ -409,13 +540,6 @@ Lint/CircularArgumentReference:
409
540
  Description: "Don't refer to the keyword argument in the default value."
410
541
  Enabled: false
411
542
 
412
- Lint/ConditionPosition:
413
- Description: >-
414
- Checks for condition placed in a confusing position relative to
415
- the keyword.
416
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
417
- Enabled: true
418
-
419
543
  Lint/DeprecatedClassMethods:
420
544
  Description: 'Check for deprecated class method calls.'
421
545
  Enabled: true
@@ -441,13 +565,7 @@ Lint/HandleExceptions:
441
565
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
442
566
  Enabled: true
443
567
 
444
- Lint/InvalidCharacterLiteral:
445
- Description: >-
446
- Checks for invalid character literals with a non-escaped
447
- whitespace character.
448
- Enabled: false
449
-
450
- Lint/LiteralInCondition:
568
+ Lint/LiteralAsCondition:
451
569
  Description: 'Checks of literals used in conditions.'
452
570
  Enabled: false
453
571
 
@@ -488,13 +606,6 @@ Lint/UnderscorePrefixedVariableName:
488
606
  Description: 'Do not use prefix `_` for a variable that is used.'
489
607
  Enabled: false
490
608
 
491
- Lint/UnneededDisable:
492
- Description: >-
493
- Checks for rubocop:disable comments that can be removed.
494
- Note: this cop is not disabled when disabling all cops.
495
- It must be explicitly disabled.
496
- Enabled: false
497
-
498
609
  Lint/Void:
499
610
  Description: 'Possible use of operator/literal/variable in void context.'
500
611
  Enabled: false
@@ -519,7 +630,7 @@ Performance/Detect:
519
630
  Use `detect` instead of `select.first`, `find_all.first`,
520
631
  `select.last`, and `find_all.last`.
521
632
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
522
- Enabled: false
633
+ Enabled: true
523
634
 
524
635
  Performance/FlatMap:
525
636
  Description: >-
@@ -568,6 +679,10 @@ Rails/Date:
568
679
  such as Date.today, Date.current etc.
569
680
  Enabled: true
570
681
 
682
+ Rails/Delegate:
683
+ Description: 'Prefer delegate method for delegations.'
684
+ Enabled: false
685
+
571
686
  Rails/FindBy:
572
687
  Description: 'Prefer find_by over where.first.'
573
688
  Enabled: true
@@ -604,57 +719,7 @@ Rails/Validation:
604
719
  Description: 'Use validates :attribute, hash of validations.'
605
720
  Enabled: false
606
721
 
607
- # Layout
608
-
609
- Layout/EmptyLinesAroundClassBody:
610
- Enabled: true
611
- EnforcedStyle: empty_lines
612
-
613
- Layout/AlignParameters:
614
- Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
615
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
616
- Enabled: true
617
-
618
- Layout/DotPosition:
619
- Description: 'Checks the position of the dot in multi-line method calls.'
620
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
621
- EnforcedStyle: leading
622
-
623
- Layout/ExtraSpacing:
624
- Description: 'Do not use unnecessary spacing.'
625
- Enabled: true
626
-
627
- Layout/MultilineOperationIndentation:
628
- Description: >-
629
- Checks indentation of binary operations that span more than
630
- one line.
631
- Enabled: true
632
- EnforcedStyle: indented
633
-
634
- Layout/MultilineMethodCallIndentation:
635
- Description: >-
636
- Checks indentation of method calls with the dot operator
637
- that span more than one line.
638
- Enabled: true
639
- EnforcedStyle: indented
640
-
641
- Layout/InitialIndentation:
642
- Description: >-
643
- Checks the indentation of the first non-blank non-comment line in a file.
644
- Enabled: false
645
-
646
- Layout/IndentHash:
647
- Enabled: true
648
- EnforcedStyle: consistent
649
-
650
- Layout/AccessModifierIndentation:
651
- Enabled: true
652
-
653
- Layout/IndentationConsistency:
654
- EnforcedStyle: rails
655
- Enabled: true
656
-
657
722
  # Bundler
658
723
 
659
724
  Bundler/OrderedGems:
660
- Enabled: false
725
+ Enabled: true
@@ -17,5 +17,8 @@ test:
17
17
  port: 5432
18
18
  database: disco_app_test
19
19
 
20
+ staging:
21
+ <<: *default
22
+
20
23
  production:
21
24
  <<: *default
@@ -0,0 +1,85 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Use Sidekiq as the active job backend
5
+ config.active_job.queue_adapter = :sidekiq
6
+
7
+ # Allow real charges in staging with an ENV variable
8
+ config.x.shopify_charges_real = ENV['SHOPIFY_CHARGES_REAL'] == 'true'
9
+
10
+ # Code is not reloaded between requests.
11
+ config.cache_classes = true
12
+
13
+ # Eager load code on boot. This eager loads most of Rails and
14
+ # your application in memory, allowing both threaded web servers
15
+ # and those relying on copy on write to perform better.
16
+ # Rake tasks automatically ignore this option for performance.
17
+ config.eager_load = true
18
+
19
+ # Full error reports are disabled and caching is turned on.
20
+ config.consider_all_requests_local = false
21
+ config.action_controller.perform_caching = true
22
+
23
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
24
+ # Add `rack-cache` to your Gemfile before enabling this.
25
+ # For large-scale production use, consider using a caching reverse proxy like
26
+ # NGINX, varnish or squid.
27
+ # config.action_dispatch.rack_cache = true
28
+
29
+ # Disable serving static files from the `/public` folder by default since
30
+ # Apache or NGINX already handles this.
31
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
32
+
33
+ # Compress JavaScripts and CSS.
34
+ config.assets.js_compressor = :uglifier
35
+ config.assets.css_compressor = :sass
36
+
37
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
38
+ config.assets.compile = false
39
+
40
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
41
+ # yet still be able to expire them through the digest params.
42
+ config.assets.digest = true
43
+
44
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
45
+
46
+ # Specifies the header that your server uses for sending files.
47
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
48
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
49
+
50
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51
+ config.force_ssl = true
52
+
53
+ # Use the lowest log level to ensure availability of diagnostic information
54
+ # when problems arise.
55
+ config.log_level = :debug
56
+
57
+ # Prepend all log lines with the following tags.
58
+ # config.log_tags = [ :subdomain, :uuid ]
59
+
60
+ # Use a different logger for distributed setups.
61
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
62
+
63
+ # Use a different cache store in staging.
64
+ # config.cache_store = :mem_cache_store
65
+
66
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
67
+ # config.action_controller.asset_host = 'http://assets.example.com'
68
+
69
+ # Ignore bad email addresses and do not raise email delivery errors.
70
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
71
+ # config.action_mailer.raise_delivery_errors = false
72
+
73
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
74
+ # the I18n.default_locale when a translation cannot be found).
75
+ config.i18n.fallbacks = true
76
+
77
+ # Send deprecation notices to registered listeners.
78
+ config.active_support.deprecation = :notify
79
+
80
+ # Use default logging formatter so that PID and timestamp are not suppressed.
81
+ config.log_formatter = ::Logger::Formatter.new
82
+
83
+ # Do not dump schema after migrations.
84
+ config.active_record.dump_schema_after_migration = false
85
+ end
@@ -18,5 +18,8 @@ test:
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
21
+ staging:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23
+
21
24
  production:
22
25
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>