attach 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab0fc9f1044d78e6529a8acdc8654ca635831cc07bec62f3ec6315e9a6b96814
|
4
|
+
data.tar.gz: 5bfa0ce4d4c3d85c7d9435dbbfaa2170774dd8e74cd5483c5ee0b3560760f4be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b364cb5e049f26116a11cf2d7c8c6a44b53f35ad26a6665c9e2f59937792549537607da7a7dff9b4bc5aab91224252a5495315abbcb10fe3511043032b28600
|
7
|
+
data.tar.gz: 97c06bb92c31f0e6f6c9fee505118dddd9c4626a9419de7760f8fb96944fea36618b8da1d4e55ee0656427cb7dce90429d8d384c1303096cda29aaa5beaf343c
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CreateAttachmentTables < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :attachments do |t|
|
4
|
+
t.integer :owner_id
|
5
|
+
t.string :owner_type, :token, :digest, :role, :type, :file_name, :file_type, :cache_type, :cache_max_age, :disposition
|
6
|
+
t.integer :file_size
|
7
|
+
t.integer :parent_id
|
8
|
+
t.boolean :processed, :default => false
|
9
|
+
t.timestamps
|
10
|
+
t.index :owner_id
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table :attachment_binaries do |t|
|
14
|
+
t.integer :attachment_id
|
15
|
+
t.binary :data, :limit => 10.megabytes
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def down
|
21
|
+
drop_table :attachments
|
22
|
+
drop_table :attachment_binaries
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddCustomDataToAttachments < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def up
|
4
|
+
add_column :attachments, :custom, :text
|
5
|
+
add_column :attachments, :serve, :boolean, :default => true
|
6
|
+
add_index :attachments, :token, :length => 10
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :attachments, :token
|
11
|
+
remove_column :attachments, :custom
|
12
|
+
remove_column :attachments, :serve
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/lib/attach/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attach
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
@@ -37,6 +37,9 @@ executables: []
|
|
37
37
|
extensions: []
|
38
38
|
extra_rdoc_files: []
|
39
39
|
files:
|
40
|
+
- db/migrate/20170301120000_create_attachment_tables.rb
|
41
|
+
- db/migrate/20170314113014_add_custom_data_to_attachments.rb
|
42
|
+
- db/migrate/20181123160000_add_index_to_attachment_binaries.rb
|
40
43
|
- lib/attach.rb
|
41
44
|
- lib/attach/attachment.rb
|
42
45
|
- lib/attach/attachment_binary.rb
|