瀏覽代碼

Rest of Layout/*

Maarten van den Berg 6 年之前
父節點
當前提交
9f6b546ca6
共有 7 個文件被更改,包括 12 次插入42 次删除
  1. 0 31
      .rubocop.yml
  2. 4 3
      app/models/activity.rb
  3. 2 2
      app/models/token.rb
  4. 1 1
      app/views/api/activities/show.rabl
  5. 1 1
      config/initializers/assets.rb
  6. 1 1
      config/puma.rb
  7. 3 3
      db/seeds.rb

+ 0 - 31
.rubocop.yml

@@ -10,37 +10,6 @@ AllCops:
10 10
   Exclude:
11 11
     - 'db/schema.rb'
12 12
 
13
-# Offense count: 6
14
-# Cop supports --auto-correct.
15
-# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
16
-# SupportedHashRocketStyles: key, separator, table
17
-# SupportedColonStyles: key, separator, table
18
-# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
19
-Layout/AlignHash:
20
-  Exclude:
21
-    - 'app/models/token.rb'
22
-    - 'app/views/api/activities/show.rabl'
23
-    - 'db/seeds.rb'
24
-
25
-# Offense count: 1
26
-# Cop supports --auto-correct.
27
-Layout/LeadingCommentSpace:
28
-  Exclude:
29
-    - 'config/initializers/assets.rb'
30
-
31
-# Offense count: 1
32
-# Cop supports --auto-correct.
33
-Layout/MultilineBlockLayout:
34
-  Exclude:
35
-    - 'app/models/activity.rb'
36
-
37
-# Offense count: 1
38
-# Cop supports --auto-correct.
39
-# Configuration parameters: IndentationWidth.
40
-Layout/Tab:
41
-  Exclude:
42
-    - 'config/puma.rb'
43
-
44 13
 # Offense count: 1
45 14
 # Configuration parameters: AllowSafeAssignment.
46 15
 Lint/AssignmentInCondition:

+ 4 - 3
app/models/activity.rb

@@ -77,10 +77,11 @@ class Activity < ApplicationRecord
77 77
   after_commit :schedule_reminder,
78 78
                if: Proc.new { |a| a.previous_changes["reminder_at"] }
79 79
   after_commit :schedule_subgroup_division,
80
-               if: Proc.new { |a| (a.previous_changes['deadline'] ||
80
+               if: Proc.new { |a|
81
+                     (a.previous_changes['deadline'] ||
81 82
                                    a.previous_changes['subgroup_division_enabled']) &&
82
-                 !a.subgroup_division_done &&
83
-                 a.subgroup_division_enabled
83
+                       !a.subgroup_division_done &&
84
+                       a.subgroup_division_enabled
84 85
                    }
85 86
 
86 87
   # Get all people (not participants) that are organizers. Does not include

+ 2 - 2
app/models/token.rb

@@ -27,9 +27,9 @@ class Token < ApplicationRecord
27 27
   #     what user the token allows the holder to authenticate as.
28 28
 
29 29
   TYPES = {
30
-    password_reset:       'pw_reset',
30
+    password_reset: 'pw_reset',
31 31
     account_confirmation: 'confirm',
32
-    api_authentication:   'api'
32
+    api_authentication: 'api'
33 33
   }
34 34
 
35 35
   validates :token, uniqueness: true, presence: true

+ 1 - 1
app/views/api/activities/show.rabl

@@ -7,7 +7,7 @@ node :response_counts do
7 7
   {
8 8
     "present": c[true]  || "0",
9 9
     "unknown": c[nil]   || "0",
10
-    "absent":  c[false] || "0"
10
+    "absent": c[false] || "0"
11 11
   }
12 12
 end
13 13
 

+ 1 - 1
config/initializers/assets.rb

@@ -8,4 +8,4 @@ Rails.application.config.assets.version = '1.0'
8 8
 
9 9
 # Precompile additional assets.
10 10
 # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
-#Rails.application.config.assets.precompile += %w( void.css )
11
+# Rails.application.config.assets.precompile += %w( void.css )

+ 1 - 1
config/puma.rb

@@ -9,7 +9,7 @@ threads threads_count, threads_count
9 9
 
10 10
 # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
11 11
 #
12
-bind	ENV.fetch("PUMA_BIND") { 'tcp://127.0.0.1:3000' }
12
+bind  ENV.fetch("PUMA_BIND") { 'tcp://127.0.0.1:3000' }
13 13
 
14 14
 # Specifies the `environment` that Puma will run in.
15 15
 #

+ 3 - 3
db/seeds.rb

@@ -46,7 +46,7 @@ end
46 46
 15.times do |i|
47 47
   person = Person.create!(
48 48
     first_name: (Faker::Name.first_name),
49
-    last_name:  (Faker::Name.last_name),
49
+    last_name: (Faker::Name.last_name),
50 50
     birth_date: (Faker::Date.between(21.years.ago, Date.today)),
51 51
     email: "testuser#{i}@maartenberg.nl"
52 52
   )
@@ -86,7 +86,7 @@ Person.all.each do |p|
86 86
     if Faker::Boolean.boolean(0.75)
87 87
       mem = Member.create!(
88 88
         person: p,
89
-        group:  g,
89
+        group: g,
90 90
         is_leader: Faker::Boolean.boolean(0.1)
91 91
       )
92 92
       g.activities.each do |a|
@@ -104,7 +104,7 @@ Person.all.each do |p|
104 104
         part.update!(
105 105
           is_organizer: Faker::Boolean.boolean(0.1),
106 106
           attending: [true, false, nil].sample,
107
-          notes:    notes
107
+          notes: notes
108 108
         )
109 109
       end
110 110
     end