active_storage_db 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/active_storage_db/version.rb +1 -1
- data/lib/tasks/active_storage_db_tasks.rake +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a465e1b93b8ab6436f800b2a0ff6e38f049fae621587924d9b2299f3fa06946
|
4
|
+
data.tar.gz: 78583f7c6aa00b0a8c7ab1d98f05d4d34e8ff8a1846f0ed70a0c3e16e97275c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76ef220615b3e3704a99803a8bbe3af211855278d3532a97bbc9f325a5455ff393dde657180368d10bdecce8592afe99a41be7f6fe28e325d3671fa3b414087a
|
7
|
+
data.tar.gz: c555f306068194447e708c743abdc829f8043728585da32bbf504d689571d38a72725dbe97382665bd20fdaa95848b48ee018d45ab5d22692c1736ad9bcc59cb
|
data/README.md
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
[![maintainability](https://api.codeclimate.com/v1/badges/92e1e703c308744a0f66/maintainability)](https://codeclimate.com/github/blocknotes/active_storage_db/maintainability)
|
6
6
|
|
7
7
|
[![linters](https://github.com/blocknotes/active_storage_db/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/active_storage_db/actions/workflows/linters.yml)
|
8
|
-
[![specs Postgres](https://github.com/blocknotes/active_storage_db/actions/workflows/
|
9
|
-
[![
|
8
|
+
[![specs Postgres](https://github.com/blocknotes/active_storage_db/actions/workflows/specs_postgres_71.yml/badge.svg)](https://github.com/blocknotes/active_storage_db/actions/workflows/specs_postgres_71.yml)
|
9
|
+
[![specs MySQL](https://github.com/blocknotes/active_storage_db/actions/workflows/specs_mysql_71.yml/badge.svg)](https://github.com/blocknotes/active_storage_db/actions/workflows/specs_mysql_71.yml)
|
10
10
|
|
11
11
|
An Active Storage service upload/download plugin that stores files in a PostgreSQL or MySQL database.
|
12
12
|
|
13
13
|
Main features:
|
14
|
-
-
|
14
|
+
- attachment data stored in a binary field (or blob);
|
15
15
|
- all service methods implemented;
|
16
|
-
-
|
16
|
+
- supports Rails _6_ and _7_.
|
17
17
|
|
18
18
|
Useful also with platforms like Heroku (due to their ephemeral file system).
|
19
19
|
|
@@ -20,7 +20,7 @@ namespace :asdb do
|
|
20
20
|
desc 'ActiveStorageDB: list attachments ordered by blob id desc'
|
21
21
|
task list: [:environment] do |_t, _args|
|
22
22
|
query = ::ActiveStorage::Blob.order(id: :desc).limit(100)
|
23
|
-
digits =
|
23
|
+
digits = query.ids.inject(0) { |ret, id| size = id.to_s.size; [size, ret].max }
|
24
24
|
|
25
25
|
::ActiveStorage::Tasks.print_blob_header(digits: digits)
|
26
26
|
query.each do |blob|
|
@@ -52,7 +52,7 @@ namespace :asdb do
|
|
52
52
|
|
53
53
|
blobs = ::ActiveStorage::Blob.where('filename LIKE ?', "%#{filename}%").order(id: :desc)
|
54
54
|
if blobs.any?
|
55
|
-
digits =
|
55
|
+
digits = blobs.ids.inject(0) { |ret, id| size = id.to_s.size; [size, ret].max }
|
56
56
|
::ActiveStorage::Tasks.print_blob_header(digits: digits)
|
57
57
|
blobs.each do |blob|
|
58
58
|
::ActiveStorage::Tasks.print_blob(blob, digits: digits)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Roccoberton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|
@@ -105,14 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements:
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 2.
|
108
|
+
version: 2.7.0
|
109
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
115
|
+
rubygems_version: 3.4.19
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: ActiveStorage DB Service
|