Maarten van den Berg преди 6 години
родител
ревизия
c063afa4df
променени са 6 файла, в които са добавени 19 реда и са изтрити 31 реда
  1. 0 12
      .rubocop.yml
  2. 2 2
      app/models/activity.rb
  3. 7 7
      app/models/group.rb
  4. 4 4
      app/models/member.rb
  5. 4 4
      app/models/participant.rb
  6. 2 2
      app/models/person.rb

+ 0 - 12
.rubocop.yml

@@ -22,18 +22,6 @@ Layout/AlignHash:
22 22
     - 'app/views/api/activities/show.rabl'
23 23
     - 'db/seeds.rb'
24 24
 
25
-# Offense count: 10
26
-# Cop supports --auto-correct.
27
-# Configuration parameters: EnforcedStyle, IndentationWidth.
28
-# SupportedStyles: with_first_parameter, with_fixed_indentation
29
-Layout/AlignParameters:
30
-  Exclude:
31
-    - 'app/models/activity.rb'
32
-    - 'app/models/group.rb'
33
-    - 'app/models/member.rb'
34
-    - 'app/models/participant.rb'
35
-    - 'app/models/person.rb'
36
-
37 25
 # Offense count: 2
38 26
 # Cop supports --auto-correct.
39 27
 # Configuration parameters: EnforcedStyle, IndentationWidth.

+ 2 - 2
app/models/activity.rb

@@ -56,11 +56,11 @@ class Activity < ApplicationRecord
56 56
   belongs_to :group
57 57
 
58 58
   has_many :participants,
59
-    dependent: :destroy
59
+           dependent: :destroy
60 60
   has_many :people, through: :participants
61 61
 
62 62
   has_many :subgroups,
63
-    dependent: :destroy
63
+           dependent: :destroy
64 64
 
65 65
   validates :name, presence: true
66 66
   validates :start, presence: true

+ 7 - 7
app/models/group.rb

@@ -8,20 +8,20 @@ class Group < ApplicationRecord
8 8
 
9 9
   has_secure_token :api_token
10 10
   has_many :members,
11
-    dependent: :destroy
11
+           dependent: :destroy
12 12
   has_many :people, through: :members
13 13
 
14 14
   has_many :activities,
15
-    dependent: :destroy
15
+           dependent: :destroy
16 16
 
17 17
   has_many :default_subgroups,
18
-    dependent: :destroy
18
+           dependent: :destroy
19 19
 
20 20
   validates :name,
21
-    presence: true,
22
-    uniqueness: {
23
-      case_sensitive: false
24
-    }
21
+            presence: true,
22
+            uniqueness: {
23
+              case_sensitive: false
24
+            }
25 25
 
26 26
   # @return [Array<Member>] the members in the group who are also group leaders.
27 27
   def leaders

+ 4 - 4
app/models/member.rb

@@ -12,10 +12,10 @@ class Member < ApplicationRecord
12 12
   before_destroy :delete_future_participants!
13 13
 
14 14
   validates :person_id,
15
-    uniqueness: {
16
-      scope: :group_id,
17
-      message: I18n.t('groups.member.already_in')
18
-    }
15
+            uniqueness: {
16
+              scope: :group_id,
17
+              message: I18n.t('groups.member.already_in')
18
+            }
19 19
 
20 20
   # Create Participants for this Member for all the group's future activities, where the member isn't enrolled yet.
21 21
   # Intended to be called after the member is added to the group.

+ 4 - 4
app/models/participant.rb

@@ -22,10 +22,10 @@ class Participant < ApplicationRecord
22 22
   after_validation :clear_subgroup, if: 'self.attending != true'
23 23
 
24 24
   validates :person_id,
25
-    uniqueness: {
26
-      scope: :activity_id,
27
-      message: I18n.t('activities.errors.already_in')
28
-    }
25
+            uniqueness: {
26
+              scope: :activity_id,
27
+              message: I18n.t('activities.errors.already_in')
28
+            }
29 29
 
30 30
   HUMAN_ATTENDING = {
31 31
     true => I18n.t('activities.state.present'),

+ 2 - 2
app/models/person.rb

@@ -36,9 +36,9 @@ class Person < ApplicationRecord
36 36
 
37 37
   has_one :user
38 38
   has_many :members,
39
-    dependent: :destroy
39
+           dependent: :destroy
40 40
   has_many :participants,
41
-    dependent: :destroy
41
+           dependent: :destroy
42 42
   has_many :groups, through: :members
43 43
   has_many :activities, through: :participants
44 44
   has_secure_token :calendar_token