stbaldricks 4.4.0.alpha.2 → 4.4.0.alpha.3

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: 70a50aa6bcbf108300495dcd5d37a2cc6f781d2e90298cc8558b0d98e878668a
4
- data.tar.gz: 23ae34608fc19b0a5c948daab377d9f3c48e2d00f49eb54e342d2770cdab6633
3
+ metadata.gz: 6988d6c68fe503599d92512c2a3b45abbff3f50c1975036824ddc381c343748a
4
+ data.tar.gz: 398a04543922a6d0b78fb9dad26046c6d478c6e4eab79a6d51ac0fc3013c55be
5
5
  SHA512:
6
- metadata.gz: 84f4042cfe477a52a496ac549e57cf3c33c70e78b3fad1f8673ea5e018ab32bd4934f3678e6ef746033970250b3b283b180f551bb0ea2d00ab7070ba4632be78
7
- data.tar.gz: 81ea8e394409b43667d882cfd868bc4998f4814e8af80e6d87f1dad9e55558ed61480e112a0895bbc5f9df962cc12da2848532b9f37ae2d593c29cea6c22a851
6
+ metadata.gz: f9d21df8edef36ef576edc05f9b5e51be242c0f7ba8d81f95baaed3c53d0cfac2e4f9537e63dbc6a58afd11cf20487bdcbcdd10591d1923fcba851bb85994dc9
7
+ data.tar.gz: 86c9c786a6a8cecdf7e3867f42030ebc6af04ee0d9b599c7ac5e2bc5a2549d34ab0a010cd89d55251568dfeb547a660cfdec7d46fa62aebf20d3a9869258d3ac
@@ -10,7 +10,7 @@ module SBF
10
10
  def save(entity_or_hash, with = {})
11
11
  if entity_or_hash.is_a?(SBF::Client::BaseEntity)
12
12
  return create(entity_or_hash, with) if entity_or_hash.id.nil?
13
- return update(entity_or_hash.id, entity_or_hash.year, entity_or_hash.update_data, with)
13
+ return update(entity_or_hash.id, entity_or_hash.year, entity_or_hash.dirty_data, with)
14
14
  else
15
15
  return create(entity_or_hash, with) if entity_or_hash[:id].nil?
16
16
  return update(entity_or_hash[:id], entity_or_hash[:year], entity_or_hash, with)
@@ -20,7 +20,7 @@ module SBF
20
20
  def save(entity_or_hash, with = {})
21
21
  if entity_or_hash.is_a?(SBF::Client::BaseEntity)
22
22
  return create(entity_or_hash, with) if entity_or_hash.id.nil?
23
- return update(entity_or_hash.id, entity_or_hash.update_data, with)
23
+ return update(entity_or_hash.id, entity_or_hash.dirty_data, with)
24
24
  else
25
25
  return create(entity_or_hash, with) if entity_or_hash[:id].nil?
26
26
  return update(entity_or_hash[:id], entity_or_hash, with)
@@ -34,7 +34,7 @@ module SBF
34
34
  raise SBF::Client::Error, 'Invalid Entity' unless entity.is_a?(SBF::Client::BaseEntity)
35
35
 
36
36
  with = normalize_with(with, entity)
37
- create_data = entity.to_hash
37
+ create_data = entity.dirty_data
38
38
  create_data.store(:with, with)
39
39
 
40
40
  response = SBF::Client::Api::Request.post_request("#{base_uri}/create", create_data)
@@ -6,6 +6,7 @@ require 'stbaldricks/entities/lib/base'
6
6
  require 'stbaldricks/entities/lib/top_level'
7
7
  require 'stbaldricks/entities/lib/default_cacheable'
8
8
  require 'stbaldricks/entities/challenger/model_type'
9
+ require 'stbaldricks/entities/concerns/type_concern'
9
10
 
10
11
  module SBF
11
12
  module Client
@@ -25,6 +26,7 @@ module SBF
25
26
  end
26
27
 
27
28
  class FullParticipant < SBF::Client::FullParticipant
29
+ include TypeConcern
28
30
  attr_reader :type
29
31
 
30
32
  def type
@@ -33,6 +35,7 @@ module SBF
33
35
  end
34
36
 
35
37
  class PartialParticipant < SBF::Client::PartialParticipant
38
+ include TypeConcern
36
39
  attr_reader :type
37
40
 
38
41
  def type
@@ -41,6 +44,7 @@ module SBF
41
44
  end
42
45
 
43
46
  class FullFundraiser < SBF::Client::FullFundraiser
47
+ include TypeConcern
44
48
  attr_reader :type
45
49
 
46
50
  def type
@@ -49,6 +53,7 @@ module SBF
49
53
  end
50
54
 
51
55
  class PartialFundraiser < SBF::Client::PartialFundraiser
56
+ include TypeConcern
52
57
  attr_reader :type
53
58
 
54
59
  def type
@@ -57,6 +62,7 @@ module SBF
57
62
  end
58
63
 
59
64
  class FullTeam < SBF::Client::FullTeam
65
+ include TypeConcern
60
66
  attr_reader :type
61
67
 
62
68
  def type
@@ -65,6 +71,7 @@ module SBF
65
71
  end
66
72
 
67
73
  class PartialTeam < SBF::Client::PartialTeam
74
+ include TypeConcern
68
75
  attr_reader :type
69
76
 
70
77
  def type
@@ -73,6 +80,7 @@ module SBF
73
80
  end
74
81
 
75
82
  class FullEvent < SBF::Client::FullEvent
83
+ include TypeConcern
76
84
  attr_reader :type
77
85
 
78
86
  def type
@@ -81,6 +89,7 @@ module SBF
81
89
  end
82
90
 
83
91
  class PartialEvent < SBF::Client::PartialEvent
92
+ include TypeConcern
84
93
  attr_reader :type
85
94
 
86
95
  def type
@@ -0,0 +1,7 @@
1
+ module ModelTypeConcern
2
+ extend ActiveSupport::Concern
3
+
4
+ def keys_hash
5
+ model_type.nil? ? super : super.merge(model_type: model_type)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module TypeConcern
2
+ extend ActiveSupport::Concern
3
+
4
+ def keys_hash
5
+ type.nil? ? super : super.merge(type: type)
6
+ end
7
+ end
@@ -11,6 +11,8 @@ require 'stbaldricks/entities/lib/top_level'
11
11
  require 'stbaldricks/entities/lib/name'
12
12
  require 'stbaldricks/entities/lib/payment'
13
13
  require 'stbaldricks/entities/lib/default_cacheable'
14
+ require 'stbaldricks/entities/concerns/type_concern'
15
+ require 'stbaldricks/entities/concerns/model_type_concern'
14
16
 
15
17
  module SBF
16
18
  module Client
@@ -24,6 +26,7 @@ module SBF
24
26
  attr_accessor :is_match, :employer, :matched_donation_id
25
27
 
26
28
  def matched_donation_id=(value)
29
+ matched_donation_id_will_change!
27
30
  @matched_donation_id = value.to_i
28
31
  end
29
32
  end
@@ -40,6 +43,7 @@ module SBF
40
43
  end
41
44
 
42
45
  class FullParticipant < SBF::Client::FullParticipant
46
+ include ModelTypeConcern
43
47
  attr_reader :model_type
44
48
 
45
49
  def model_type
@@ -48,6 +52,7 @@ module SBF
48
52
  end
49
53
 
50
54
  class PartialParticipant < SBF::Client::PartialParticipant
55
+ include ModelTypeConcern
51
56
  attr_reader :model_type
52
57
 
53
58
  def model_type
@@ -56,6 +61,7 @@ module SBF
56
61
  end
57
62
 
58
63
  class FullFundraiser < SBF::Client::FullFundraiser
64
+ include ModelTypeConcern
59
65
  attr_reader :model_type
60
66
 
61
67
  def model_type
@@ -64,6 +70,7 @@ module SBF
64
70
  end
65
71
 
66
72
  class PartialFundraiser < SBF::Client::PartialFundraiser
73
+ include ModelTypeConcern
67
74
  attr_reader :model_type
68
75
 
69
76
  def model_type
@@ -72,6 +79,7 @@ module SBF
72
79
  end
73
80
 
74
81
  class FullTeam < SBF::Client::FullTeam
82
+ include ModelTypeConcern
75
83
  attr_reader :model_type
76
84
 
77
85
  def model_type
@@ -80,6 +88,7 @@ module SBF
80
88
  end
81
89
 
82
90
  class PartialTeam < SBF::Client::PartialTeam
91
+ include ModelTypeConcern
83
92
  attr_reader :model_type
84
93
 
85
94
  def model_type
@@ -88,6 +97,7 @@ module SBF
88
97
  end
89
98
 
90
99
  class FullEvent < SBF::Client::FullEvent
100
+ include ModelTypeConcern
91
101
  attr_reader :model_type
92
102
 
93
103
  def model_type
@@ -96,6 +106,7 @@ module SBF
96
106
  end
97
107
 
98
108
  class PartialEvent < SBF::Client::PartialEvent
109
+ include ModelTypeConcern
99
110
  attr_reader :model_type
100
111
 
101
112
  def model_type
@@ -104,6 +115,7 @@ module SBF
104
115
  end
105
116
 
106
117
  class FullFund < SBF::Client::FullFund
118
+ include ModelTypeConcern
107
119
  attr_reader :model_type
108
120
 
109
121
  def model_type
@@ -112,6 +124,7 @@ module SBF
112
124
  end
113
125
 
114
126
  class PartialFund < SBF::Client::PartialFund
127
+ include ModelTypeConcern
115
128
  attr_reader :model_type
116
129
 
117
130
  def model_type
@@ -120,6 +133,7 @@ module SBF
120
133
  end
121
134
 
122
135
  class FullMemorial < SBF::Client::FullMemorial
136
+ include ModelTypeConcern
123
137
  attr_reader :model_type
124
138
 
125
139
  def model_type
@@ -128,6 +142,7 @@ module SBF
128
142
  end
129
143
 
130
144
  class PartialMemorial < SBF::Client::PartialMemorial
145
+ include ModelTypeConcern
131
146
  attr_reader :model_type
132
147
 
133
148
  def model_type
@@ -136,6 +151,7 @@ module SBF
136
151
  end
137
152
 
138
153
  class SBFGeneralFund < SBF::Client::BaseEntity
154
+ include ModelTypeConcern
139
155
  attr_reader :model_type
140
156
 
141
157
  def id
@@ -148,6 +164,7 @@ module SBF
148
164
  end
149
165
 
150
166
  class FullPerson < SBF::Client::FullPerson
167
+ include TypeConcern
151
168
  attr_reader :type
152
169
 
153
170
  def type
@@ -156,6 +173,7 @@ module SBF
156
173
  end
157
174
 
158
175
  class PartialPerson < SBF::Client::PartialPerson
176
+ include TypeConcern
159
177
  attr_reader :type
160
178
 
161
179
  def type
@@ -164,10 +182,12 @@ module SBF
164
182
  end
165
183
 
166
184
  class FullOrganization < SBF::Client::FullOrganization
185
+ include TypeConcern
167
186
  attr_reader :type
168
187
  end
169
188
 
170
189
  class PartialOrganization < SBF::Client::PartialOrganization
190
+ include TypeConcern
171
191
  attr_reader :type
172
192
  end
173
193
 
@@ -390,6 +410,7 @@ module SBF
390
410
  attr_accessor :is_thanked
391
411
 
392
412
  def amount=(value)
413
+ amount_will_change!
393
414
  @amount = value.to_s.gsub(/[^0-9\.]/, '').to_f
394
415
  end
395
416
  end
@@ -32,6 +32,10 @@ module SBF
32
32
  endpoint.update(id, year, self, with)
33
33
  end
34
34
 
35
+ def keys_hash
36
+ year.nil? ? super : super.merge(year: year)
37
+ end
38
+
35
39
  class Photos < SBF::Client::BaseEntity
36
40
  attr_reader :avatar, :default
37
41
  end
@@ -9,6 +9,7 @@ require 'stbaldricks/entities/lib/address'
9
9
  require 'stbaldricks/entities/lib/base'
10
10
  require 'stbaldricks/entities/lib/top_level'
11
11
  require 'stbaldricks/entities/lib/name'
12
+ require 'stbaldricks/entities/concerns/model_type_concern'
12
13
 
13
14
  module SBF
14
15
  module Client
@@ -18,6 +19,7 @@ module SBF
18
19
  blacklist_action :delete
19
20
 
20
21
  class FullParticipant < SBF::Client::FullParticipant
22
+ include ModelTypeConcern
21
23
  attr_reader :model_type
22
24
 
23
25
  def model_type
@@ -26,6 +28,7 @@ module SBF
26
28
  end
27
29
 
28
30
  class PartialParticipant < SBF::Client::PartialParticipant
31
+ include ModelTypeConcern
29
32
  attr_reader :model_type
30
33
  attr_accessor :year
31
34
 
@@ -35,6 +38,7 @@ module SBF
35
38
  end
36
39
 
37
40
  class FullFundraiser < SBF::Client::FullFundraiser
41
+ include ModelTypeConcern
38
42
  attr_reader :model_type
39
43
 
40
44
  def model_type
@@ -43,6 +47,7 @@ module SBF
43
47
  end
44
48
 
45
49
  class PartialFundraiser < SBF::Client::PartialFundraiser
50
+ include ModelTypeConcern
46
51
  attr_reader :model_type
47
52
  attr_accessor :year
48
53
 
@@ -52,6 +57,7 @@ module SBF
52
57
  end
53
58
 
54
59
  class FullTeam < SBF::Client::FullTeam
60
+ include ModelTypeConcern
55
61
  attr_reader :model_type
56
62
 
57
63
  def model_type
@@ -60,6 +66,7 @@ module SBF
60
66
  end
61
67
 
62
68
  class PartialTeam < SBF::Client::PartialTeam
69
+ include ModelTypeConcern
63
70
  attr_reader :model_type
64
71
  attr_accessor :year
65
72
 
@@ -69,6 +76,7 @@ module SBF
69
76
  end
70
77
 
71
78
  class FullEvent < SBF::Client::FullEvent
79
+ include ModelTypeConcern
72
80
  attr_reader :model_type
73
81
 
74
82
  def model_type
@@ -77,6 +85,7 @@ module SBF
77
85
  end
78
86
 
79
87
  class PartialEvent < SBF::Client::PartialEvent
88
+ include ModelTypeConcern
80
89
  attr_reader :model_type
81
90
 
82
91
  def model_type
@@ -74,6 +74,7 @@ module SBF
74
74
  def totals_by_year=(value)
75
75
  return [] if value.nil? || value.empty?
76
76
 
77
+ totals_by_year_will_change!
77
78
  @totals_by_year = value.map { |k, v|
78
79
  SBF::Client::Fund::YearlyTotals.new(v.merge(year: k.to_s.to_i))
79
80
  }
@@ -91,6 +91,12 @@ module SBF
91
91
  entity_hash
92
92
  end
93
93
  end
94
+
95
+ def dirty_data(with_keys = false)
96
+ data = super(with_keys)
97
+ data[:event].delete(:id) if data[:event] && data[:event][:id].nil?
98
+ data
99
+ end
94
100
  end
95
101
 
96
102
  class PartialFundraiser < Fundraiser
@@ -5,6 +5,7 @@ require 'stbaldricks/entities/team'
5
5
  require 'stbaldricks/entities/participant'
6
6
  require 'stbaldricks/entities/fundraiser'
7
7
  require 'stbaldricks/entities/lib/top_level'
8
+ require 'stbaldricks/entities/concerns/model_type_concern'
8
9
 
9
10
  module SBF
10
11
  module Client
@@ -56,6 +57,7 @@ module SBF
56
57
  end
57
58
 
58
59
  class FullParticipant < SBF::Client::FullParticipant
60
+ include ModelTypeConcern
59
61
  attr_reader :model_type
60
62
 
61
63
  def model_type
@@ -64,6 +66,7 @@ module SBF
64
66
  end
65
67
 
66
68
  class PartialParticipant < SBF::Client::PartialParticipant
69
+ include ModelTypeConcern
67
70
  attr_reader :model_type
68
71
 
69
72
  def model_type
@@ -72,6 +75,7 @@ module SBF
72
75
  end
73
76
 
74
77
  class FullFundraiser < SBF::Client::FullFundraiser
78
+ include ModelTypeConcern
75
79
  attr_reader :model_type
76
80
 
77
81
  def model_type
@@ -80,6 +84,7 @@ module SBF
80
84
  end
81
85
 
82
86
  class PartialFundraiser < SBF::Client::PartialFundraiser
87
+ include ModelTypeConcern
83
88
  attr_reader :model_type
84
89
 
85
90
  def model_type
@@ -88,6 +93,7 @@ module SBF
88
93
  end
89
94
 
90
95
  class FullTeam < SBF::Client::FullTeam
96
+ include ModelTypeConcern
91
97
  attr_reader :model_type
92
98
 
93
99
  def model_type
@@ -96,6 +102,7 @@ module SBF
96
102
  end
97
103
 
98
104
  class PartialTeam < SBF::Client::PartialTeam
105
+ include ModelTypeConcern
99
106
  attr_reader :model_type
100
107
 
101
108
  def model_type
@@ -104,6 +111,7 @@ module SBF
104
111
  end
105
112
 
106
113
  class FullEvent < SBF::Client::FullEvent
114
+ include ModelTypeConcern
107
115
  attr_reader :model_type
108
116
 
109
117
  def model_type
@@ -112,6 +120,7 @@ module SBF
112
120
  end
113
121
 
114
122
  class PartialEvent < SBF::Client::PartialEvent
123
+ include ModelTypeConcern
115
124
  attr_reader :model_type
116
125
 
117
126
  def model_type
@@ -64,37 +64,39 @@ module SBF
64
64
  restore_attributes
65
65
  end
66
66
 
67
- def update_data(with_keys = false)
67
+ ## Returns a hash of changed data for the entity and its sub-entities
68
+ # @param with_keys [Boolean] when true, include the keys of the current entity. (sub-entity keys will always be included if they are present)
69
+ # @return [Hash] the changed data
70
+ def dirty_data(with_keys = false)
68
71
  data = {}
69
72
  changes.each { |k, arr| data[k.to_sym] = arr[1] }
70
73
 
71
74
  instance_variables.each do |var|
75
+ attribute_symbol = var.to_s.gsub('@', '').to_sym
72
76
  attribute = instance_variable_get(var)
73
77
  if attribute.is_a?(BaseEntity)
74
- if attribute.update_data.empty?
75
- data.delete(var.to_s.gsub('@', '').to_sym)
78
+ if attribute.dirty_data(true).empty?
79
+ next unless changed.map(&:to_sym).include?(attribute_symbol)
80
+ data.merge!(attribute_symbol => attribute.keys_hash)
76
81
  else
77
- data.merge!(var.to_s.gsub('@', '').to_sym => attribute.update_data(true))
82
+ data.merge!(attribute_symbol => attribute.dirty_data(true))
78
83
  end
79
84
  elsif attribute.is_a?(Array)
80
- selected = attribute.select { |a| a.is_a?(BaseEntity) || !attribute.update_data(true).empty? }
81
- attributes = selected.map { |s| s.update_data(true) }.reject(&:empty?)
82
- if attributes.empty?
83
- data.delete(var.to_s.gsub('@', '').to_sym)
84
- else
85
- data.merge!(var.to_s.gsub('@', '').to_sym => attributes)
86
- end
85
+ entities = attribute.all? { |e| e.is_a?(BaseEntity) } ? attribute : false
86
+ next unless entities
87
+ dirty_data_hashes = entities.map { |e| e.dirty_data(true) }.reject(&:empty?)
88
+ next if dirty_data_hashes.empty?
89
+ data.merge!(attribute_symbol => dirty_data_hashes)
87
90
  end
88
91
  end
89
92
 
90
93
  return data if data.empty?
91
94
 
92
- with_keys ? keys_data.merge(data) : data
95
+ with_keys ? keys_hash.merge(data) : data
93
96
  end
94
97
 
95
- def keys_data
96
- return {} unless respond_to?(:id)
97
- is_a?(SBF::Client::Event) ? {id: id, year: year} : {id: id}
98
+ def keys_hash
99
+ respond_to?(:id) && id ? {id: id} : {}
98
100
  end
99
101
 
100
102
  def attributes=(data)
@@ -370,7 +372,7 @@ module SBF
370
372
  end if define_reader
371
373
 
372
374
  define_method(:"#{attribute}=") do |val|
373
- send(:"#{attribute}_will_change!") unless val == instance_variable_get("@#{attribute}".to_sym)
375
+ send(:"#{attribute}_will_change!") unless val == instance_variable_get("@#{attribute}".to_sym) && !val.nil?
374
376
  instance_variable_set("@#{attribute}".to_sym, is_boolean ? val.to_s.to_b : val)
375
377
  end
376
378
  end
@@ -502,6 +504,7 @@ module SBF
502
504
  method_name = :"#{attribute}="
503
505
  define_method(method_name) do |value|
504
506
  instance_variable_set(:"@#{attribute}", convert_value(attribute, value))
507
+ send(:"#{attribute}_will_change!") if respond_to?(:"#{attribute}_will_change!")
505
508
  end
506
509
 
507
510
  # Make the setter private if requested (so you can set through the constructor but not anywhere else)
@@ -518,6 +521,7 @@ module SBF
518
521
  raise SBF::Client::Error, "#{attribute} must be an array" unless values.is_a?(Array)
519
522
  converted_collection = values.map { |value| convert_value(attribute, value) }
520
523
  instance_variable_set(:"@#{attribute}", converted_collection)
524
+ send(:"#{attribute}_will_change!") if respond_to?(:"#{attribute}_will_change!")
521
525
  end
522
526
 
523
527
  # Make the setter private if requested (so you can set through the constructor but not anywhere else)
@@ -1,4 +1,5 @@
1
1
  require 'stbaldricks/entities/lib/base'
2
+ require 'stbaldricks/entities/concerns/type_concern'
2
3
 
3
4
  module SBF
4
5
  module Client
@@ -16,6 +17,7 @@ module SBF
16
17
  end
17
18
 
18
19
  class Details < SBF::Client::BaseEntity
20
+ include TypeConcern
19
21
  attr_reader :type
20
22
 
21
23
  def type
@@ -4,10 +4,12 @@ require 'stbaldricks/entities/lib/email_address'
4
4
  require 'stbaldricks/entities/lib/name'
5
5
  require 'stbaldricks/entities/lib/phone'
6
6
  require 'stbaldricks/entities/lib/opt_out_settings'
7
+ require 'stbaldricks/entities/concerns/type_concern'
7
8
 
8
9
  module SBF
9
10
  module Client
10
11
  class Organization < SBF::Client::TopLevelEntity
12
+ include TypeConcern
11
13
  actions DEFAULT_CRUD_ACTIONS
12
14
 
13
15
  disallow_instantiation
@@ -7,11 +7,13 @@ require 'stbaldricks/entities/lib/phone'
7
7
  require 'stbaldricks/enums/league_status'
8
8
  require 'stbaldricks/entities/lib/opt_out_settings'
9
9
  require 'stbaldricks/entities/lib/default_cacheable'
10
+ require 'stbaldricks/entities/concerns/type_concern'
10
11
 
11
12
  module SBF
12
13
  module Client
13
14
  class Person < SBF::Client::TopLevelEntity
14
15
  include Entities::DefaultCacheable
16
+ include TypeConcern
15
17
  disallow_instantiation
16
18
 
17
19
  actions DEFAULT_CRUD_ACTIONS
@@ -333,6 +335,7 @@ module SBF
333
335
  # without the information contained in the SBF::Client::Person::Occupation instance.
334
336
  attr_accessor :details
335
337
  def details=(value)
338
+ details_will_change!
336
339
  if educator? || student?
337
340
  @details = SBF::Client::Person::Occupation::EducationDetails.new(value)
338
341
  elsif military?
@@ -9,6 +9,7 @@ require 'stbaldricks/entities/memorial'
9
9
  require 'stbaldricks/entities/participant'
10
10
  require 'stbaldricks/entities/team'
11
11
  require 'stbaldricks/entities/lib/top_level'
12
+ require 'stbaldricks/entities/concerns/model_type_concern'
12
13
 
13
14
  module SBF
14
15
  module Client
@@ -114,6 +115,7 @@ module SBF
114
115
  end
115
116
 
116
117
  class FullParticipant < SBF::Client::FullParticipant
118
+ include ModelTypeConcern
117
119
  attr_reader :model_type
118
120
 
119
121
  def model_type
@@ -122,6 +124,7 @@ module SBF
122
124
  end
123
125
 
124
126
  class PartialParticipant < SBF::Client::PartialParticipant
127
+ include ModelTypeConcern
125
128
  attr_reader :model_type
126
129
 
127
130
  def model_type
@@ -130,6 +133,7 @@ module SBF
130
133
  end
131
134
 
132
135
  class FullFundraiser < SBF::Client::FullFundraiser
136
+ include ModelTypeConcern
133
137
  attr_reader :model_type
134
138
 
135
139
  def model_type
@@ -138,6 +142,7 @@ module SBF
138
142
  end
139
143
 
140
144
  class PartialFundraiser < SBF::Client::PartialFundraiser
145
+ include ModelTypeConcern
141
146
  attr_reader :model_type
142
147
 
143
148
  def model_type
@@ -146,6 +151,7 @@ module SBF
146
151
  end
147
152
 
148
153
  class FullTeam < SBF::Client::FullTeam
154
+ include ModelTypeConcern
149
155
  attr_reader :model_type
150
156
 
151
157
  def model_type
@@ -154,6 +160,7 @@ module SBF
154
160
  end
155
161
 
156
162
  class PartialTeam < SBF::Client::PartialTeam
163
+ include ModelTypeConcern
157
164
  attr_reader :model_type
158
165
 
159
166
  def model_type
@@ -162,6 +169,7 @@ module SBF
162
169
  end
163
170
 
164
171
  class FullEvent < SBF::Client::FullEvent
172
+ include ModelTypeConcern
165
173
  attr_reader :model_type
166
174
 
167
175
  def model_type
@@ -170,6 +178,7 @@ module SBF
170
178
  end
171
179
 
172
180
  class PartialEvent < SBF::Client::PartialEvent
181
+ include ModelTypeConcern
173
182
  attr_reader :model_type
174
183
 
175
184
  def model_type
@@ -178,6 +187,7 @@ module SBF
178
187
  end
179
188
 
180
189
  class FullKid < SBF::Client::FullKid
190
+ include ModelTypeConcern
181
191
  attr_reader :model_type
182
192
 
183
193
  def model_type
@@ -186,6 +196,7 @@ module SBF
186
196
  end
187
197
 
188
198
  class PartialKid < SBF::Client::PartialKid
199
+ include ModelTypeConcern
189
200
  attr_reader :model_type
190
201
 
191
202
  def model_type
@@ -194,6 +205,7 @@ module SBF
194
205
  end
195
206
 
196
207
  class FullFund < SBF::Client::FullFund
208
+ include ModelTypeConcern
197
209
  attr_reader :model_type
198
210
 
199
211
  def model_type
@@ -202,6 +214,7 @@ module SBF
202
214
  end
203
215
 
204
216
  class PartialFund < SBF::Client::PartialFund
217
+ include ModelTypeConcern
205
218
  attr_reader :model_type
206
219
 
207
220
  def model_type
@@ -210,6 +223,7 @@ module SBF
210
223
  end
211
224
 
212
225
  class FullCampaign < SBF::Client::FullCampaign
226
+ include ModelTypeConcern
213
227
  attr_reader :model_type
214
228
 
215
229
  def model_type
@@ -218,6 +232,7 @@ module SBF
218
232
  end
219
233
 
220
234
  class PartialCampaign < SBF::Client::PartialCampaign
235
+ include ModelTypeConcern
221
236
  attr_reader :model_type
222
237
 
223
238
  def model_type
@@ -226,6 +241,7 @@ module SBF
226
241
  end
227
242
 
228
243
  class FullEventSupporter < SBF::Client::FullEventSupporter
244
+ include ModelTypeConcern
229
245
  attr_reader :model_type
230
246
 
231
247
  def model_type
@@ -234,6 +250,7 @@ module SBF
234
250
  end
235
251
 
236
252
  class PartialEventSupporter < SBF::Client::PartialEventSupporter
253
+ include ModelTypeConcern
237
254
  attr_reader :model_type
238
255
 
239
256
  def model_type
@@ -242,6 +259,7 @@ module SBF
242
259
  end
243
260
 
244
261
  class FullMemorial < SBF::Client::FullMemorial
262
+ include ModelTypeConcern
245
263
  attr_reader :model_type
246
264
 
247
265
  def model_type
@@ -250,6 +268,7 @@ module SBF
250
268
  end
251
269
 
252
270
  class PartialMemorial < SBF::Client::PartialMemorial
271
+ include ModelTypeConcern
253
272
  attr_reader :model_type
254
273
 
255
274
  def model_type
@@ -11,6 +11,7 @@ require 'stbaldricks/entities/lib/top_level'
11
11
  require 'stbaldricks/entities/lib/name'
12
12
  require 'stbaldricks/entities/lib/payment'
13
13
  require 'stbaldricks/entities/lib/default_cacheable'
14
+ require 'stbaldricks/entities/concerns/model_type_concern'
14
15
 
15
16
  module SBF
16
17
  module Client
@@ -52,6 +53,7 @@ module SBF
52
53
  end
53
54
 
54
55
  class FullParticipant < SBF::Client::FullParticipant
56
+ include ModelTypeConcern
55
57
  attr_reader :model_type
56
58
 
57
59
  def model_type
@@ -60,6 +62,7 @@ module SBF
60
62
  end
61
63
 
62
64
  class PartialParticipant < SBF::Client::PartialParticipant
65
+ include ModelTypeConcern
63
66
  attr_reader :model_type
64
67
 
65
68
  def model_type
@@ -68,6 +71,7 @@ module SBF
68
71
  end
69
72
 
70
73
  class FullFundraiser < SBF::Client::FullFundraiser
74
+ include ModelTypeConcern
71
75
  attr_reader :model_type
72
76
 
73
77
  def model_type
@@ -76,6 +80,7 @@ module SBF
76
80
  end
77
81
 
78
82
  class PartialFundraiser < SBF::Client::PartialFundraiser
83
+ include ModelTypeConcern
79
84
  attr_reader :model_type
80
85
 
81
86
  def model_type
@@ -84,6 +89,7 @@ module SBF
84
89
  end
85
90
 
86
91
  class FullTeam < SBF::Client::FullTeam
92
+ include ModelTypeConcern
87
93
  attr_reader :model_type
88
94
 
89
95
  def model_type
@@ -92,6 +98,7 @@ module SBF
92
98
  end
93
99
 
94
100
  class PartialTeam < SBF::Client::PartialTeam
101
+ include ModelTypeConcern
95
102
  attr_reader :model_type
96
103
 
97
104
  def model_type
@@ -100,6 +107,7 @@ module SBF
100
107
  end
101
108
 
102
109
  class FullEvent < SBF::Client::FullEvent
110
+ include ModelTypeConcern
103
111
  attr_reader :model_type
104
112
 
105
113
  def model_type
@@ -108,6 +116,7 @@ module SBF
108
116
  end
109
117
 
110
118
  class PartialEvent < SBF::Client::PartialEvent
119
+ include ModelTypeConcern
111
120
  attr_reader :model_type
112
121
 
113
122
  def model_type
@@ -116,6 +125,7 @@ module SBF
116
125
  end
117
126
 
118
127
  class FullFund < SBF::Client::FullFund
128
+ include ModelTypeConcern
119
129
  attr_reader :model_type
120
130
 
121
131
  def model_type
@@ -124,6 +134,7 @@ module SBF
124
134
  end
125
135
 
126
136
  class PartialFund < SBF::Client::PartialFund
137
+ include ModelTypeConcern
127
138
  attr_reader :model_type
128
139
 
129
140
  def model_type
@@ -1,5 +1,5 @@
1
1
  module SBF
2
2
  module Client
3
- VERSION = '4.4.0.alpha.2'
3
+ VERSION = '4.4.0.alpha.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stbaldricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0.alpha.2
4
+ version: 4.4.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
@@ -104,6 +104,8 @@ files:
104
104
  - lib/stbaldricks/entities/challenger.rb
105
105
  - lib/stbaldricks/entities/challenger/model_type.rb
106
106
  - lib/stbaldricks/entities/communicate.rb
107
+ - lib/stbaldricks/entities/concerns/model_type_concern.rb
108
+ - lib/stbaldricks/entities/concerns/type_concern.rb
107
109
  - lib/stbaldricks/entities/config.rb
108
110
  - lib/stbaldricks/entities/contact.rb
109
111
  - lib/stbaldricks/entities/contact_group.rb