Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jl - Service and service provider relation cleanup #1415

Merged
merged 2 commits into from Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion app/models/service.rb
Expand Up @@ -34,7 +34,6 @@ class Service < ApplicationRecord
belongs_to :revenue_code_range
# set ":inverse_of => :service" so that the first pricing map can be validated before the service has been saved
has_many :pricing_maps, :inverse_of => :service, :dependent => :destroy
has_many :service_providers, :dependent => :destroy
has_many :sub_service_requests, through: :line_items
has_many :service_requests, through: :sub_service_requests
has_many :line_items, :dependent => :destroy
Expand Down
1 change: 0 additions & 1 deletion app/models/service_provider.rb
Expand Up @@ -23,5 +23,4 @@ class ServiceProvider < ApplicationRecord

belongs_to :organization
belongs_to :identity
belongs_to :service
end
5 changes: 0 additions & 5 deletions spec/factories/service.rb
Expand Up @@ -103,7 +103,6 @@
# create any additional pricing maps.
line_item_count = evaluator.line_items.count > 0 ? 0 : evaluator.line_item_count
pricing_map_count = evaluator.pricing_maps.count > 0 ? 0 : evaluator.pricing_map_count
service_provider_count = evaluator.service_providers.count > 0 ? 0 : evaluator.service_provider_count
service_relation_count = evaluator.service_relations.count > 0 ? 0 : evaluator.service_relation_count

# We were using create_list, but this will not
Expand All @@ -117,10 +116,6 @@
service.pricing_maps.build(attributes_for(:pricing_map))
end

service_provider_count.times do
service.service_providers.build(attributes_for(:service_provider))
end

service_relation_count.times do
service.service_relations.build(attributes_for(:service_relation))
end
Expand Down