stbaldricks 10.9.0.alpha.1 → 10.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stbaldricks/endpoints/lib/entity.rb +7 -1
- data/lib/stbaldricks/entities/event.rb +3 -1
- data/lib/stbaldricks/entities/fundraiser.rb +23 -17
- data/lib/stbaldricks/entities/kid_institution.rb +2 -2
- data/lib/stbaldricks/entities/lib/milestone.rb +12 -0
- data/lib/stbaldricks/entities/participant.rb +23 -17
- data/lib/stbaldricks/version.rb +1 -1
- data/spec/factories/event.rb +1 -3
- data/spec/factories/kid_institution.rb +6 -2
- data/spec/factories/milestone.rb +15 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 443ed0baebb669698471fd40ec7402a3b6140413868949185c067c0caad94a23
|
4
|
+
data.tar.gz: 50d4ecb85a779af9cf6dc6e34cd736270b4aacd4a6fb8264a58b4ca1f5d9853b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0586f77cc00f363aa189bf7354a2251a368df531f52ce7d12b04e10fe8f15c6fbde09ad45139673352de47919f4127000b0cccf8a0195cf3c1eafd98131f59b
|
7
|
+
data.tar.gz: da502b8739690bd0b2c2fde38d074a6bc74d29dbcbe314122817d0ed7b1a3e11440a586a24195ccdb97cda56e79b77870054bf1a86bc2a36fff6b00854795101
|
@@ -199,13 +199,19 @@ module SBF
|
|
199
199
|
private :sanitize_entity
|
200
200
|
|
201
201
|
def reconstitute_with(entity)
|
202
|
-
return {}
|
202
|
+
return {} unless entity.class.respond_to?(:optional_attributes)
|
203
203
|
|
204
204
|
{}.tap do |hsh|
|
205
205
|
entity.class.optional_attributes.each do |attribute|
|
206
206
|
next if entity.not_provided_attributes.include?(attribute)
|
207
207
|
|
208
208
|
attribute_value = entity.send(attribute)
|
209
|
+
|
210
|
+
if attribute_value.is_a?(Array)
|
211
|
+
hsh[attribute] = attribute_value.inject({}) { |h, it| h.merge(reconstitute_with(it)) }
|
212
|
+
next
|
213
|
+
end
|
214
|
+
|
209
215
|
next if attribute_value.class.demodulize.start_with?('Partial')
|
210
216
|
next unless attribute_value.is_a? SBF::Client::BaseEntity
|
211
217
|
|
@@ -130,6 +130,7 @@ module SBF
|
|
130
130
|
OTHER = 'other'.freeze
|
131
131
|
LEGACY = 'legacy'.freeze
|
132
132
|
VIRTUAL = 'virtual'.freeze
|
133
|
+
HYBRID = 'hybrid'.freeze
|
133
134
|
end
|
134
135
|
|
135
136
|
attr_accessor :type
|
@@ -199,7 +200,8 @@ module SBF
|
|
199
200
|
end
|
200
201
|
|
201
202
|
def venue_virtual?
|
202
|
-
|
203
|
+
[SBF::Client::Event::Venue::Location::Type::VIRTUAL,
|
204
|
+
SBF::Client::Event::Venue::Location::Type::HYBRID].include? venue.location.type
|
203
205
|
end
|
204
206
|
|
205
207
|
def virtual?
|
@@ -109,32 +109,38 @@ module SBF
|
|
109
109
|
def_delegator :@photos, :avatar, :avatar_photo_url
|
110
110
|
|
111
111
|
attr_accessor :id
|
112
|
-
|
113
|
-
|
112
|
+
|
113
|
+
attr_reader :created_at, :modified_at
|
114
|
+
attr_reader :display_name
|
115
|
+
|
114
116
|
attr_accessor :category
|
115
117
|
attr_accessor :display_name_override
|
116
|
-
|
117
|
-
|
118
|
+
attr_accessor :facebook_fundraiser_id
|
119
|
+
attr_accessor :fund_relationship_type
|
120
|
+
attr_accessor :fundraising_goal, :fundraising_message
|
121
|
+
attr_accessor :how_created
|
122
|
+
attr_accessor :modified_by
|
123
|
+
attr_accessor :offline_donation_uuid, :offline_donation_form
|
118
124
|
attr_accessor :start_date, :end_date
|
119
125
|
attr_accessor :start_time, :end_time
|
120
|
-
attr_accessor :
|
121
|
-
attr_accessor :
|
122
|
-
|
126
|
+
attr_accessor :status
|
127
|
+
attr_accessor :title
|
128
|
+
|
129
|
+
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
|
130
|
+
entity_attr_reader :rankings, 'SBF::Client::Fundraiser::Rankings', nil, true
|
131
|
+
entity_attr_reader :totals, 'SBF::Client::Fundraiser::Totals'
|
132
|
+
|
123
133
|
entity_attr_accessor :event, 'SBF::Client::Fundraiser::FullEvent', 'SBF::Client::Fundraiser::PartialEvent', true
|
124
|
-
entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
|
125
|
-
attr_accessor :facebook_fundraiser_id
|
126
134
|
entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
|
127
|
-
|
128
|
-
entity_attr_accessor :
|
135
|
+
entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
|
136
|
+
entity_attr_accessor :owner, 'SBF::Client::FullPerson', 'SBF::Client::PartialPerson'
|
129
137
|
entity_attr_accessor :photos, 'SBF::Client::Fundraiser::Photos'
|
130
138
|
entity_attr_accessor :policies, 'SBF::Client::Fundraiser::Policies'
|
131
|
-
|
132
|
-
entity_attr_reader :totals, 'SBF::Client::Fundraiser::Totals'
|
133
|
-
attr_reader :created_at, :modified_at
|
134
|
-
attr_accessor :modified_by
|
135
|
-
attr_accessor :how_created
|
136
|
-
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
|
139
|
+
entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
|
137
140
|
entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
|
141
|
+
entity_attr_accessor :venue, 'SBF::Client::Venue'
|
142
|
+
|
143
|
+
entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, true
|
138
144
|
|
139
145
|
def active?
|
140
146
|
status == SBF::Client::Fundraiser::Status::ACTIVE
|
@@ -12,8 +12,8 @@ module SBF
|
|
12
12
|
blacklist_action :update
|
13
13
|
blacklist_action :aggregate
|
14
14
|
|
15
|
-
entity_attr_accessor :kid, 'SBF::Client::FullKid', 'SBF::Client::PartialKid'
|
16
|
-
entity_attr_accessor :institution, 'SBF::Client::FullInstitution', 'SBF::Client::PartialInstitution'
|
15
|
+
entity_attr_accessor :kid, 'SBF::Client::FullKid', 'SBF::Client::PartialKid', true
|
16
|
+
entity_attr_accessor :institution, 'SBF::Client::FullInstitution', 'SBF::Client::PartialInstitution', true
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -207,33 +207,39 @@ module SBF
|
|
207
207
|
def_delegator :@photos, :avatar, :avatar_photo_url
|
208
208
|
|
209
209
|
attr_accessor :id
|
210
|
-
|
211
|
-
|
210
|
+
|
211
|
+
attr_reader :created_at, :modified_at
|
212
212
|
attr_reader :display_name
|
213
|
-
|
214
|
-
|
215
|
-
entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
|
213
|
+
|
214
|
+
attr_accessor :display_name_override
|
216
215
|
attr_accessor :facebook_fundraiser_id
|
217
|
-
entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
|
218
216
|
attr_accessor :fund_relationship_type
|
219
|
-
attr_accessor :shirt_size
|
220
|
-
attr_accessor :offline_donation_uuid, :offline_donation_form
|
221
217
|
attr_accessor :fundraising_goal, :fundraising_message
|
222
|
-
|
223
|
-
entity_attr_reader :photos, 'SBF::Client::Participant::Photos'
|
224
|
-
entity_attr_accessor :policies, 'SBF::Client::Participant::Policies'
|
218
|
+
attr_accessor :how_created
|
225
219
|
attr_accessor :is_virtual
|
226
|
-
entity_attr_accessor :shave_schedule, 'SBF::Client::Participant::ShaveSchedule'
|
227
|
-
entity_attr_accessor :roles, 'SBF::Client::Participant::Roles', nil, true
|
228
|
-
entity_attr_reader :rankings, 'SBF::Client::Participant::Rankings', nil, true
|
229
|
-
entity_attr_reader :totals, 'SBF::Client::Participant::Totals'
|
230
|
-
attr_reader :created_at, :modified_at
|
231
220
|
attr_accessor :modified_by
|
232
|
-
attr_accessor :
|
221
|
+
attr_accessor :offline_donation_uuid, :offline_donation_form
|
222
|
+
attr_accessor :shirt_size
|
223
|
+
attr_accessor :status
|
224
|
+
|
233
225
|
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
|
234
226
|
entity_attr_reader :permissions_at_event, 'SBF::Client::PermissionsAtEvent', nil, true
|
227
|
+
entity_attr_reader :photos, 'SBF::Client::Participant::Photos'
|
228
|
+
entity_attr_reader :rankings, 'SBF::Client::Participant::Rankings', nil, true
|
229
|
+
entity_attr_reader :totals, 'SBF::Client::Participant::Totals'
|
230
|
+
|
231
|
+
entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', true
|
232
|
+
entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
|
233
|
+
entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
|
234
|
+
entity_attr_accessor :person, 'SBF::Client::FullPerson'
|
235
|
+
entity_attr_accessor :policies, 'SBF::Client::Participant::Policies'
|
236
|
+
entity_attr_accessor :roles, 'SBF::Client::Participant::Roles', nil, true
|
237
|
+
entity_attr_accessor :shave_schedule, 'SBF::Client::Participant::ShaveSchedule'
|
238
|
+
entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
|
235
239
|
entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
|
236
240
|
|
241
|
+
entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, true
|
242
|
+
|
237
243
|
def active?
|
238
244
|
status == SBF::Client::Participant::Status::ACTIVE
|
239
245
|
end
|
data/lib/stbaldricks/version.rb
CHANGED
data/spec/factories/event.rb
CHANGED
@@ -2,9 +2,7 @@ require_relative 'lib/helpers'
|
|
2
2
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :event, class: SBF::Client::FullEvent do
|
5
|
-
|
6
|
-
# we send to the api in the with so that we know we have the latest data. Fix and remove the with
|
7
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save(organizers: nil) }
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
8
6
|
|
9
7
|
initialize_with do
|
10
8
|
new(attributes)
|
@@ -4,8 +4,7 @@ FactoryBot.define do
|
|
4
4
|
# This is the relationship object between the kid and system institutions
|
5
5
|
factory :kid_institution, class: SBF::Client::KidInstitution do
|
6
6
|
to_create do |it|
|
7
|
-
|
8
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save(kid: {}, institution: {})
|
7
|
+
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save
|
9
8
|
end
|
10
9
|
|
11
10
|
initialize_with do
|
@@ -15,5 +14,10 @@ FactoryBot.define do
|
|
15
14
|
after :build do |kid_institution, evaluator|
|
16
15
|
kid_institution.institution = build(:institution) if unpopulated?(evaluator, :institution)
|
17
16
|
end
|
17
|
+
|
18
|
+
before :create do |kid_institution, evaluator|
|
19
|
+
kid_institution.institution = create(:institution) if unpopulated?(evaluator, :institution)
|
20
|
+
kid_institution.kid = create(:kid) if unpopulated?(evaluator, :kid)
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'faker'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :milestone, class: SBF::Client::Milestone do
|
5
|
+
skip_create
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
description { Faker::Games::Pokemon.move }
|
12
|
+
amount { rand(1..10_000) }
|
13
|
+
icon { rand(1..10) }
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stbaldricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.
|
4
|
+
version: 10.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -391,6 +391,7 @@ files:
|
|
391
391
|
- lib/stbaldricks/entities/lib/fundraising_page.rb
|
392
392
|
- lib/stbaldricks/entities/lib/geo_location.rb
|
393
393
|
- lib/stbaldricks/entities/lib/location.rb
|
394
|
+
- lib/stbaldricks/entities/lib/milestone.rb
|
394
395
|
- lib/stbaldricks/entities/lib/name.rb
|
395
396
|
- lib/stbaldricks/entities/lib/not_implemented_object.rb
|
396
397
|
- lib/stbaldricks/entities/lib/opt_out_settings.rb
|
@@ -493,6 +494,7 @@ files:
|
|
493
494
|
- spec/factories/memorial/totals.rb
|
494
495
|
- spec/factories/memorial/tribute.rb
|
495
496
|
- spec/factories/message.rb
|
497
|
+
- spec/factories/milestone.rb
|
496
498
|
- spec/factories/name_pieces.rb
|
497
499
|
- spec/factories/newsletter_recipient.rb
|
498
500
|
- spec/factories/organization.rb
|
@@ -552,9 +554,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
552
554
|
version: '0'
|
553
555
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
554
556
|
requirements:
|
555
|
-
- - "
|
557
|
+
- - ">="
|
556
558
|
- !ruby/object:Gem::Version
|
557
|
-
version:
|
559
|
+
version: '0'
|
558
560
|
requirements: []
|
559
561
|
rubygems_version: 3.0.3
|
560
562
|
signing_key:
|
@@ -614,6 +616,7 @@ test_files:
|
|
614
616
|
- spec/factories/kid/custom_institution.rb
|
615
617
|
- spec/factories/person.rb
|
616
618
|
- spec/factories/search_participant.rb
|
619
|
+
- spec/factories/milestone.rb
|
617
620
|
- spec/factories/fundraising_page.rb
|
618
621
|
- spec/factories/photos.rb
|
619
622
|
- spec/factories/team/totals.rb
|