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

duplicating Ying's fix for notes, to cleanup git history [#140355915] #139

Merged
merged 3 commits into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 5 additions & 5 deletions app/mailers/notifier.rb
Expand Up @@ -49,7 +49,7 @@ def notify_user(project_role, service_request, xls, approval, user_current, audi
@portal_link = DASHBOARD_LINK + "/protocols/#{@protocol.id}"

@ssrs_to_be_displayed = service_request.sub_service_requests

attachments["service_request_#{@service_request.protocol.id}.xlsx"] = xls

# only send these to the correct person in the production env
Expand All @@ -61,7 +61,7 @@ def notify_user(project_role, service_request, xls, approval, user_current, audi

def notify_admin(submission_email_address, xls, user_current, ssr, audit_report=nil, ssr_destroyed=false)
@ssr_deleted = false
@notes = ssr.service_request.notes
@notes = ssr.protocol.notes

if ssr_destroyed
@status = 'ssr_destroyed'
Expand Down Expand Up @@ -95,7 +95,7 @@ def notify_admin(submission_email_address, xls, user_current, ssr, audit_report=
end

def notify_service_provider(service_provider, service_request, attachments_to_add, user_current, ssr_id, audit_report=nil, ssr_destroyed=false, request_amendment=false)
@notes = service_request.notes
@notes = service_request.protocol.notes

if ssr_destroyed
@status = 'ssr_destroyed'
Expand All @@ -104,7 +104,7 @@ def notify_service_provider(service_provider, service_request, attachments_to_ad
else
@status = service_request.status
end

@role = 'none'
@full_name = service_provider.identity.full_name

Expand All @@ -113,7 +113,7 @@ def notify_service_provider(service_provider, service_request, attachments_to_ad
@service_requester_id = @service_request.sub_service_requests.first.service_requester_id

@audit_report = audit_report

@portal_link = DASHBOARD_LINK + "/protocols/#{@protocol.id}"
@portal_text = "Administrators/Service Providers, Click Here"

Expand Down
2 changes: 1 addition & 1 deletion spec/factories/note.rb
Expand Up @@ -22,7 +22,7 @@

factory :note do
body { Faker::Lorem.sentence(1) }
notable_type { "ServiceRequest" }
notable_type { "Protocol" }

trait :without_validations do
to_create { |instance| instance.save(validate: false) }
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/notifier/request_amendment_spec.rb
Expand Up @@ -345,7 +345,7 @@
before do
create(:note_without_validations,
identity_id: identity.id,
notable_id: service_request.id)
notable_id: service_request.protocol.id)
service_request.update_attribute(:submitted_at, Time.now.yesterday)
deleted_and_created_line_item_audit_trail(service_request, service3, identity)
ssr = service_request.sub_service_requests.first
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/notifier/submitted_spec.rb
Expand Up @@ -199,7 +199,7 @@
before do
create(:note_without_validations,
identity_id: identity.id,
notable_id: service_request.id)
notable_id: service_request.protocol.id)
end

context 'service_provider' do
Expand Down