diff --git a/app/models/datafile.rb b/app/models/datafile.rb index b10f6edb..f6bea443 100644 --- a/app/models/datafile.rb +++ b/app/models/datafile.rb @@ -35,7 +35,8 @@ def compute_date(date_type) return monthly_date(date_type) if dataset.monthly? return quarterly_date(date_type) if dataset.quarterly? return yearly_date(date_type) if dataset.annually? - return financial_yearly_date(date_type) if dataset.financial_yearly? + + financial_yearly_date(date_type) if dataset.financial_yearly? end def daily_date diff --git a/app/workers/ckan/v26/ckan_org_sync_worker.rb b/app/workers/ckan/v26/ckan_org_sync_worker.rb index 449e6825..b563c070 100644 --- a/app/workers/ckan/v26/ckan_org_sync_worker.rb +++ b/app/workers/ckan/v26/ckan_org_sync_worker.rb @@ -20,7 +20,7 @@ def create_update_organisations(organisation_ids) def delete_old_organisations(organisation_ids) organisations = Organisation.where(name: organisation_ids) - Dataset.where(organisation: organisations).each(&:unpublish) + Dataset.where(organisation: organisations).find_each(&:unpublish) organisations.destroy_all end end diff --git a/lib/tasks/update_organogram_filenames.rb b/lib/tasks/update_organogram_filenames.rb index a5925809..710e235f 100644 --- a/lib/tasks/update_organogram_filenames.rb +++ b/lib/tasks/update_organogram_filenames.rb @@ -28,7 +28,7 @@ def replace_urls if @old_urls.empty? "No urls to process" else - Link.where("url LIKE 'https://s3-eu-west-1.amazonaws.com%'").each do |link| + Link.where("url LIKE 'https://s3-eu-west-1.amazonaws.com%'").find_each do |link| next unless link.url.include? "-posts-" index = @old_urls.index(link.url)