Compare commits
15 Commits
make-email
...
add-csv-to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ffa883462 | ||
|
|
e0cf5ba875 | ||
|
|
ebc13242de | ||
|
|
8538613a83 | ||
|
|
fcb6e093c3 | ||
|
|
33bcb6600a | ||
|
|
d585d3cad3 | ||
|
|
578403bb5c | ||
|
|
2020761649 | ||
|
|
bb8e5c9b73 | ||
|
|
5ed930108d | ||
|
|
a1abd70ae9 | ||
|
|
3918484a84 | ||
|
|
35303cb570 | ||
|
|
1127f09263 |
11
app/controllers/api/medical_releases_controller.rb
Normal file
11
app/controllers/api/medical_releases_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Api::MedicalReleasesController < Api::ReleasesController
|
||||||
|
deserializable_resource :medical_release, only: [:create, :update]
|
||||||
|
|
||||||
|
def model_name
|
||||||
|
"medical_release"
|
||||||
|
end
|
||||||
|
|
||||||
|
def attributes_for_index
|
||||||
|
[:name]
|
||||||
|
end
|
||||||
|
end
|
||||||
11
app/controllers/api/misc_releases_controller.rb
Normal file
11
app/controllers/api/misc_releases_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Api::MiscReleasesController < Api::ReleasesController
|
||||||
|
deserializable_resource :misc_release, only: [:create, :update]
|
||||||
|
|
||||||
|
def model_name
|
||||||
|
"misc_release"
|
||||||
|
end
|
||||||
|
|
||||||
|
def attributes_for_index
|
||||||
|
[:name]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -10,8 +10,10 @@ class Api::SyncController < Api::ApiController
|
|||||||
@appearance_releases = (AppearanceRelease.where(project: accessible_projects))
|
@appearance_releases = (AppearanceRelease.where(project: accessible_projects))
|
||||||
@location_releases = (LocationRelease.where(project: accessible_projects))
|
@location_releases = (LocationRelease.where(project: accessible_projects))
|
||||||
@material_releases = (MaterialRelease.where(project: accessible_projects))
|
@material_releases = (MaterialRelease.where(project: accessible_projects))
|
||||||
|
@medical_releases = MedicalRelease.where(project: accessible_projects)
|
||||||
|
@misc_releases = MiscRelease.where(project: accessible_projects)
|
||||||
@talent_releases = (TalentRelease.where(project: accessible_projects))
|
@talent_releases = (TalentRelease.where(project: accessible_projects))
|
||||||
@notes = notes_query(Note.where(notable: @appearance_releases + @location_releases + @material_releases + @talent_releases + @acquired_media_releases ))
|
@notes = notes_query(Note.where(notable: @appearance_releases + @location_releases + @material_releases + @medical_releases + @misc_releases + @talent_releases + @acquired_media_releases ))
|
||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
data: {
|
data: {
|
||||||
@@ -22,6 +24,8 @@ class Api::SyncController < Api::ApiController
|
|||||||
appearance_releases: releases_query(@appearance_releases),
|
appearance_releases: releases_query(@appearance_releases),
|
||||||
location_releases: releases_query(@location_releases),
|
location_releases: releases_query(@location_releases),
|
||||||
material_releases: releases_query(@material_releases),
|
material_releases: releases_query(@material_releases),
|
||||||
|
medical_releases: releases_query(@medical_releases),
|
||||||
|
misc_releases: releases_query(@misc_releases),
|
||||||
talent_releases: releases_query(@talent_releases),
|
talent_releases: releases_query(@talent_releases),
|
||||||
notes: @notes
|
notes: @notes
|
||||||
}
|
}
|
||||||
|
|||||||
21
app/controllers/approvals_controller.rb
Normal file
21
app/controllers/approvals_controller.rb
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
class ApprovalsController < ApplicationController
|
||||||
|
include MedicalReleaseContext
|
||||||
|
|
||||||
|
before_action :set_medical_release
|
||||||
|
before_action :set_project
|
||||||
|
|
||||||
|
layout "project"
|
||||||
|
|
||||||
|
def create
|
||||||
|
@medical_release.approve_by(current_user)
|
||||||
|
if @medical_release.save
|
||||||
|
redirect_to [@project, :medical_releases], notice: t('.release_approved')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_project
|
||||||
|
@project = @medical_release.project
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -5,4 +5,12 @@ module TooltipHelper
|
|||||||
concat tag.div(class: "tooltip-inner")
|
concat tag.div(class: "tooltip-inner")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_approval_data_for_medical_release(medical_release)
|
||||||
|
if medical_release.approved_by_user_name.present?
|
||||||
|
"#{medical_release.approved_by_user_name} [#{medical_release.approved_by_user_email}]"
|
||||||
|
else
|
||||||
|
medical_release.approved_by_user_email
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ class GenerateContractsZipJob < ApplicationJob
|
|||||||
before_perform do |job|
|
before_perform do |job|
|
||||||
@project = job.arguments.first
|
@project = job.arguments.first
|
||||||
@download = job.arguments.second
|
@download = job.arguments.second
|
||||||
release_type = job.arguments.third
|
@release_type = job.arguments.third
|
||||||
@folder_name = "#{@project.name.parameterize}_#{get_release_name(release_type).gsub('_', '-')}"
|
@folder_name = "#{@project.name.parameterize}_#{get_release_name(@release_type).gsub('_', '-')}"
|
||||||
@download.update!(name: @folder_name, status: :pending)
|
@download.update!(name: @folder_name, status: :pending)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -20,6 +20,11 @@ class GenerateContractsZipJob < ApplicationJob
|
|||||||
files.each do |attachment|
|
files.each do |attachment|
|
||||||
zipfile.add(attachment, File.join("#{dir}/", attachment))
|
zipfile.add(attachment, File.join("#{dir}/", attachment))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @release_type.constantize.include?(CsvExportable)
|
||||||
|
csv_file = generate_csv releases
|
||||||
|
zipfile.get_output_stream("#{@folder_name}.csv") { |f| f.puts(csv_file) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@download.file.attach(io: File.open(zipfile_name), filename: "#{@folder_name}.zip")
|
@download.file.attach(io: File.open(zipfile_name), filename: "#{@folder_name}.zip")
|
||||||
@@ -43,6 +48,19 @@ class GenerateContractsZipJob < ApplicationJob
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def generate_csv(releases)
|
||||||
|
release_class = @release_type.constantize
|
||||||
|
headers = release_class.csv_headers
|
||||||
|
|
||||||
|
CSV.generate(headers: true) do |csv|
|
||||||
|
csv << headers
|
||||||
|
releases.each do |release|
|
||||||
|
csv_row_data = release.to_csv_row
|
||||||
|
csv << csv_row_data
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def get_release_name(release_type)
|
def get_release_name(release_type)
|
||||||
release_type.constantize.model_name.plural
|
release_type.constantize.model_name.plural
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ class AcquiredMediaRelease < ApplicationRecord
|
|||||||
include Signable
|
include Signable
|
||||||
include Syncable
|
include Syncable
|
||||||
include PersonName
|
include PersonName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name file_infos_count]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
has_many :file_infos, as: :releasable, dependent: :destroy
|
has_many :file_infos, as: :releasable, dependent: :destroy
|
||||||
|
|
||||||
@@ -57,4 +64,8 @@ class AcquiredMediaRelease < ApplicationRecord
|
|||||||
def uses_edl?
|
def uses_edl?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def file_infos_count
|
||||||
|
file_infos.any? ? file_infos.size : I18n.t('acquired_media_releases.acquired_media_release.no_media')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ class AppearanceRelease < ApplicationRecord
|
|||||||
include SecondGuardianPhotoable
|
include SecondGuardianPhotoable
|
||||||
include GuardianName
|
include GuardianName
|
||||||
include SecondGuardianName
|
include SecondGuardianName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name contact_info]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
has_one_attached :person_photo
|
has_one_attached :person_photo
|
||||||
|
|
||||||
|
|||||||
56
app/models/concerns/csv_exportable.rb
Normal file
56
app/models/concerns/csv_exportable.rb
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module CsvExportable
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
COMMON_HEADERS = %i[notes tags signed_at].freeze
|
||||||
|
COMMON_VALUES = %w[clean_notes clean_tags signed_on].freeze
|
||||||
|
|
||||||
|
included do
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
|
||||||
|
def csv_headers
|
||||||
|
headers = custom_csv_exportable_headers + COMMON_HEADERS
|
||||||
|
|
||||||
|
headers.map do |header|
|
||||||
|
I18n.t("#{model_name.plural}.index.table_headers.#{header}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_csv_row
|
||||||
|
(self.class.custom_csv_exportable_headers + COMMON_VALUES).map do |function|
|
||||||
|
send(function)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def contact_info
|
||||||
|
contact_info = ''
|
||||||
|
contact_info += "#{person_address}; " if person_address.present?
|
||||||
|
contact_info += "P: #{person_phone}; " if person_phone.present?
|
||||||
|
contact_info += "E: #{person_email}" if person_email.present?
|
||||||
|
contact_info.delete_suffix '; '
|
||||||
|
end
|
||||||
|
|
||||||
|
def clean_notes
|
||||||
|
notes = ''
|
||||||
|
self.notes.order_by_recent.each do |note|
|
||||||
|
notes += "#{note.content}(#{note.email}), "
|
||||||
|
end
|
||||||
|
notes.delete_suffix ', '
|
||||||
|
end
|
||||||
|
|
||||||
|
def clean_tags
|
||||||
|
tags = ''
|
||||||
|
self.tags.each do |tag|
|
||||||
|
tags += "#{tag.name}, "
|
||||||
|
end
|
||||||
|
tags.delete_suffix ', '
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -10,6 +10,13 @@ class LocationRelease < ApplicationRecord
|
|||||||
include Syncable
|
include Syncable
|
||||||
include Taggable
|
include Taggable
|
||||||
include PersonName
|
include PersonName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name address]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
composed_of :address,
|
composed_of :address,
|
||||||
mapping: [
|
mapping: [
|
||||||
|
|||||||
@@ -10,8 +10,15 @@ class MaterialRelease < ApplicationRecord
|
|||||||
include Syncable
|
include Syncable
|
||||||
include Taggable
|
include Taggable
|
||||||
include PersonName
|
include PersonName
|
||||||
|
include CsvExportable
|
||||||
composed_of :person_address,
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
composed_of :person_address,
|
||||||
class_name: "Address",
|
class_name: "Address",
|
||||||
mapping: [
|
mapping: [
|
||||||
%w(person_address_street1 street1),
|
%w(person_address_street1 street1),
|
||||||
@@ -30,15 +37,15 @@ class MaterialRelease < ApplicationRecord
|
|||||||
validates :signature, attached: true
|
validates :signature, attached: true
|
||||||
end
|
end
|
||||||
|
|
||||||
searchable_on %i[
|
searchable_on %i[
|
||||||
name
|
name
|
||||||
person_address_street1 person_address_street2 person_address_city person_address_state person_address_zip person_address_country
|
person_address_street1 person_address_street2 person_address_city person_address_state person_address_zip person_address_country
|
||||||
]
|
]
|
||||||
|
|
||||||
def contact_person
|
def contact_person
|
||||||
@contact_person ||= Contact.new(person_name, person_address, person_email, person_phone)
|
@contact_person ||= Contact.new(person_name, person_address, person_email, person_phone)
|
||||||
end
|
end
|
||||||
|
|
||||||
def minor?
|
def minor?
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ class MedicalRelease < ApplicationRecord
|
|||||||
include SecondGuardianPhotoable
|
include SecondGuardianPhotoable
|
||||||
include GuardianName
|
include GuardianName
|
||||||
include SecondGuardianName
|
include SecondGuardianName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[approved? name contact_info]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
NUMBER_OF_CUSTOM_FIELDS = 15
|
NUMBER_OF_CUSTOM_FIELDS = 15
|
||||||
|
|
||||||
@@ -100,6 +107,18 @@ class MedicalRelease < ApplicationRecord
|
|||||||
"#{project.name.parameterize}_#{contract_template.release_type}_#{(signed_at || created_at).strftime("%Y.%m.%d")}_#{release_number}_#{filename_suffix.parameterize}"
|
"#{project.name.parameterize}_#{contract_template.release_type}_#{(signed_at || created_at).strftime("%Y.%m.%d")}_#{release_number}_#{filename_suffix.parameterize}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def approve_by(user)
|
||||||
|
return unless approved_at.nil?
|
||||||
|
|
||||||
|
self.approved_by_user_name = user.full_name
|
||||||
|
self.approved_by_user_email = user.email
|
||||||
|
self.approved_at = Time.zone.now
|
||||||
|
end
|
||||||
|
|
||||||
|
def approved?
|
||||||
|
approved_at.present?
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def valid_answers
|
def valid_answers
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ class MiscRelease < ApplicationRecord
|
|||||||
include PersonName
|
include PersonName
|
||||||
include GuardianName
|
include GuardianName
|
||||||
include GuardianPhotoable
|
include GuardianPhotoable
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name contact_info]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
NUMBER_OF_CUSTOM_FIELDS = 15
|
NUMBER_OF_CUSTOM_FIELDS = 15
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,14 @@ class MusicRelease < ApplicationRecord
|
|||||||
include Searchable
|
include Searchable
|
||||||
include Taggable
|
include Taggable
|
||||||
include PersonName
|
include PersonName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name file_infos_count composers_count publishers_count]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
has_many :file_infos, as: :releasable, dependent: :destroy
|
has_many :file_infos, as: :releasable, dependent: :destroy
|
||||||
has_many :composers, dependent: :destroy
|
has_many :composers, dependent: :destroy
|
||||||
has_many :publishers, dependent: :destroy
|
has_many :publishers, dependent: :destroy
|
||||||
@@ -72,6 +79,18 @@ class MusicRelease < ApplicationRecord
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def file_infos_count
|
||||||
|
file_infos.size
|
||||||
|
end
|
||||||
|
|
||||||
|
def composers_count
|
||||||
|
composers.size
|
||||||
|
end
|
||||||
|
|
||||||
|
def publishers_count
|
||||||
|
publishers.size
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def publisher_percentages_add_up_to_100
|
def publisher_percentages_add_up_to_100
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ class TalentRelease < ApplicationRecord
|
|||||||
include SecondGuardianPhotoable
|
include SecondGuardianPhotoable
|
||||||
include GuardianName
|
include GuardianName
|
||||||
include SecondGuardianName
|
include SecondGuardianName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def custom_csv_exportable_headers
|
||||||
|
%i[name phone email]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
composed_of :person_address,
|
composed_of :person_address,
|
||||||
class_name: "Address",
|
class_name: "Address",
|
||||||
@@ -86,6 +93,14 @@ class TalentRelease < ApplicationRecord
|
|||||||
person_name
|
person_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def phone
|
||||||
|
person_phone
|
||||||
|
end
|
||||||
|
|
||||||
|
def email
|
||||||
|
person_email
|
||||||
|
end
|
||||||
|
|
||||||
def filename_suffix
|
def filename_suffix
|
||||||
"#{person_last_name} #{person_first_name}"
|
"#{person_last_name} #{person_first_name}"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,6 +15,14 @@ class MedicalReleasePolicy < ReleasePolicy
|
|||||||
user.manager? || user.account_manager?
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def review?
|
||||||
|
user.account_manager?
|
||||||
|
end
|
||||||
|
|
||||||
|
def approve?
|
||||||
|
review?
|
||||||
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
15
app/views/approvals/new.html.erb
Normal file
15
app/views/approvals/new.html.erb
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<div class="card shadow-sm">
|
||||||
|
<%= card_header text: t(".heading"), close_action_path: [@project, :medical_releases] %>
|
||||||
|
<div class="card-body">
|
||||||
|
<embed class="embeded-contract-preview" type="application/pdf" src="<%= url_for [@medical_release, :contracts, format: "pdf"] %>" width="90%" height="1200" />
|
||||||
|
|
||||||
|
<%= bootstrap_form_with model: @medical_release, method: :post, url: medical_release_approvals_path(@medical_release), local: true do |form| %>
|
||||||
|
<div class="row align-items-center text-center mt-4">
|
||||||
|
<%= link_to t("shared.cancel"), [@medical_release.project, :medical_releases], class: "col-3 text-reset" %>
|
||||||
|
<div class="col-9">
|
||||||
|
<%= form.button t('.actions.approve'), id: "approve_release", class: class_string("btn btn-block btn-success btn-primary"), data: { disable_with: t("shared.disable_with") } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= contract_template.releases.size %>
|
<%= contract_template.releases.size %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td class="text-right" nowrap>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
|
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
|||||||
13
app/views/contracts/_for_office_use_only.erb
Normal file
13
app/views/contracts/_for_office_use_only.erb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<% if preview %>
|
||||||
|
<h1>PREVIEW ONLY</h1>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<p class="heading"><strong><u><%= t '.heading' %></u></strong></p>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<%= description_list_pair t('.description_labels.producer'), releasable.project.account.name %>
|
||||||
|
<%= description_list_pair t('.description_labels.production'), releasable.project.name %>
|
||||||
|
<%= description_list_pair t('.description_labels.employee_issued_to'), releasable.name %>
|
||||||
|
<%= description_list_pair t('.description_labels.issued_by'), releasable.approved_by_user_name %>
|
||||||
|
<%= description_list_pair t('.description_labels.date_issued'), releasable.approved_at %>
|
||||||
|
</dl>
|
||||||
@@ -25,6 +25,13 @@
|
|||||||
<div class="page">
|
<div class="page">
|
||||||
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if releasable.class == MedicalRelease && releasable.approved? %>
|
||||||
|
<div class="page">
|
||||||
|
<%= render "contracts/for_office_use_only", releasable: releasable, preview: preview %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if releasable.class == AcquiredMediaRelease %>
|
<% if releasable.class == AcquiredMediaRelease %>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<%= render "contracts/files", release: releasable, preview: preview %>
|
<%= render "contracts/files", release: releasable, preview: preview %>
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
<tr id="<%= dom_id(medical_release) %>">
|
<tr id="<%= dom_id(medical_release) %>">
|
||||||
<td data-behavior="select"><%= check_box_tag "medical_release_ids[]", medical_release.id, false %></td>
|
<td data-behavior="select"><%= check_box_tag "medical_release_ids[]", medical_release.id, false %></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<% if medical_release.approved? %>
|
||||||
|
<% tooltip_user_data = get_approval_data_for_medical_release(medical_release) %>
|
||||||
|
<i class="fa fa-check-circle fa-2x text-success"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
title="<%= t '.messages.approved_tooltip', user: tooltip_user_data, timestamp: medical_release.approved_at %>"></i>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<% if medical_release.photo.attached? %>
|
<% if medical_release.photo.attached? %>
|
||||||
<%= image_tag medium_variant(medical_release.photo), class: "img-fluid" %>
|
<%= image_tag medium_variant(medical_release.photo), class: "img-fluid" %>
|
||||||
@@ -37,6 +45,9 @@
|
|||||||
<% if policy(medical_release.tags).new? %>
|
<% if policy(medical_release.tags).new? %>
|
||||||
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, medical_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, medical_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if policy(MedicalRelease).review? %>
|
||||||
|
<%= link_to fa_icon("search fw", text: t('.actions.review')), new_medical_release_approvals_path(medical_release), class: "dropdown-item" %>
|
||||||
|
<% end %>
|
||||||
<% if policy(MedicalRelease).download_single? && policy(Contract).show? && (medical_release.contract.attached? || medical_release.contract_template.present?) %>
|
<% if policy(MedicalRelease).download_single? && policy(Contract).show? && (medical_release.contract.attached? || medical_release.contract_template.present?) %>
|
||||||
<%= link_to fa_icon("download fw", text: "Download"), [medical_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
<%= link_to fa_icon("download fw", text: "Download"), [medical_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-behavior="all-selectable"><%= check_box_tag "medical_release_ids[]", false, false %></th>
|
<th data-behavior="all-selectable"><%= check_box_tag "medical_release_ids[]", false, false %></th>
|
||||||
|
<th><%= t '.table_headers.approved'%></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th><%= MedicalRelease.human_attribute_name(:person_name) %></th>
|
<th><%= MedicalRelease.human_attribute_name(:person_name) %></th>
|
||||||
<th><%= MedicalRelease.human_attribute_name(:contact_info) %></th>
|
<th><%= MedicalRelease.human_attribute_name(:contact_info) %></th>
|
||||||
|
|||||||
15
app/views/medical_releases/review.html.erb
Normal file
15
app/views/medical_releases/review.html.erb
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<div class="card shadow-sm">
|
||||||
|
<%= card_header text: t(".heading"), close_action_path: [@project, :medical_releases] %>
|
||||||
|
<div class="card-body">
|
||||||
|
<embed class="embeded-contract-preview" type="application/pdf" src="<%= url_for [@medical_release, :contracts, format: "pdf"] %>" width="90%" height="1200" />
|
||||||
|
|
||||||
|
<%= bootstrap_form_with model: @medical_release, method: :patch, url: [:approve, @medical_release], local: true do |form| %>
|
||||||
|
<div class="row align-items-center text-center mt-4">
|
||||||
|
<%= link_to t("shared.cancel"), [@medical_release.project, :medical_releases], class: "col-3 text-reset" %>
|
||||||
|
<div class="col-9">
|
||||||
|
<%= form.button t('.actions.approve'), id: "approve_release", class: class_string("btn btn-block btn-success btn-primary"), data: { disable_with: t("shared.disable_with") } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -39,9 +39,7 @@
|
|||||||
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||||
</div>
|
<%= form.email_field :person_email, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<div class="form-row">
|
|
||||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -13,4 +13,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p class="alert alert-success p-3 lead text-center"><%= t '.success_message' %></p>
|
<p class="alert alert-success p-3 lead text-center"><%= t '.success_message' %></p>
|
||||||
<%= link_to fa_icon("check", text: "Done"), [@project, :task_requests], class: "btn btn-primary" %>
|
<%= link_to fa_icon("arrow-left", text: "Back"), [@project, :task_requests], class: "btn btn-primary" %>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ en:
|
|||||||
empty: Acquired Media Releases will appear here
|
empty: Acquired Media Releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
file_infos_count: No. Files
|
file_infos_count: No. Files
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
@@ -151,6 +152,8 @@ en:
|
|||||||
empty: Appearance Releases will appear here
|
empty: Appearance Releases will appear here
|
||||||
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release
|
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release
|
||||||
table_headers:
|
table_headers:
|
||||||
|
contact_info: Contact info
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
@@ -171,6 +174,13 @@ en:
|
|||||||
sidebar:
|
sidebar:
|
||||||
files: Files
|
files: Files
|
||||||
team_member: Team Member
|
team_member: Team Member
|
||||||
|
approvals:
|
||||||
|
create:
|
||||||
|
release_approved: Medical release has been approved
|
||||||
|
new:
|
||||||
|
actions:
|
||||||
|
approve: Approve
|
||||||
|
heading: Review Medical Release
|
||||||
blank_contracts:
|
blank_contracts:
|
||||||
new:
|
new:
|
||||||
number_of_copies_label: Number of copies
|
number_of_copies_label: Number of copies
|
||||||
@@ -288,6 +298,14 @@ en:
|
|||||||
print_QR_code: Print out release QR codes
|
print_QR_code: Print out release QR codes
|
||||||
releases_automatically_organized: Releases are automatically organized as they’re submitted
|
releases_automatically_organized: Releases are automatically organized as they’re submitted
|
||||||
contracts:
|
contracts:
|
||||||
|
for_office_use_only:
|
||||||
|
description_labels:
|
||||||
|
date_issued: Date Issued
|
||||||
|
employee_issued_to: Employee Issued To
|
||||||
|
issued_by: Issued By
|
||||||
|
producer: Producer
|
||||||
|
production: Production
|
||||||
|
heading: For Office Use Only
|
||||||
photos:
|
photos:
|
||||||
guardian_2_photo_heading: Second guardian photo
|
guardian_2_photo_heading: Second guardian photo
|
||||||
guardian_photo_heading: Guardian photo
|
guardian_photo_heading: Guardian photo
|
||||||
@@ -727,6 +745,7 @@ en:
|
|||||||
empty: Location Releases will appear here
|
empty: Location Releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
address: Address
|
address: Address
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
@@ -761,6 +780,7 @@ en:
|
|||||||
search: Search
|
search: Search
|
||||||
empty: Material Releases will appear here
|
empty: Material Releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
@@ -782,12 +802,19 @@ en:
|
|||||||
search: Search
|
search: Search
|
||||||
empty: Medical releases will appear here
|
empty: Medical releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
|
approved: Approved
|
||||||
|
approved?: Approved
|
||||||
|
contact_info: Contact info
|
||||||
|
name: Person name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
medical_release:
|
medical_release:
|
||||||
actions:
|
actions:
|
||||||
manage: Manage
|
manage: Manage
|
||||||
|
review: Review
|
||||||
|
messages:
|
||||||
|
approved_tooltip: Approved by %{user} on %{timestamp}
|
||||||
misc_releases:
|
misc_releases:
|
||||||
destroy:
|
destroy:
|
||||||
alert: The misc release has been deleted
|
alert: The misc release has been deleted
|
||||||
@@ -796,6 +823,8 @@ en:
|
|||||||
search: Search
|
search: Search
|
||||||
empty: Misc Releases will appear here
|
empty: Misc Releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
|
contact_info: Contact info
|
||||||
|
name: Person name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
@@ -830,6 +859,7 @@ en:
|
|||||||
table_headers:
|
table_headers:
|
||||||
composers_count: No. Composers
|
composers_count: No. Composers
|
||||||
file_infos_count: No. Files
|
file_infos_count: No. Files
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
publishers_count: No. Publishers
|
publishers_count: No. Publishers
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
@@ -1226,7 +1256,10 @@ en:
|
|||||||
search: Search
|
search: Search
|
||||||
empty: Talent Releases will appear here
|
empty: Talent Releases will appear here
|
||||||
table_headers:
|
table_headers:
|
||||||
|
email: Email
|
||||||
|
name: Name
|
||||||
notes: Notes
|
notes: Notes
|
||||||
|
phone: Phone
|
||||||
signed_at: Date Signed
|
signed_at: Date Signed
|
||||||
tags: Tags
|
tags: Tags
|
||||||
new:
|
new:
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
es:
|
es:
|
||||||
|
acquired_media_releases:
|
||||||
|
acquired_media_release:
|
||||||
|
no_media: No Media (ES)
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
file_infos_count: No. Files (ES)
|
||||||
|
name: Name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
activerecord:
|
activerecord:
|
||||||
attributes:
|
attributes:
|
||||||
appearance_release:
|
appearance_release:
|
||||||
@@ -41,6 +51,12 @@ es:
|
|||||||
heading: Person Photo (ES)
|
heading: Person Photo (ES)
|
||||||
index:
|
index:
|
||||||
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release (ES)
|
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release (ES)
|
||||||
|
table_headers:
|
||||||
|
contact_info: ""
|
||||||
|
name: ""
|
||||||
|
notes: ""
|
||||||
|
signed_at: ""
|
||||||
|
tags: ""
|
||||||
shared:
|
shared:
|
||||||
imported_appearance_release_contract_name: Contrato Importado
|
imported_appearance_release_contract_name: Contrato Importado
|
||||||
imported_appearance_release_headshot_name: Retrato Importado
|
imported_appearance_release_headshot_name: Retrato Importado
|
||||||
@@ -50,6 +66,13 @@ es:
|
|||||||
all_releases: All Releases (ES)
|
all_releases: All Releases (ES)
|
||||||
complete_releases: Complete Releases (ES)
|
complete_releases: Complete Releases (ES)
|
||||||
incomplete_releases: Incomplete Releases (ES)
|
incomplete_releases: Incomplete Releases (ES)
|
||||||
|
approvals:
|
||||||
|
create:
|
||||||
|
release_approved: Medical release has been approved (ES)
|
||||||
|
new:
|
||||||
|
actions:
|
||||||
|
approve: Approve (ES)
|
||||||
|
heading: Review Medical Release (ES)
|
||||||
blank_contracts:
|
blank_contracts:
|
||||||
new:
|
new:
|
||||||
number_of_copies_label: Number of copies (ES)
|
number_of_copies_label: Number of copies (ES)
|
||||||
@@ -107,6 +130,14 @@ es:
|
|||||||
print_QR_code: Print out release QR codes (ES)
|
print_QR_code: Print out release QR codes (ES)
|
||||||
releases_automatically_organized: Releases are automatically organized as they’re submitted (ES)
|
releases_automatically_organized: Releases are automatically organized as they’re submitted (ES)
|
||||||
contracts:
|
contracts:
|
||||||
|
for_office_use_only:
|
||||||
|
description_labels:
|
||||||
|
date_issued: Date Issued (ES)
|
||||||
|
employee_issued_to: Employee Issued To (ES)
|
||||||
|
issued_by: Issued By (ES)
|
||||||
|
producer: Producer (ES)
|
||||||
|
production: Production (ES)
|
||||||
|
heading: For Office Use Only (ES)
|
||||||
photos:
|
photos:
|
||||||
guardian_2_photo_heading: Second guardian photo (ES)
|
guardian_2_photo_heading: Second guardian photo (ES)
|
||||||
guardian_photo_heading: Guardian photo (ES)
|
guardian_photo_heading: Guardian photo (ES)
|
||||||
@@ -274,18 +305,64 @@ es:
|
|||||||
create: Create Live Stream (ES)
|
create: Create Live Stream (ES)
|
||||||
update: Save Changes (ES)
|
update: Save Changes (ES)
|
||||||
create: 'Crear %{model}'
|
create: 'Crear %{model}'
|
||||||
|
medical_release:
|
||||||
|
update: Approve (ES)
|
||||||
update: 'Actualizar %{model}'
|
update: 'Actualizar %{model}'
|
||||||
location_releases:
|
location_releases:
|
||||||
form:
|
form:
|
||||||
photos:
|
photos:
|
||||||
dropzone_label: Tap to take a photo of the Property (optional) (ES)
|
dropzone_label: Tap to take a photo of the Property (optional) (ES)
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
address: Address (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
material_releases:
|
material_releases:
|
||||||
form:
|
form:
|
||||||
photos:
|
photos:
|
||||||
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES)
|
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES)
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
name: Name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
medical_releases:
|
medical_releases:
|
||||||
custom_validation_errors:
|
custom_validation_errors:
|
||||||
question_answer_is_required: answer is required (ES)
|
question_answer_is_required: answer is required (ES)
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
approved: Approved (ES)
|
||||||
|
approved?: Approved (ES)
|
||||||
|
contact_info: Contact info (ES)
|
||||||
|
name: Person name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
|
medical_release:
|
||||||
|
actions:
|
||||||
|
review: Review (ES)
|
||||||
|
messages:
|
||||||
|
approved_tooltip: ""
|
||||||
|
misc_releases:
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
contact_info: Contact info (ES)
|
||||||
|
name: Person name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
|
music_releases:
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
composers_count: No. Composers (ES)
|
||||||
|
file_infos_count: No. Files (ES)
|
||||||
|
name: Name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
publishers_count: No. Publishers (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
public:
|
public:
|
||||||
appearance_releases:
|
appearance_releases:
|
||||||
create:
|
create:
|
||||||
@@ -390,6 +467,14 @@ es:
|
|||||||
heading: Second Guardian Photo (ES)
|
heading: Second Guardian Photo (ES)
|
||||||
guardian_photo:
|
guardian_photo:
|
||||||
heading: Guardian Photo (ES)
|
heading: Guardian Photo (ES)
|
||||||
|
index:
|
||||||
|
table_headers:
|
||||||
|
email: Email (ES)
|
||||||
|
name: Name (ES)
|
||||||
|
notes: Notes (ES)
|
||||||
|
phone: Phone (ES)
|
||||||
|
signed_at: Date Signed (ES)
|
||||||
|
tags: Tags (ES)
|
||||||
task_requests:
|
task_requests:
|
||||||
create:
|
create:
|
||||||
success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. (ES)
|
success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. (ES)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ require 'oath/constraints/signed_in'
|
|||||||
require 'sidekiq/web'
|
require 'sidekiq/web'
|
||||||
|
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
AVAILABLE_LOCALES_REGEX = /#{I18n.available_locales.join("|")}/
|
AVAILABLE_LOCALES_REGEX = /#{I18n.available_locales.join("|")}/.freeze
|
||||||
|
|
||||||
concern :confirmable do
|
concern :confirmable do
|
||||||
resources :video_release_confirmations, only: [:new, :create, :destroy]
|
resources :video_release_confirmations, only: [:new, :create, :destroy]
|
||||||
@@ -136,13 +136,18 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RELEASES = [:acquired_media_releases, :appearance_releases, :talent_releases, :material_releases, :location_releases]
|
RELEASES = [:acquired_media_releases, :appearance_releases, :talent_releases, :material_releases, :medical_releases, :misc_releases, :location_releases].freeze
|
||||||
ALL_RELEASES = RELEASES + [:music_releases, :medical_releases, :misc_releases]
|
ALL_RELEASES = RELEASES + [:music_releases]
|
||||||
|
|
||||||
ALL_RELEASES.each do |release|
|
ALL_RELEASES.each do |release|
|
||||||
resources release, only: [], concerns: :taggable
|
resources release, only: [], concerns: :taggable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Customization for medical releases
|
||||||
|
resources :medical_releases, only: [], concerns: :taggable do
|
||||||
|
resource :approvals, only: [:new, :create]
|
||||||
|
end
|
||||||
|
|
||||||
resources :bulk_taggings, only: [:new, :create]
|
resources :bulk_taggings, only: [:new, :create]
|
||||||
|
|
||||||
namespace :api do
|
namespace :api do
|
||||||
@@ -158,7 +163,7 @@ Rails.application.routes.draw do
|
|||||||
resources :contract_templates, only: [:index]
|
resources :contract_templates, only: [:index]
|
||||||
end
|
end
|
||||||
resources :contract_templates, only: [:show] do
|
resources :contract_templates, only: [:show] do
|
||||||
RELEASES.each do |release|
|
(RELEASES - [:misc_releases, :medical_releases]).each do |release|
|
||||||
resources release, controller: release, only: [:create]
|
resources release, controller: release, only: [:create]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class AddApprovalInfoColumnsToMedicalReleases < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
add_column :medical_releases, :approved_by_user_name, :text
|
||||||
|
add_column :medical_releases, :approved_by_user_email, :text
|
||||||
|
add_column :medical_releases, :approved_at, :timestamp
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1045,7 +1045,10 @@ CREATE TABLE public.medical_releases (
|
|||||||
guardian_2_address_city character varying,
|
guardian_2_address_city character varying,
|
||||||
guardian_2_address_state character varying,
|
guardian_2_address_state character varying,
|
||||||
guardian_2_address_zip character varying,
|
guardian_2_address_zip character varying,
|
||||||
guardian_2_address_country character varying
|
guardian_2_address_country character varying,
|
||||||
|
approved_by_user_name text,
|
||||||
|
approved_by_user_email text,
|
||||||
|
approved_at timestamp without time zone
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -3902,6 +3905,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||||||
('20200619134853'),
|
('20200619134853'),
|
||||||
('20200622180507'),
|
('20200622180507'),
|
||||||
('20200625144713'),
|
('20200625144713'),
|
||||||
('20200702152130');
|
('20200702152130'),
|
||||||
|
('20200707155717');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
42
spec/controllers/api/medical_releases_controller_spec.rb
Normal file
42
spec/controllers/api/medical_releases_controller_spec.rb
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Api::MedicalReleasesController, type: :controller do
|
||||||
|
let(:current_user) { create(:user) }
|
||||||
|
let(:project) { create(:project, name: 'first', account: current_user.primary_account) }
|
||||||
|
|
||||||
|
describe '#index' do
|
||||||
|
it 'returns a succesful response' do
|
||||||
|
create(:medical_release, person_first_name: 'John', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
create(:medical_release, person_first_name: 'Jane', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
|
||||||
|
sign_in_to_api(current_user)
|
||||||
|
get :index, params: { project_id: project.id }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).to include 'John'
|
||||||
|
expect(response.body).to include 'Jane'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe '#show' do
|
||||||
|
it 'returns a succesful response' do
|
||||||
|
release1 = create(:medical_release, person_first_name: 'John', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
release2 = create(:medical_release, person_first_name: 'Jane', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
|
||||||
|
sign_in_to_api(current_user)
|
||||||
|
get :show, params: { id: release1 }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).to include 'John'
|
||||||
|
expect(response.body).not_to include 'Jane'
|
||||||
|
|
||||||
|
get :show, params: { id: release2 }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).not_to include 'John'
|
||||||
|
expect(response.body).to include 'Jane'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
42
spec/controllers/api/misc_releases_controller_spec.rb
Normal file
42
spec/controllers/api/misc_releases_controller_spec.rb
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Api::MiscReleasesController, type: :controller do
|
||||||
|
let(:current_user) { create(:user) }
|
||||||
|
let(:project) { create(:project, name: 'first', account: current_user.primary_account) }
|
||||||
|
|
||||||
|
describe '#index' do
|
||||||
|
it 'returns a succesful response' do
|
||||||
|
create(:misc_release, person_first_name: 'John', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
create(:misc_release, person_first_name: 'Jane', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
|
||||||
|
sign_in_to_api(current_user)
|
||||||
|
get :index, params: { project_id: project.id }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).to include 'John'
|
||||||
|
expect(response.body).to include 'Jane'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe '#show' do
|
||||||
|
it 'returns a succesful response' do
|
||||||
|
release1 = create(:misc_release, person_first_name: 'John', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
release2 = create(:misc_release, person_first_name: 'Jane', person_last_name: 'Lee', project_id: project.id)
|
||||||
|
|
||||||
|
sign_in_to_api(current_user)
|
||||||
|
get :show, params: { id: release1 }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).to include 'John'
|
||||||
|
expect(response.body).not_to include 'Jane'
|
||||||
|
|
||||||
|
get :show, params: { id: release2 }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(response.body).not_to include 'John'
|
||||||
|
expect(response.body).to include 'Jane'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -18,6 +18,14 @@ releases = [
|
|||||||
{
|
{
|
||||||
type: :material_release,
|
type: :material_release,
|
||||||
obligatory_attribute: :name
|
obligatory_attribute: :name
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: :medical_release,
|
||||||
|
obligatory_attribute: :person_name
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: :misc_release,
|
||||||
|
obligatory_attribute: :person_name
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,26 @@ RSpec.describe Api::SyncController, type: :controller do
|
|||||||
expect(guardian_photo).to include('id', 'type', 'attributes')
|
expect(guardian_photo).to include('id', 'type', 'attributes')
|
||||||
expect(photo_attributes).to include('filename', 'content_type', 'url', 'thumbnail_url')
|
expect(photo_attributes).to include('filename', 'content_type', 'url', 'thumbnail_url')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'contains misc releases' do
|
||||||
|
create_default_data
|
||||||
|
|
||||||
|
get :index
|
||||||
|
|
||||||
|
misc_releases = attributes_for_type('misc_releases')
|
||||||
|
|
||||||
|
expect(misc_releases.first).to include('id')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'contains misc releases' do
|
||||||
|
create_default_data
|
||||||
|
|
||||||
|
get :index
|
||||||
|
|
||||||
|
medical_releases = attributes_for_type('medical_releases')
|
||||||
|
|
||||||
|
expect(medical_releases.first).to include('id')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -120,6 +140,8 @@ RSpec.describe Api::SyncController, type: :controller do
|
|||||||
create(:talent_release, project: project)
|
create(:talent_release, project: project)
|
||||||
create(:location_release, project: project)
|
create(:location_release, project: project)
|
||||||
create(:material_release, project: project)
|
create(:material_release, project: project)
|
||||||
|
create(:medical_release, project: project)
|
||||||
|
create(:misc_release, project: project)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_default_data_with_guardian_info
|
def create_default_data_with_guardian_info
|
||||||
|
|||||||
36
spec/controllers/approvals_controller_spec.rb
Normal file
36
spec/controllers/approvals_controller_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
require "rails_helper"
|
||||||
|
|
||||||
|
RSpec.describe ApprovalsController, type: :controller do
|
||||||
|
render_views
|
||||||
|
|
||||||
|
let(:user) { create(:user) }
|
||||||
|
let(:account) { user.primary_account }
|
||||||
|
let(:project) { create(:project, account: user.primary_account) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
sign_in user
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#new" do
|
||||||
|
let!(:medical_release) { create(:medical_release, project: project) }
|
||||||
|
|
||||||
|
it "responds successfully" do
|
||||||
|
get :new, params: { medical_release_id: medical_release }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#create" do
|
||||||
|
it "changes approval status successfully" do
|
||||||
|
medical_release = create(:medical_release, project: project)
|
||||||
|
|
||||||
|
expect(MedicalRelease.last.approved?).to eq false
|
||||||
|
|
||||||
|
post :create, params: { medical_release_id: medical_release }
|
||||||
|
|
||||||
|
expect(response).to redirect_to [project, :medical_releases]
|
||||||
|
expect(MedicalRelease.last.approved?).to eq true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -21,7 +21,7 @@ RSpec.feature 'User creates task request', type: :feature do
|
|||||||
click_on 'Create Task request'
|
click_on 'Create Task request'
|
||||||
|
|
||||||
expect(page).to have_content task_created_message
|
expect(page).to have_content task_created_message
|
||||||
expect(page).to have_link("Done")
|
expect(page).to have_link("Back")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'user can view task request details' do
|
scenario 'user can view task request details' do
|
||||||
|
|||||||
@@ -182,6 +182,18 @@ feature "User managing medical releases" do
|
|||||||
sign_in current_user
|
sign_in current_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Approved releases have checkmark and non-approved releases don't have checkmarks" do
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 0)
|
||||||
|
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project, approved_by_user_email: "some@email.com", approved_at: DateTime.now)
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
|
||||||
|
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1)
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Download All is visible" do
|
scenario "Download All is visible" do
|
||||||
create(:medical_release_with_contract_template, :native, project: project)
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
create(:medical_release_with_contract_template, :non_native, project: project)
|
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||||
@@ -200,6 +212,15 @@ feature "User managing medical releases" do
|
|||||||
expect(page).to have_link("Download", exact: true, count: 2)
|
expect(page).to have_link("Download", exact: true, count: 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Review action in Manage menu is visible" do
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||||
|
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
|
||||||
|
expect(page).to have_link(review_action, exact: true)
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Downloading PDF of native medical release is possible" do
|
scenario "Downloading PDF of native medical release is possible" do
|
||||||
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
|
||||||
@@ -208,6 +229,64 @@ feature "User managing medical releases" do
|
|||||||
click_link *view_release_pdf_link_for(native_release)
|
click_link *view_release_pdf_link_for(native_release)
|
||||||
expect(content_type).to eq('application/pdf')
|
expect(content_type).to eq('application/pdf')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Reviewing release" do
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
|
||||||
|
click_link review_action
|
||||||
|
|
||||||
|
expect(page).to have_content review_page_heading
|
||||||
|
expect(page).to have_content approve_button
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'When viewing the contract PDF of approved release there is page for office use only' do
|
||||||
|
medical_release = create(:medical_release_with_contract_template,
|
||||||
|
:native,
|
||||||
|
project: project,
|
||||||
|
person_first_name: 'Jane',
|
||||||
|
person_last_name: 'Doe',
|
||||||
|
approved_by_user_name: "Big Joe",
|
||||||
|
approved_by_user_email: "some@email.com",
|
||||||
|
approved_at: DateTime.now)
|
||||||
|
|
||||||
|
sign_in(current_user)
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
click_link *view_release_pdf_link_for(medical_release)
|
||||||
|
|
||||||
|
expect(content_type).to eq('application/pdf')
|
||||||
|
expect(content_disposition).to include('inline')
|
||||||
|
expect(pdf_body).to have_content for_office_use_only.upcase
|
||||||
|
expect(pdf_body).to have_content producer_label
|
||||||
|
expect(pdf_body).to have_content production_label
|
||||||
|
expect(pdf_body).to have_content employee_issued_to_label
|
||||||
|
expect(pdf_body).to have_content issued_by_label
|
||||||
|
expect(pdf_body).to have_content date_issued
|
||||||
|
expect(pdf_body).to have_content 'Big Joe'
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'When viewing the contract PDF of not approved release there is no page for office use only' do
|
||||||
|
medical_release = create(:medical_release_with_contract_template,
|
||||||
|
:native,
|
||||||
|
project: project,
|
||||||
|
person_first_name: 'Jane',
|
||||||
|
person_last_name: 'Doe')
|
||||||
|
|
||||||
|
sign_in(current_user)
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
click_link *view_release_pdf_link_for(medical_release)
|
||||||
|
|
||||||
|
expect(content_type).to eq('application/pdf')
|
||||||
|
expect(content_disposition).to include('inline')
|
||||||
|
expect(pdf_body).not_to have_content for_office_use_only.upcase
|
||||||
|
expect(pdf_body).not_to have_content producer_label
|
||||||
|
expect(pdf_body).not_to have_content production_label
|
||||||
|
expect(pdf_body).not_to have_content employee_issued_to_label
|
||||||
|
expect(pdf_body).not_to have_content issued_by_label
|
||||||
|
expect(pdf_body).not_to have_content date_issued
|
||||||
|
expect(pdf_body).not_to have_content 'Big Joe'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when the user is manager(project manager)" do
|
context "when the user is manager(project manager)" do
|
||||||
@@ -235,6 +314,15 @@ feature "User managing medical releases" do
|
|||||||
expect(page).to have_link("Download", exact: true, count: 0)
|
expect(page).to have_link("Download", exact: true, count: 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Review action in Manage menu is not visible" do
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||||
|
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
|
||||||
|
expect(page).not_to have_link(review_action, exact: true)
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Downloading PDF of native medical release is not possible" do
|
scenario "Downloading PDF of native medical release is not possible" do
|
||||||
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
|
||||||
@@ -279,6 +367,15 @@ feature "User managing medical releases" do
|
|||||||
expect(page).to have_link("Download", exact: true, count: 0)
|
expect(page).to have_link("Download", exact: true, count: 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Review action in Manage menu is not visible" do
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||||
|
|
||||||
|
visit project_medical_releases_path(project)
|
||||||
|
|
||||||
|
expect(page).not_to have_link(review_action, exact: true)
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Downloading PDF of native medical release is not possible" do
|
scenario "Downloading PDF of native medical release is not possible" do
|
||||||
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
native_release = create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
|
||||||
@@ -458,4 +555,40 @@ feature "User managing medical releases" do
|
|||||||
def dummy_signature_legal_text
|
def dummy_signature_legal_text
|
||||||
'Some signature legal language'
|
'Some signature legal language'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def review_action
|
||||||
|
t 'medical_releases.medical_release.actions.review'
|
||||||
|
end
|
||||||
|
|
||||||
|
def review_page_heading
|
||||||
|
t 'approvals.new.heading'
|
||||||
|
end
|
||||||
|
|
||||||
|
def approve_button
|
||||||
|
t 'approvals.new.actions.approve'
|
||||||
|
end
|
||||||
|
|
||||||
|
def for_office_use_only
|
||||||
|
t 'contracts.for_office_use_only.heading'
|
||||||
|
end
|
||||||
|
|
||||||
|
def producer_label
|
||||||
|
t 'contracts.for_office_use_only.description_labels.producer'
|
||||||
|
end
|
||||||
|
|
||||||
|
def production_label
|
||||||
|
t 'contracts.for_office_use_only.description_labels.production'
|
||||||
|
end
|
||||||
|
|
||||||
|
def employee_issued_to_label
|
||||||
|
t 'contracts.for_office_use_only.description_labels.employee_issued_to'
|
||||||
|
end
|
||||||
|
|
||||||
|
def issued_by_label
|
||||||
|
t 'contracts.for_office_use_only.description_labels.issued_by'
|
||||||
|
end
|
||||||
|
|
||||||
|
def date_issued
|
||||||
|
t 'contracts.for_office_use_only.description_labels.date_issued'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe GenerateContractsZipJob do
|
|||||||
dir = Rails.root.join("spec", "fixtures", "files")
|
dir = Rails.root.join("spec", "fixtures", "files")
|
||||||
files = ["contract.pdf", "AppearanceRelease.pdf"]
|
files = ["contract.pdf", "AppearanceRelease.pdf"]
|
||||||
# Attachments in the test environment do not persist to cloud storage
|
# Attachments in the test environment do not persist to cloud storage
|
||||||
# Therefore we want to stub calls to `open` with a cloud storage URL
|
# Therefore we want to stub calls to `open` with a cloud storage URL
|
||||||
allow_any_instance_of(ReleaseContractCollectionService).to receive(:open).and_return(StringIO.new("file data"))
|
allow_any_instance_of(ReleaseContractCollectionService).to receive(:open).and_return(StringIO.new("file data"))
|
||||||
allow_any_instance_of(ReleaseContractCollectionService).to receive(:build).and_yield(dir, files)
|
allow_any_instance_of(ReleaseContractCollectionService).to receive(:build).and_yield(dir, files)
|
||||||
end
|
end
|
||||||
@@ -35,6 +35,38 @@ describe GenerateContractsZipJob do
|
|||||||
expect(download.file).to be_attached
|
expect(download.file).to be_attached
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "generates ZIP containing CSV file with all releases data for all release types" do
|
||||||
|
release_types = %w[AcquiredMediaRelease AppearanceRelease LocationRelease MaterialRelease MedicalRelease MiscRelease MusicRelease TalentRelease]
|
||||||
|
create_releases_for_all_types
|
||||||
|
|
||||||
|
release_types.each do |type|
|
||||||
|
lowercase_plural = type.constantize.model_name.plural
|
||||||
|
GenerateContractsZipJob.perform_now(project, download, type, project.public_send(lowercase_plural).ids)
|
||||||
|
|
||||||
|
generated_zip = download.file.blob.download
|
||||||
|
csv_file_name = "#{project.name.parameterize}_#{lowercase_plural.gsub('_', '-')}.csv"
|
||||||
|
Zip::InputStream.open(StringIO.new(generated_zip)) do |io|
|
||||||
|
while entry = io.get_next_entry
|
||||||
|
next unless entry.name == csv_file_name
|
||||||
|
|
||||||
|
csv_file = entry.get_input_stream.read
|
||||||
|
|
||||||
|
release_class = Object.const_get type
|
||||||
|
release_headers = release_class.csv_headers
|
||||||
|
|
||||||
|
release_headers.each do |header|
|
||||||
|
expect(csv_file).to match header
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
dummy_zip_file_name = "#{project.name.parameterize}_#{lowercase_plural.gsub('_', '-')}.zip"
|
||||||
|
if File.exist?(file_fixture(dummy_zip_file_name))
|
||||||
|
File.delete(file_fixture(dummy_zip_file_name))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "When there are errors" do
|
context "When there are errors" do
|
||||||
let(:error) { StandardError.new("Contracts or contract templates not found.") }
|
let(:error) { StandardError.new("Contracts or contract templates not found.") }
|
||||||
|
|
||||||
@@ -42,10 +74,10 @@ describe GenerateContractsZipJob do
|
|||||||
allow(ProjectsChannel).to receive(:broadcast_download_generation_update).with(download, I18n.t("contract_downloads.download.failure"))
|
allow(ProjectsChannel).to receive(:broadcast_download_generation_update).with(download, I18n.t("contract_downloads.download.failure"))
|
||||||
allow_any_instance_of(ReleaseContractCollectionService).to receive(:build).and_raise(StandardError, "Contracts or contract templates not found")
|
allow_any_instance_of(ReleaseContractCollectionService).to receive(:build).and_raise(StandardError, "Contracts or contract templates not found")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "updates status to 'failure' and sends user a notification" do
|
it "updates status to 'failure' and sends user a notification" do
|
||||||
GenerateContractsZipJob.perform_now(project, download, "AppearanceRelease", project.appearance_releases.ids)
|
GenerateContractsZipJob.perform_now(project, download, "AppearanceRelease", project.appearance_releases.ids)
|
||||||
|
|
||||||
expect(download.status).to eq "failure"
|
expect(download.status).to eq "failure"
|
||||||
expect(ProjectsChannel).to have_received(:broadcast_download_generation_update).with(download, I18n.t("contract_downloads.download.failure"))
|
expect(ProjectsChannel).to have_received(:broadcast_download_generation_update).with(download, I18n.t("contract_downloads.download.failure"))
|
||||||
end
|
end
|
||||||
@@ -56,6 +88,21 @@ describe GenerateContractsZipJob do
|
|||||||
# Delete the file created in fixture.
|
# Delete the file created in fixture.
|
||||||
# Or the tests will fail on next run due to already existing files in existing zip.
|
# Or the tests will fail on next run due to already existing files in existing zip.
|
||||||
path = Rails.root.join("spec", "fixtures", "files")
|
path = Rails.root.join("spec", "fixtures", "files")
|
||||||
File.delete("#{path}/my-video-project_appearance-releases.zip") if File.exists? "#{path}/my-video-project_appearance-releases.zip"
|
if File.exists? "#{path}/my-video-project_appearance-releases.zip"
|
||||||
|
File.delete("#{path}/my-video-project_appearance-releases.zip")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def create_releases_for_all_types
|
||||||
|
create(:acquired_media_release_with_contract_template, :native, project: project)
|
||||||
|
create(:appearance_release_with_contract_template, :native, project: project, person_name: "John Doe")
|
||||||
|
create(:location_release_with_contract_template, :native, project: project)
|
||||||
|
create(:material_release_with_contract_template, :native, project: project)
|
||||||
|
create(:medical_release_with_contract_template, :native, project: project)
|
||||||
|
create(:misc_release_with_contract_template, :native, project: project)
|
||||||
|
create(:music_release_with_contract_template, project: project)
|
||||||
|
create(:talent_release_with_contract_template, :native, project: project)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user