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: c7bbf0eb92bb9ffe4e7856ab71aed188f446a714508e0c18d2894f2438a81e0f
4
- data.tar.gz: 9517712508be371342f5e5fb0cfb110b8e628c4935ab0096b13c473c1afe91e7
3
+ metadata.gz: ab0fc9f1044d78e6529a8acdc8654ca635831cc07bec62f3ec6315e9a6b96814
4
+ data.tar.gz: 5bfa0ce4d4c3d85c7d9435dbbfaa2170774dd8e74cd5483c5ee0b3560760f4be
5
5
  SHA512:
6
- metadata.gz: ce2d2f261ab5eefa1583eec1b1180abc138c1ce6017499df74b2c42dc755aba48e6a267f23cf317329a1bfeba531e3ca3c34f807069887cf00d4ed136be0c35c
7
- data.tar.gz: 604117cd6a9825a8bb8e586c1330daaef67221f080ed343b6397d2a0c76d5a0ad575a0f45f997cd177c7c99d316880eb03cc863a286cea41ac859ffffd04d797
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
@@ -0,0 +1,11 @@
1
+ class AddIndexToAttachmentBinaries < ActiveRecord::Migration
2
+
3
+ def up
4
+ add_index :attachment_binaries, :attachment_id
5
+ end
6
+
7
+ def down
8
+ remove_index :attachment_binaries, :attachment_id
9
+ end
10
+
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Attach
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
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.0
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