Pārlūkot izejas kodu

Rest of Layout/*

Maarten van den Berg 6 gadi atpakaļ
vecāks
revīzija
9f6b546ca6

+ 0 - 31
.rubocop.yml

10
   Exclude:
10
   Exclude:
11
     - 'db/schema.rb'
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
 # Offense count: 1
13
 # Offense count: 1
45
 # Configuration parameters: AllowSafeAssignment.
14
 # Configuration parameters: AllowSafeAssignment.
46
 Lint/AssignmentInCondition:
15
 Lint/AssignmentInCondition:

+ 4 - 3
app/models/activity.rb

77
   after_commit :schedule_reminder,
77
   after_commit :schedule_reminder,
78
                if: Proc.new { |a| a.previous_changes["reminder_at"] }
78
                if: Proc.new { |a| a.previous_changes["reminder_at"] }
79
   after_commit :schedule_subgroup_division,
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
                                    a.previous_changes['subgroup_division_enabled']) &&
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
   # Get all people (not participants) that are organizers. Does not include
87
   # Get all people (not participants) that are organizers. Does not include

+ 2 - 2
app/models/token.rb

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

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

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

+ 1 - 1
config/initializers/assets.rb

8
 
8
 
9
 # Precompile additional assets.
9
 # Precompile additional assets.
10
 # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
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
 
9
 
10
 # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
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
 # Specifies the `environment` that Puma will run in.
14
 # Specifies the `environment` that Puma will run in.
15
 #
15
 #

+ 3 - 3
db/seeds.rb

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