Skip to content

Commit 6aad96c

Browse files
committed
Rename WorkerInvitationFilter to WorkerFilter
1 parent ad1cc95 commit 6aad96c

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cirro-ruby-client (1.2.3)
4+
cirro-ruby-client (1.3.0)
55
faraday (< 1.2.0)
66
faraday_middleware
77
json_api_client (>= 1.10.0)
@@ -85,7 +85,7 @@ GEM
8585
rubocop-rspec (1.43.2)
8686
rubocop (~> 0.87)
8787
ruby-progressbar (1.10.1)
88-
ruby2_keywords (0.0.2)
88+
ruby2_keywords (0.0.4)
8989
tzinfo (2.0.4)
9090
concurrent-ruby (~> 1.0)
9191
unicode-display_width (1.7.0)

lib/cirro_io/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require 'cirro_io/client/gig_invitation'
99
require 'cirro_io/client/app_user'
1010
require 'cirro_io/client/app_worker'
11-
require 'cirro_io/client/worker_invitation_filter'
11+
require 'cirro_io/client/worker_filter'
1212
require 'cirro_io/client/gig_task'
1313
require 'cirro_io/client/gig_result'
1414
require 'cirro_io/client/gig_time_activity'

lib/cirro_io/client/gig.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module CirroIO
22
module Client
33
class Gig < Base
4-
has_one :worker_invitation_filter
4+
has_one :worker_filter
55
has_many :gig_tasks
66
has_many :gig_results
77
has_many :gig_time_activities
88

99
# rubocop:disable Metrics/AbcSize
10-
def bulk_create_with(worker_invitation_filter, gig_tasks)
10+
def bulk_create_with(worker_filter, gig_tasks)
1111
payload = { data: { attributes: attributes, relationships: {} } }
1212
payload[:data][:relationships][:gig_tasks] = gig_tasks.map(&:attributes)
13-
payload[:data][:relationships][:worker_invitation_filter] = worker_invitation_filter.attributes
13+
payload[:data][:relationships][:worker_filter] = worker_filter.attributes
1414

1515
response = self.class.custom_post('bulk/gigs', format_to_dashed_keys(payload))
1616

lib/cirro_io/client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# rubocop:disable Style/MutableConstant
22
module CirroIO
33
module Client
4-
VERSION = '1.2.3'
4+
VERSION = '1.3.0'
55
end
66
end
77
# rubocop:enable Style/MutableConstant
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module CirroIO
22
module Client
3-
class WorkerInvitationFilter < Base
3+
class WorkerFilter < Base
44
end
55
end
66
end

spec/cirro_io/client/gig_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
archive_at: 1.month.from_now)
1414
end
1515

16-
let(:worker_invitation_filter) { CirroIO::Client::WorkerInvitationFilter.new(filter_query: '{}') }
16+
let(:worker_filter) { CirroIO::Client::WorkerFilter.new(filter_query: '{}') }
1717
let(:gig_task1) { CirroIO::Client::GigTask.new(title: Faker::Hipster.sentence, base_price: 5) }
1818
let(:gig_task2) { CirroIO::Client::GigTask.new(title: Faker::Hipster.sentence, base_price: 10) }
1919

2020
it 'bulk create a gig with gig tasks and filter query' do
2121
stub_request(:post, "#{test_site}/v1/bulk/gigs")
2222
.to_return(body: File.read('./spec/fixtures/gig_with_filter_and_gig_tasks.json'), headers: { 'Content-Type' => 'application/json' })
2323

24-
created_gig = gig.bulk_create_with(worker_invitation_filter, [gig_task1, gig_task2])
24+
created_gig = gig.bulk_create_with(worker_filter, [gig_task1, gig_task2])
2525

2626
expect(created_gig).to be_valid
2727
expect(created_gig.id).to eq('15')
28-
expect(created_gig.worker_invitation_filter.id).to eq('20')
28+
expect(created_gig.worker_filter.id).to eq('20')
2929
expect(created_gig.gig_tasks.map(&:id)).to eq(%w[24 25])
3030
end
3131
end

spec/fixtures/gig_with_filter_and_gig_tasks.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"archive-at": "2020-12-30T10:27:18.000Z"
1515
},
1616
"relationships": {
17-
"worker-invitation-filter": {
17+
"worker-filter": {
1818
"data": {
19-
"type": "worker-invitation-filters",
19+
"type": "worker-filters",
2020
"id": "20"
2121
}
2222
},
@@ -41,9 +41,9 @@
4141
"included": [
4242
{
4343
"id": "20",
44-
"type": "worker-invitation-filters",
44+
"type": "worker-filters",
4545
"links": {
46-
"self": "/api/v1/worker-invitation-filters/20"
46+
"self": "/api/v1/worker-filters/20"
4747
},
4848
"attributes": {
4949
"filter-query": "{}"

0 commit comments

Comments
 (0)