Skip to content

Commit

Permalink
Merge pull request #348 from samvera/require-rails5-2
Browse files Browse the repository at this point in the history
Remove support for rails 5.1, rely on ActiveStorage id generation
  • Loading branch information
jrgriffiniii authored Apr 23, 2020
2 parents 55ed1f8 + 57dc050 commit f1d3b9b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
8 changes: 0 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ workflows:
name: "ruby2-6_rails5-2"
ruby_version: 2.6.5
rails_version: 5.2.4
- build:
name: "ruby2-6_rails5-1"
ruby_version: 2.6.5
rails_version: 5.1.7
- build:
name: "ruby2-5_rails6-0"
ruby_version: 2.5.7
Expand All @@ -82,7 +78,3 @@ workflows:
name: "ruby2-5_rails5-2"
ruby_version: 2.5.7
rails_version: 5.2.4
- build:
name: "ruby2-5_rails5-1"
ruby_version: 2.5.7
rails_version: 5.1.7
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Currently, the following releases of Ruby are supported:
The supported Rail releases follow those specified by [the security policy of the Rails Community](https://rubyonrails.org/security/). As is the case with the supported Ruby releases, it is recommended that one upgrades from any Rails release no longer receiving security updates.
- 6.0.2
- 5.2.4
- 5.1.7

_Support for Rails releases earlier than 5.2.z are dropped from 2.0.0 onwards in
order to maintain core compatibility with [Webpacker]()._
Expand Down
10 changes: 1 addition & 9 deletions app/jobs/browse_everything/upload_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ def build_download(url, headers)
StringIO.new(response.body)
end

# This should only be necessary for activestorage 0.1
def mint_new_id
last = UploadFile.last
return 0 unless last

last.id + 1
end

def create_upload_file(bytestream:)
io = if bytestream.file_uri?
file_path = bytestream.uri.gsub('file://', '')
Expand All @@ -73,7 +65,7 @@ def create_upload_file(bytestream:)
build_download(bytestream.uri, request_headers)
end

upload_file = UploadFile.new(id: mint_new_id, name: bytestream.name)
upload_file = UploadFile.new(name: bytestream.name)
upload_file.bytestream.attach(io: io, filename: bytestream.name, content_type: bytestream.media_type)
upload_file.save
upload_file.reload
Expand Down

0 comments on commit f1d3b9b

Please sign in to comment.