Skip to content

Commit

Permalink
Merge pull request #657 from berkmancenter/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
peter-hank authored May 28, 2021
2 parents 80a52ea + d3d1a0f commit 65f7860
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019.

## [21.05d](https://github.com/berkmancenter/lumendatabase/releases/tag/2021.05d) - 2021-05-28
### Changed
* Made the `kind` field required in the `file_upload` model.
* Replaced the `expire_fragment` method with a system method call during the async indexing rake task.

## [21.05c](https://github.com/berkmancenter/lumendatabase/releases/tag/2021.05c) - 2021-05-24
### Changed
* Bumped Ruby to `2.5.9`.
Expand Down
6 changes: 4 additions & 2 deletions app/models/file_upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class FileUpload < ApplicationRecord

ALLOWED_KINDS = %w[original supporting].freeze

validates_inclusion_of :kind, in: ALLOWED_KINDS
validates :kind, length: { maximum: 255 }
validates :kind,
presence: true,
length: { maximum: 255 },
inclusion: { in: ALLOWED_KINDS }

belongs_to :notice
has_attached_file :file,
Expand Down
4 changes: 3 additions & 1 deletion app/models/reindex_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def self.index_changed_model_instances
end

def self.sweep_search_result_caches
ApplicationController.new.expire_fragment(/search-result-[a-f0-9]{32}/)
# We were previously using the expire_fragment method but it was randomly
# generating "No such file or directory @ dir_initialize" errors
system("find tmp/cache -name '*search-result*' -delete")
end

def self.indexed?(klass, id)
Expand Down

0 comments on commit 65f7860

Please sign in to comment.