effective_memberships 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcacbcc7726096bc1fc69dafc09a496b4ba8f785117993b0df13efe44436a84f
4
- data.tar.gz: 89242751748bdac6d8c84c7eed6c2d507b90c8939b090dd0d9ea44fe4c72368f
3
+ metadata.gz: 496b494a70e47e75ca34b0b9103098b982900eb5405ca4f81d6521afc9a03394
4
+ data.tar.gz: b1b15ed6a27e4b436c7f3269d1a5f902b91d14c94a804d075c69233a1016171e
5
5
  SHA512:
6
- metadata.gz: 595711508e4003185f62c09abe28f31639aeaf02377e088a96edff74dc4f99e6dbe6490aacc2dc279f1a1040f8b321786b9d595e93c129e39bed5f1c3c605cbf
7
- data.tar.gz: aad625e963199c4a01612e925885fd5ce04acafb0290d113f98357d32ba5b2c84b3963cbc1d7775826b5668c68a1944d2d65bea9c9bfbe09661fe3b75858e6b5
6
+ metadata.gz: c620514d835854625467cfe91c104d8ea5a6666915cec8f85b7b031d8a1b9b27ae54525be78f8dcd82b1369e7b4ea0a164836e7077f5b4680bea2898a87eea91
7
+ data.tar.gz: f51ee6087bc44f78ddf275587dc194c3d36a0535e9cbe038f8389c23aed60529810b72b1467883accc5b99e9b9df2589dd61401b012e9667cfa70963950fa4a1
@@ -33,7 +33,7 @@ module Effective
33
33
  end
34
34
 
35
35
  def to_s
36
- title || 'course'
36
+ title.presence || model_name.human
37
37
  end
38
38
 
39
39
  end
@@ -24,7 +24,7 @@ module Effective
24
24
  validates :title, presence: true, uniqueness: true
25
25
 
26
26
  def to_s
27
- title || 'course area'
27
+ title.presence || model_name.human
28
28
  end
29
29
 
30
30
  end
@@ -22,7 +22,7 @@ module Effective
22
22
  validates :position, presence: true
23
23
 
24
24
  def to_s
25
- title || 'course name'
25
+ title.presence || model_name.human
26
26
  end
27
27
 
28
28
  end
@@ -28,7 +28,7 @@ module Effective
28
28
  end
29
29
 
30
30
  def to_s
31
- degree_obtained || 'education'
31
+ degree_obtained.presence || model_name.human
32
32
  end
33
33
 
34
34
  end
@@ -16,7 +16,6 @@ module Effective
16
16
  belongs_to :applicant, polymorphic: true
17
17
  belongs_to :endorser, polymorphic: true, optional: true
18
18
 
19
-
20
19
  effective_resource do
21
20
  # These fields are submitted by the applicant
22
21
  # They should try to select an endorser from the dropdown
@@ -82,7 +81,11 @@ module Effective
82
81
  end
83
82
 
84
83
  def to_s
85
- 'endorsement'
84
+ if (endorser.present? || name.present?)
85
+ "#{model_name.human} from #{endorer || name}"
86
+ else
87
+ model_name.human
88
+ end
86
89
  end
87
90
 
88
91
  def email
@@ -25,7 +25,7 @@ module Effective
25
25
  end
26
26
 
27
27
  def to_s
28
- name || 'equivalence'
28
+ name.present? ? "#{model_name.human} from #{name}" : model_name.human
29
29
  end
30
30
 
31
31
  end
@@ -46,7 +46,7 @@ module Effective
46
46
  end
47
47
 
48
48
  def to_s
49
- position.presence || 'work experience'
49
+ position.presence || model_name.human
50
50
  end
51
51
 
52
52
  def assign_months!
@@ -72,7 +72,7 @@ module Effective
72
72
  after_commit(on: :create, if: -> { applicant.was_submitted? && !applicant.done? }, unless: -> { email_form_skip }) { notify! }
73
73
 
74
74
  def to_s
75
- name.presence || 'reference'
75
+ name.present? ? "#{model_name.human} from #{name}" : model_name.human
76
76
  end
77
77
 
78
78
  def notify!
@@ -129,7 +129,7 @@ module Effective
129
129
  end
130
130
 
131
131
  def to_s
132
- return 'membership' if owner.blank?
132
+ return model_name.human if owner.blank?
133
133
 
134
134
  summary = [
135
135
  owner.to_s,
@@ -6,7 +6,7 @@ module Effective
6
6
  log_changes(to: :membership) if respond_to?(:log_changes)
7
7
 
8
8
  def to_s
9
- category&.to_s || 'membership category'
9
+ category&.to_s || model_name.human
10
10
  end
11
11
 
12
12
  end
@@ -38,7 +38,7 @@ module Effective
38
38
  end
39
39
 
40
40
  def to_s
41
- 'membership history'
41
+ model_name.human
42
42
  end
43
43
 
44
44
  # These two accessors are for the memberships history form.
@@ -6,7 +6,7 @@ module Effective
6
6
  log_changes(to: :membership) if respond_to?(:log_changes)
7
7
 
8
8
  def to_s
9
- status&.to_s || 'membership status'
9
+ status&.to_s || model_name.human
10
10
  end
11
11
 
12
12
  end
@@ -41,7 +41,7 @@ module Effective
41
41
  uniqueness: { scope: [:organization_id, :organization_type], message: 'already belongs to this organization' }
42
42
 
43
43
  def to_s
44
- user.to_s
44
+ user&.to_s || model_name.human
45
45
  end
46
46
 
47
47
  def build_user(attributes = {})
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.15.0'
2
+ VERSION = '0.15.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails