paperclip_database 3.0.0 → 3.1.0

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: dc0e64ec2f6483478bbdcffc5be692195470c84b63a9a53ad60fc8d5352fc932
4
- data.tar.gz: 3c7f68145df36a487a351065d94fdef7214613261ef96bb2aaffd52ee60cb001
3
+ metadata.gz: c66bf9b6a5634a776f394e7513407593c2ce770609476ee559693aed990ce08b
4
+ data.tar.gz: 35f44887de4e4ae03d1b38b1805cc710c90f9c0213a02e36d2f176cdda2e5660
5
5
  SHA512:
6
- metadata.gz: 01af3d0e0325652599b23027dae2b96cf11e6ec316472491ccb95dc9a09d5a1607626de4c3cefeefa115dd5685def33605184f060aa6fe3c7aba636415236450
7
- data.tar.gz: fdf8fff873eee611d43cc031a181fb7a1e12951d6e3b478ebd107cec73499236625abdf44ba58e0f1e05ad5dbbcb3cc96b0df8257a6f8c146505c6c55f0dc728
6
+ metadata.gz: 64684bd642348c67cf99a0be22acd89870a8c3e57c1eb5c8c328a87b474e97413b6716238b22664382a7710eb9d313a84a47b24fa8ec20405efb3c24ef3b3268
7
+ data.tar.gz: 849af3ee0e30b46ac85069ff29fb6ecc480062017d36e72688e68478e74f7d69b6bac9b9c23784faff53512fb7adaeed9d324c89bae43dcf67bcd38c13454ea0
@@ -11,9 +11,5 @@ gemfile:
11
11
  - gemfiles/rails50_paperclip4x.gemfile
12
12
  - gemfiles/rails50_paperclip5x.gemfile
13
13
  - gemfiles/rails50_paperclip6x.gemfile
14
- # - gemfiles/rails51_paperclip4x.gemfile
15
- # - gemfiles/rails51_paperclip5x.gemfile
16
- # - gemfiles/rails51_paperclip6x.gemfile
17
- # - gemfiles/rails52_paperclip4x.gemfile
18
- # - gemfiles/rails52_paperclip5x.gemfile
19
- # - gemfiles/rails52_paperclip6x.gemfile
14
+ - gemfiles/rails51_paperclip6x.gemfile
15
+ - gemfiles/rails52_paperclip6x.gemfile
data/Appraisals CHANGED
@@ -48,53 +48,24 @@ appraise "rails50_paperclip6x" do
48
48
  gem 'capybara'
49
49
  gem 'rspec'
50
50
  gem 'sqlite3', '~> 1.3.0'
51
+ gem 'bootsnap', '~> 1.0', require: false
51
52
  end
52
53
 
53
- # appraise "rails51_paperclip4x" do
54
- # gem "rails", "~> 5.1.0"
55
- # gem "paperclip", "~> 4.0"
56
- # gem 'capybara'
57
- # gem 'rspec'
58
- # gem 'sqlite3', '~> 1.3.0'
59
- # end
60
-
61
- # appraise "rails51_paperclip5x" do
62
- # gem "rails", "~> 5.1.0"
63
- # gem "paperclip", "~> 5.0"
64
- # gem 'capybara'
65
- # gem 'rspec'
66
- # gem 'sqlite3', '~> 1.3.0'
67
- # end
68
-
69
- # appraise "rails51_paperclip6x" do
70
- # gem "rails", "~> 5.1.0"
71
- # gem "paperclip", "~> 6.0"
72
- # gem 'capybara'
73
- # gem 'rspec'
74
- # gem 'sqlite3', '~> 1.3.0'
75
- # end
76
-
77
- # appraise "rails52_paperclip4x" do
78
- # gem "rails", "~> 5.2.0"
79
- # gem "paperclip", "~> 4.0"
80
- # gem 'capybara'
81
- # gem 'rspec'
82
- # gem 'sqlite3', '~> 1.3.0'
83
- # end
84
-
85
- # appraise "rails52_paperclip5x" do
86
- # gem "rails", "~> 5.2.0"
87
- # gem "paperclip", "~> 5.0"
88
- # gem 'capybara'
89
- # gem 'rspec'
90
- # gem 'sqlite3', '~> 1.3.0'
91
- # end
54
+ appraise "rails51_paperclip6x" do
55
+ gem "rails", "~> 5.1.0"
56
+ gem "paperclip", "~> 6.0"
57
+ gem 'capybara'
58
+ gem 'rspec'
59
+ gem 'sqlite3', '~> 1.3.0'
60
+ gem 'bootsnap', '~> 1.0', require: false
61
+ end
92
62
 
93
- # appraise "rails52_paperclip6x" do
94
- # gem "rails", "~> 5.2.0"
95
- # gem "paperclip", "~> 6.0"
96
- # gem 'capybara'
97
- # gem 'rspec'
98
- # gem 'sqlite3', '~> 1.3.0'
99
- # end
63
+ appraise "rails52_paperclip6x" do
64
+ gem "rails", "~> 5.2.0"
65
+ gem "paperclip", "~> 6.0"
66
+ gem 'capybara'
67
+ gem 'rspec'
68
+ gem 'sqlite3', '~> 1.3.0'
69
+ gem 'bootsnap', '~> 1.0', require: false
70
+ end
100
71
 
data/README.md CHANGED
@@ -45,7 +45,11 @@ Supported Versions
45
45
 
46
46
  As of version 2.0, Rails 2 is no longer supported.
47
47
  As of version 3.0, Rails 3 is no longer supported.
48
- Supported version are rails >= 4.2 and paperclip version >= 2.3
48
+ Supported versions are rails from >= 4.2 to < 6.0 and paperclip version >= 2.3
49
+ As Paperclip is deprecated and final rails support for that was rails 5.x this gem will equally no longer going to be updated to more than rails 5.x
50
+
51
+
52
+
49
53
 
50
54
  Quick Start
51
55
  -----------
@@ -1,3 +1,4 @@
1
+ @announce
1
2
  Feature: Rails integration
2
3
 
3
4
  Background:
@@ -7,5 +7,6 @@ gem "paperclip", "~> 6.0"
7
7
  gem "capybara"
8
8
  gem "rspec"
9
9
  gem "sqlite3", "~> 1.3.0"
10
+ gem "bootsnap", "~> 1.0", require: false
10
11
 
11
12
  gemspec path: "../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 5.1.0"
6
+ gem "paperclip", "~> 6.0"
7
+ gem "capybara"
8
+ gem "rspec"
9
+ gem "sqlite3", "~> 1.3.0"
10
+ gem "bootsnap", "~> 1.0", require: false
11
+
12
+ gemspec path: "../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+ gem "paperclip", "~> 6.0"
7
+ gem "capybara"
8
+ gem "rspec"
9
+ gem "sqlite3", "~> 1.3.0"
10
+ gem "bootsnap", "~> 1.0", require: false
11
+
12
+ gemspec path: "../"
@@ -18,7 +18,7 @@ module PaperclipDatabase
18
18
  end
19
19
 
20
20
  def generate_migration
21
- migration_template "migration.rb.erb", "db/migrate/#{migration_file_name}"
21
+ migration_template "migration.rb.erb", "db/migrate/#{migration_file_name}", migration_version: migration_version
22
22
  end
23
23
 
24
24
  def migration_name
@@ -33,6 +33,12 @@ module PaperclipDatabase
33
33
  migration_name.camelize
34
34
  end
35
35
 
36
+ def migration_version
37
+ if Rails.version.to_i >= 5
38
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
39
+ end
40
+ end
41
+
36
42
  end
37
43
  end
38
44
  end
@@ -1,4 +1,4 @@
1
- class <%= migration_class_name %> < ActiveRecord::Migration
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  <%
4
4
  module_names = class_name.underscore.split('/')[0...-1]
@@ -104,7 +104,7 @@ module Paperclip
104
104
  case ActiveModel::VERSION::MAJOR
105
105
  when 3, 4
106
106
  @paperclip_file_model.scope :file_for, lambda {|style| @paperclip_file_model.where('style = ?', style) }
107
- when 5
107
+ when 5,6
108
108
  @paperclip_file_model.scope :file_for, lambda {|style| where('style = ?', style) }
109
109
  else
110
110
  raise "ActiveModel version #{ActiveModel::VERSION::STRING} is not supported (yet)"
@@ -197,9 +197,7 @@ module Paperclip
197
197
  case ActiveModel::VERSION::MAJOR
198
198
  when 3
199
199
  paperclip_file = instance.send(@paperclip_files_association_name).send(:find_or_create_by_style, style.to_s)
200
- when 4
201
- paperclip_file = instance.send(@paperclip_files_association_name).send(:find_or_create_by, style: style.to_s)
202
- when 5
200
+ when 4,5,6
203
201
  paperclip_file = instance.send(@paperclip_files_association_name).send(:find_or_create_by, style: style.to_s)
204
202
  else
205
203
  raise "ActiveModel version #{ActiveModel::VERSION::STRING} is not supported (yet)"
@@ -1,3 +1,3 @@
1
1
  module PaperclipDatabase
2
- VERSION = "3.0.0" unless defined? PaperclipDatabase::VERSION
2
+ VERSION = "3.1.0" unless defined? PaperclipDatabase::VERSION
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip_database
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarl Friis
@@ -202,6 +202,8 @@ files:
202
202
  - gemfiles/rails50_paperclip4x.gemfile
203
203
  - gemfiles/rails50_paperclip5x.gemfile
204
204
  - gemfiles/rails50_paperclip6x.gemfile
205
+ - gemfiles/rails51_paperclip6x.gemfile
206
+ - gemfiles/rails52_paperclip6x.gemfile
205
207
  - lib/generators/paperclip_database/migration/USAGE
206
208
  - lib/generators/paperclip_database/migration/migration_generator.rb
207
209
  - lib/generators/paperclip_database/migration/templates/migration.rb.erb