|
|
|
|
@ -19,7 +19,7 @@ class MergeRequest < ApplicationRecord
|
|
|
|
|
scope :visible, lambda { |
|
|
|
|
open_collection_period_start_date = FormHandler.instance.start_date_of_earliest_open_collection_period |
|
|
|
|
where( |
|
|
|
|
"(status != :merged_status) OR (status = :merged_status AND merge_date >= :open_collection_period_start_date)", |
|
|
|
|
"(merge_requests.status != :merged_status) OR (merge_requests.status = :merged_status AND merge_requests.merge_date >= :open_collection_period_start_date)", |
|
|
|
|
merged_status: 4, |
|
|
|
|
open_collection_period_start_date:, |
|
|
|
|
) |
|
|
|
|
@ -31,4 +31,8 @@ class MergeRequest < ApplicationRecord
|
|
|
|
|
errors.add(:new_organisation_name, :invalid) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def absorbing_organisation_name |
|
|
|
|
absorbing_organisation&.name || "" |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|