Browse Source

Layout/AlignParameters

Maarten van den Berg 6 years ago
parent
commit
c063afa4df
6 changed files with 19 additions and 31 deletions
  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
     - 'app/views/api/activities/show.rabl'
22
     - 'app/views/api/activities/show.rabl'
23
     - 'db/seeds.rb'
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
 # Offense count: 2
25
 # Offense count: 2
38
 # Cop supports --auto-correct.
26
 # Cop supports --auto-correct.
39
 # Configuration parameters: EnforcedStyle, IndentationWidth.
27
 # Configuration parameters: EnforcedStyle, IndentationWidth.

+ 2 - 2
app/models/activity.rb

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

+ 7 - 7
app/models/group.rb

8
 
8
 
9
   has_secure_token :api_token
9
   has_secure_token :api_token
10
   has_many :members,
10
   has_many :members,
11
-    dependent: :destroy
11
+           dependent: :destroy
12
   has_many :people, through: :members
12
   has_many :people, through: :members
13
 
13
 
14
   has_many :activities,
14
   has_many :activities,
15
-    dependent: :destroy
15
+           dependent: :destroy
16
 
16
 
17
   has_many :default_subgroups,
17
   has_many :default_subgroups,
18
-    dependent: :destroy
18
+           dependent: :destroy
19
 
19
 
20
   validates :name,
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
   # @return [Array<Member>] the members in the group who are also group leaders.
26
   # @return [Array<Member>] the members in the group who are also group leaders.
27
   def leaders
27
   def leaders

+ 4 - 4
app/models/member.rb

12
   before_destroy :delete_future_participants!
12
   before_destroy :delete_future_participants!
13
 
13
 
14
   validates :person_id,
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
   # Create Participants for this Member for all the group's future activities, where the member isn't enrolled yet.
20
   # Create Participants for this Member for all the group's future activities, where the member isn't enrolled yet.
21
   # Intended to be called after the member is added to the group.
21
   # Intended to be called after the member is added to the group.

+ 4 - 4
app/models/participant.rb

22
   after_validation :clear_subgroup, if: 'self.attending != true'
22
   after_validation :clear_subgroup, if: 'self.attending != true'
23
 
23
 
24
   validates :person_id,
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
   HUMAN_ATTENDING = {
30
   HUMAN_ATTENDING = {
31
     true => I18n.t('activities.state.present'),
31
     true => I18n.t('activities.state.present'),

+ 2 - 2
app/models/person.rb

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