paperclip_database 2.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/features/basic_integration.feature +14 -14
- data/features/step_definitions/rails_steps.rb +4 -4
- data/generators/paperclip_database/paperclip_database_generator.rb +1 -1
- data/generators/paperclip_database/templates/paperclip_database_migration.rb.erb +3 -3
- data/generators/templates/paperclip_database_migration.rb.erb +3 -3
- data/lib/generators/paperclip_database/migration/migration_generator.rb +1 -1
- data/lib/generators/paperclip_database/migration/templates/migration.rb.erb +3 -3
- data/lib/paperclip/storage/database.rb +14 -8
- data/lib/paperclip_database/deconstantize.rb +11 -0
- data/lib/paperclip_database/version.rb +1 -1
- data/lib/paperclip_database.rb +1 -1
- data/paperclip_database.gemspec +3 -2
- data/test/database.yml +3 -0
- data/test/namespaced_models_test.rb +53 -0
- data/test/test_helper.rb +101 -0
- metadata +61 -24
- checksums.yaml +0 -7
data/.gitignore
CHANGED
@@ -3,7 +3,7 @@ Feature: Rails integration
|
|
3
3
|
Background:
|
4
4
|
Given I generate a new rails application
|
5
5
|
And I run a "scaffold" generator to generate a "User" scaffold with "name:string"
|
6
|
-
And I run a "paperclip" generator to add a paperclip "
|
6
|
+
And I run a "paperclip" generator to add a paperclip "avatar" to the "User" model
|
7
7
|
And I run a migration
|
8
8
|
And I update my new user view to include the file upload field
|
9
9
|
And I update my user view to include the attachment
|
@@ -12,34 +12,34 @@ Feature: Rails integration
|
|
12
12
|
Scenario: Database integration test
|
13
13
|
Given I add this snippet to the User model:
|
14
14
|
"""
|
15
|
-
has_attached_file :
|
15
|
+
has_attached_file :avatar,
|
16
16
|
:storage => :database,
|
17
|
-
:database_table => :
|
18
|
-
:url => '/
|
17
|
+
:database_table => :user_avatars,
|
18
|
+
:url => '/user_avatar_views/:id?style=:style'
|
19
19
|
"""
|
20
|
-
And I run a "scaffold" generator to generate a "
|
21
|
-
Given I replace /^ def show$.*?^ end$/ with this snippet in the "
|
20
|
+
And I run a "scaffold" generator to generate a "UserAvatarView" scaffold with ""
|
21
|
+
Given I replace /^ def show$.*?^ end$/ with this snippet in the "user_avatar_views" controller:
|
22
22
|
"""
|
23
23
|
def show
|
24
24
|
style = params[:style] ? params[:style] : 'original'
|
25
25
|
record = User.find(params[:id])
|
26
|
-
send_data record.
|
27
|
-
:filename => record.
|
28
|
-
:type => record.
|
26
|
+
send_data record.avatar.file_contents(style),
|
27
|
+
:filename => record.avatar_file_name,
|
28
|
+
:type => record.avatar_content_type
|
29
29
|
end
|
30
30
|
"""
|
31
|
-
Given I replace /before_action :
|
31
|
+
Given I replace /before_action :set_user_avatar_view.*?$/ with this snippet in the "user_avatar_views" controller:
|
32
32
|
"""
|
33
33
|
"""
|
34
34
|
|
35
|
-
And I run a "paperclip_database:migration" generator to create storage for paperclip "
|
35
|
+
And I run a "paperclip_database:migration" generator to create storage for paperclip "avatar" to the "User" model
|
36
36
|
And I run a migration
|
37
37
|
And I start the rails application
|
38
38
|
When I go to the new user page
|
39
39
|
And I fill in "Name" with "something"
|
40
|
-
And I attach the file "test/fixtures/5k.png" to "
|
40
|
+
And I attach the file "test/fixtures/5k.png" to "Avatar"
|
41
41
|
And I press "Submit"
|
42
42
|
Then I should see "Name: something"
|
43
|
-
And I should see an image with a path of "/
|
44
|
-
And the file at "/
|
43
|
+
And I should see an image with a path of "/user_avatar_views/1?style=original"
|
44
|
+
And the file at "/user_avatar_views/1?style=original" should be the same as "test/fixtures/5k.png"
|
45
45
|
|
@@ -35,7 +35,7 @@ Given "I allow the attachment to be submitted" do
|
|
35
35
|
if framework_major_version == 3
|
36
36
|
transform_file("app/models/user.rb") do |content|
|
37
37
|
content.gsub("attr_accessible :name",
|
38
|
-
"attr_accessible :name, :
|
38
|
+
"attr_accessible :name, :avatar")
|
39
39
|
end
|
40
40
|
else
|
41
41
|
transform_file("app/controllers/users_controller.rb") do |content|
|
@@ -91,8 +91,8 @@ Given /^I update my new user view to include the file upload field$/ do
|
|
91
91
|
<%= form_for @user, :html => { :multipart => true } do |f| %>
|
92
92
|
<%= f.label :name %>
|
93
93
|
<%= f.text_field :name %>
|
94
|
-
<%= f.label :
|
95
|
-
<%= f.file_field :
|
94
|
+
<%= f.label :avatar %>
|
95
|
+
<%= f.file_field :avatar %>
|
96
96
|
<%= submit_tag "Submit" %>
|
97
97
|
<% end %>
|
98
98
|
"""
|
@@ -104,7 +104,7 @@ Given /^I update my user view to include the attachment$/ do
|
|
104
104
|
Given I overwrite "app/views/users/show.html.erb" with:
|
105
105
|
"""
|
106
106
|
<p>Name: <%= @user.name %></p>
|
107
|
-
<p>
|
107
|
+
<p>Avatar: <%= image_tag @user.avatar.url %></p>
|
108
108
|
"""
|
109
109
|
}
|
110
110
|
end
|
@@ -20,7 +20,7 @@ class PaperclipDatabaseGenerator < Rails::Generator::NamedBase
|
|
20
20
|
|
21
21
|
def generate_file_name
|
22
22
|
debugger
|
23
|
-
names = attachments.map{|a| "#{class_name.underscore}_#{a.pluralize}" }
|
23
|
+
names = attachments.map{|a| "#{class_name.underscore.tr('/', '_')}_#{a.pluralize}" }
|
24
24
|
names = names[0..-2] + ["and", names[-1]] if names.length > 1
|
25
25
|
"create_#{names.join('_')}"
|
26
26
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class <%= migration_name %> < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
<% attachments.each do |attachment| -%>
|
4
|
-
create_table :<%= class_name.underscore %>_<%= attachment.pluralize %> do |t|
|
5
|
-
t.integer :<%= class_name.underscore %>_id
|
4
|
+
create_table :<%= class_name.underscore.tr('/', '_') %>_<%= attachment.pluralize %> do |t|
|
5
|
+
t.integer :<%= class_name.underscore.tr('/', '_') %>_id
|
6
6
|
t.string :style
|
7
7
|
t.binary :file_contents
|
8
8
|
end
|
@@ -11,7 +11,7 @@ class <%= migration_name %> < ActiveRecord::Migration
|
|
11
11
|
|
12
12
|
def self.down
|
13
13
|
<% attachments.each do |attachment| -%>
|
14
|
-
drop_table :<%= class_name.underscore %>_<%= attachment.pluralize %>
|
14
|
+
drop_table :<%= class_name.underscore.tr('/', '_') %>_<%= attachment.pluralize %>
|
15
15
|
<% end -%>
|
16
16
|
end
|
17
17
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class <%= migration_name %> < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
<% attachments.each do |attachment| -%>
|
4
|
-
create_table :<%= name.underscore.camelize.tableize %>_<%= attachment.pluralize %> do |t|
|
5
|
-
t.integer :<%= name.underscore.camelize.tableize %>_id
|
4
|
+
create_table :<%= name.underscore.camelize.tableize.tr('/', '_') %>_<%= attachment.pluralize %> do |t|
|
5
|
+
t.integer :<%= name.underscore.camelize.tableize.tr('/', '_') %>_id
|
6
6
|
t.string :style
|
7
7
|
t.binary :file_contents
|
8
8
|
end
|
@@ -11,7 +11,7 @@ class <%= migration_name %> < ActiveRecord::Migration
|
|
11
11
|
|
12
12
|
def self.down
|
13
13
|
<% attachments.each do |attachment| -%>
|
14
|
-
drop_table :<%= name.underscore.camelize.tableize %>_<%= attachment.pluralize %>
|
14
|
+
drop_table :<%= name.underscore.camelize.tableize.tr('/', '_') %>_<%= attachment.pluralize %>
|
15
15
|
<% end -%>
|
16
16
|
end
|
17
17
|
end
|
@@ -24,7 +24,7 @@ module PaperclipDatabase
|
|
24
24
|
protected
|
25
25
|
|
26
26
|
def migration_name
|
27
|
-
"create_#{name.underscore}_#{attachment_names.map{|n| n.pluralize}.join('_and_')}"
|
27
|
+
"create_#{name.underscore.tr('/', '_')}_#{attachment_names.map{|n| n.pluralize}.join('_and_')}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def migration_file_name
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
<% attachment_names.each do |attachment| -%>
|
4
|
-
create_table :<%= class_name.underscore %>_<%= attachment.pluralize %> do |t|
|
5
|
-
t.integer :<%= class_name.underscore %>_id
|
4
|
+
create_table :<%= class_name.underscore.tr('/', '_') %>_<%= attachment.pluralize %> do |t|
|
5
|
+
t.integer :<%= class_name.underscore.tr('/', '_') %>_id
|
6
6
|
t.string :style
|
7
7
|
t.binary :file_contents
|
8
8
|
end
|
@@ -11,7 +11,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|
11
11
|
|
12
12
|
def self.down
|
13
13
|
<% attachment_names.each do |attachment| -%>
|
14
|
-
drop_table :<%= class_name.underscore %>_<%= attachment.pluralize %>
|
14
|
+
drop_table :<%= class_name.underscore.tr('/', '_') %>_<%= attachment.pluralize %>
|
15
15
|
<% end -%>
|
16
16
|
end
|
17
17
|
end
|
@@ -80,10 +80,17 @@ module Paperclip
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def setup_paperclip_files_model
|
83
|
-
#
|
84
|
-
|
85
|
-
|
86
|
-
@
|
83
|
+
# If the model is in a namespace, look up that module
|
84
|
+
if instance.class.name.include?('::')
|
85
|
+
module_name = PaperclipDatabase::deconstantize(instance.class.name)
|
86
|
+
@paperclip_class_module = module_name.constantize rescue Object
|
87
|
+
else
|
88
|
+
@paperclip_class_module = Object
|
89
|
+
end
|
90
|
+
|
91
|
+
@paperclip_files = "#{instance.class.name.demodulize.underscore}_#{name.to_s}_paperclip_files"
|
92
|
+
if !@paperclip_class_module.const_defined?(@paperclip_files.classify)
|
93
|
+
@paperclip_file = @paperclip_class_module.const_set(@paperclip_files.classify, Class.new(::ActiveRecord::Base))
|
87
94
|
@paperclip_file.table_name = @options[:database_table] || name.to_s.pluralize
|
88
95
|
@paperclip_file.validates_uniqueness_of :style, :scope => instance.class.table_name.classify.underscore + '_id'
|
89
96
|
case Rails::VERSION::STRING
|
@@ -93,13 +100,12 @@ module Paperclip
|
|
93
100
|
@paperclip_file.scope :file_for, lambda {|style| @paperclip_file.where('style = ?', style) }
|
94
101
|
end
|
95
102
|
else
|
96
|
-
@paperclip_file =
|
103
|
+
@paperclip_file = @paperclip_class_module.const_get(@paperclip_files.classify)
|
97
104
|
end
|
98
105
|
@database_table = @paperclip_file.table_name
|
99
106
|
#FIXME: This fails when using set_table_name "<myname>" in your model
|
100
107
|
#FIXME: This should be fixed in ActiveRecord...
|
101
|
-
instance.class.has_many @paperclip_files.to_sym, :foreign_key => instance.class.table_name.classify.underscore + '_id'
|
102
|
-
|
108
|
+
instance.class.has_many @paperclip_files.to_sym, :class_name => @paperclip_file.name, :foreign_key => instance.class.table_name.classify.underscore + '_id'
|
103
109
|
end
|
104
110
|
private :setup_paperclip_files_model
|
105
111
|
|
@@ -156,7 +162,7 @@ module Paperclip
|
|
156
162
|
alias_method :to_io, :to_file
|
157
163
|
|
158
164
|
def file_for(style)
|
159
|
-
db_result = instance.send("#{@paperclip_files}").send(:file_for, style.to_s)
|
165
|
+
db_result = instance.send("#{@paperclip_files}").send(:file_for, style.to_s)
|
160
166
|
raise RuntimeError, "More than one result for #{style}" if db_result.size > 1
|
161
167
|
db_result.first
|
162
168
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
module PaperclipDatabase
|
3
|
+
# This function only appears in Rails >= 3.2.1, so define our own copy here
|
4
|
+
def self.deconstantize(path)
|
5
|
+
if Gem::Version.new(::Rails::VERSION::STRING) >= Gem::Version.new('3.2.1')
|
6
|
+
path.deconstantize
|
7
|
+
else
|
8
|
+
path.to_s[0...(path.rindex('::') || 0)]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/paperclip_database.rb
CHANGED
data/paperclip_database.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
1
3
|
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
2
4
|
require 'paperclip_database/version'
|
3
5
|
|
@@ -10,8 +12,7 @@ Gem::Specification.new do |s|
|
|
10
12
|
s.homepage = "https://github.com/softace/paperclip_database"
|
11
13
|
s.summary = "Database storage for paperclip"
|
12
14
|
s.description = "To have all your data in one place: the database"
|
13
|
-
|
14
|
-
s.rubyforge_project = "paperclip_database"
|
15
|
+
s.license = 'MIT'
|
15
16
|
|
16
17
|
s.files = `git ls-files`.split("\n")
|
17
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/test/database.yml
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require File.expand_path("../test_helper", __FILE__)
|
2
|
+
|
3
|
+
module Namespace
|
4
|
+
end
|
5
|
+
|
6
|
+
class NamespacedModelsTest < Test::Unit::TestCase
|
7
|
+
def setup
|
8
|
+
reset_class("Namespace::Model").tap do |klass|
|
9
|
+
klass.table_name = 'namespace_models'
|
10
|
+
klass.has_attached_file :avatar, :storage => :database,
|
11
|
+
:database_table => :namespace_model_avatars
|
12
|
+
end
|
13
|
+
|
14
|
+
ActiveRecord::Base.connection.create_table :namespace_models, :force => true do |table|
|
15
|
+
table.column :avatar_file_name, :string
|
16
|
+
table.column :avatar_content_type, :string
|
17
|
+
table.column :avatar_file_size, :integer
|
18
|
+
table.column :avatar_updated_at, :datetime
|
19
|
+
table.column :avatar_fingerprint, :string
|
20
|
+
end
|
21
|
+
ActiveRecord::Base.connection.create_table :namespace_model_avatars, :force => true do |table|
|
22
|
+
table.column :namespace_model_id, :integer
|
23
|
+
table.column :style, :string
|
24
|
+
table.column :file_contents, :binary
|
25
|
+
end
|
26
|
+
|
27
|
+
@model = Namespace::Model.new
|
28
|
+
file = File.open(fixture_file('5k.png'))
|
29
|
+
|
30
|
+
@model.avatar = file
|
31
|
+
@model.save
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_namespaced_model_detection
|
35
|
+
assert_equal(Namespace, @model.avatar.instance_variable_get(:@paperclip_class_module))
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_class_name_inference
|
39
|
+
assert_equal('model_avatar_paperclip_files', @model.avatar.instance_variable_get(:@paperclip_files))
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_class_inference
|
43
|
+
assert_equal(Namespace::ModelAvatarPaperclipFile, @model.avatar.instance_variable_get(:@paperclip_file))
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_table_name
|
47
|
+
assert_equal('namespace_model_avatars', @model.avatar.instance_variable_get(:@database_table))
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_association
|
51
|
+
assert(@model.methods.include?(:model_avatar_paperclip_files))
|
52
|
+
end
|
53
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'tempfile'
|
3
|
+
require 'pathname'
|
4
|
+
require 'test/unit'
|
5
|
+
require 'active_record'
|
6
|
+
require 'active_record/version'
|
7
|
+
require 'active_support'
|
8
|
+
require 'active_support/core_ext'
|
9
|
+
require 'mocha/setup'
|
10
|
+
require 'ostruct'
|
11
|
+
require 'paperclip'
|
12
|
+
|
13
|
+
ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..')))
|
14
|
+
|
15
|
+
module Rails
|
16
|
+
module RailsVersion
|
17
|
+
STRING = Gem.loaded_specs['rails'].version.to_s
|
18
|
+
end
|
19
|
+
VERSION = RailsVersion
|
20
|
+
|
21
|
+
def root
|
22
|
+
Pathname.new(ROOT).join('tmp')
|
23
|
+
end
|
24
|
+
def env
|
25
|
+
'test'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
$LOAD_PATH << File.join(ROOT, 'lib')
|
30
|
+
$LOAD_PATH << File.join(ROOT, 'lib', 'paperclip')
|
31
|
+
$LOAD_PATH << File.join(ROOT, 'lib', 'paperclip_database')
|
32
|
+
|
33
|
+
require File.join(ROOT, 'lib', 'paperclip_database.rb')
|
34
|
+
|
35
|
+
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
|
36
|
+
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
|
37
|
+
ActiveRecord::Base.establish_connection(config['test'])
|
38
|
+
Paperclip.options[:logger] = ActiveRecord::Base.logger
|
39
|
+
|
40
|
+
def reset_class class_name
|
41
|
+
if class_name.include? '::'
|
42
|
+
module_name = PaperclipDatabase::deconstantize(class_name)
|
43
|
+
class_module = module_name.constantize rescue Object
|
44
|
+
else
|
45
|
+
class_module = Object
|
46
|
+
end
|
47
|
+
class_name = class_name.demodulize
|
48
|
+
|
49
|
+
ActiveRecord::Base.send(:include, Paperclip::Glue)
|
50
|
+
class_module.send(:remove_const, class_name) rescue nil
|
51
|
+
klass = class_module.const_set(class_name, Class.new(ActiveRecord::Base))
|
52
|
+
|
53
|
+
klass.class_eval do
|
54
|
+
include Paperclip::Glue
|
55
|
+
end
|
56
|
+
|
57
|
+
klass.reset_column_information
|
58
|
+
klass.connection_pool.clear_table_cache!(klass.table_name) if klass.connection_pool.respond_to?(:clear_table_cache!)
|
59
|
+
klass.connection.schema_cache.clear_table_cache!(klass.table_name) if klass.connection.respond_to?(:schema_cache)
|
60
|
+
klass
|
61
|
+
end
|
62
|
+
|
63
|
+
def reset_table table_name, &block
|
64
|
+
block ||= lambda { |table| true }
|
65
|
+
ActiveRecord::Base.connection.create_table :dummies, {:force => true}, &block
|
66
|
+
end
|
67
|
+
|
68
|
+
def modify_table table_name, &block
|
69
|
+
ActiveRecord::Base.connection.change_table :dummies, &block
|
70
|
+
end
|
71
|
+
|
72
|
+
def rebuild_model options = {}
|
73
|
+
ActiveRecord::Base.connection.create_table :dummies, :force => true do |table|
|
74
|
+
table.column :title, :string
|
75
|
+
table.column :other, :string
|
76
|
+
table.column :avatar_file_name, :string
|
77
|
+
table.column :avatar_content_type, :string
|
78
|
+
table.column :avatar_file_size, :integer
|
79
|
+
table.column :avatar_updated_at, :datetime
|
80
|
+
table.column :avatar_fingerprint, :string
|
81
|
+
end
|
82
|
+
rebuild_class options
|
83
|
+
end
|
84
|
+
|
85
|
+
def rebuild_class options = {}
|
86
|
+
reset_class("Dummy").tap do |klass|
|
87
|
+
klass.has_attached_file :avatar, options
|
88
|
+
Paperclip.reset_duplicate_clash_check!
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def rebuild_meta_class_of obj, options = {}
|
93
|
+
(class << obj; self; end).tap do |metaklass|
|
94
|
+
metaklass.has_attached_file :avatar, options
|
95
|
+
Paperclip.reset_duplicate_clash_check!
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def fixture_file(filename)
|
100
|
+
File.join(File.dirname(__FILE__), 'fixtures', filename)
|
101
|
+
end
|
metadata
CHANGED
@@ -1,46 +1,52 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip_database
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jarl Friis
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rails
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: 3.0.0
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.0.0
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: paperclip
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: 2.3.0
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: 2.3.0
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: appraisal
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,20 +62,23 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: mocha
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- - '>='
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- - '>='
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: sqlite3
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ~>
|
74
84
|
- !ruby/object:Gem::Version
|
@@ -76,6 +86,7 @@ dependencies:
|
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
91
|
- - ~>
|
81
92
|
- !ruby/object:Gem::Version
|
@@ -83,6 +94,7 @@ dependencies:
|
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: cucumber
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ~>
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ~>
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -97,6 +110,7 @@ dependencies:
|
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: launchy
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
115
|
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
@@ -104,6 +118,7 @@ dependencies:
|
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
123
|
- - ~>
|
109
124
|
- !ruby/object:Gem::Version
|
@@ -111,20 +126,23 @@ dependencies:
|
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: aruba
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
|
-
- - '>='
|
131
|
+
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
117
133
|
version: '0'
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
|
-
- - '>='
|
139
|
+
- - ! '>='
|
123
140
|
- !ruby/object:Gem::Version
|
124
141
|
version: '0'
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: capybara
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
147
|
- - ~>
|
130
148
|
- !ruby/object:Gem::Version
|
@@ -135,6 +153,7 @@ dependencies:
|
|
135
153
|
type: :development
|
136
154
|
prerelease: false
|
137
155
|
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
138
157
|
requirements:
|
139
158
|
- - ~>
|
140
159
|
- !ruby/object:Gem::Version
|
@@ -145,46 +164,52 @@ dependencies:
|
|
145
164
|
- !ruby/object:Gem::Dependency
|
146
165
|
name: bundler
|
147
166
|
requirement: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
148
168
|
requirements:
|
149
|
-
- - '>='
|
169
|
+
- - ! '>='
|
150
170
|
- !ruby/object:Gem::Version
|
151
171
|
version: '0'
|
152
172
|
type: :development
|
153
173
|
prerelease: false
|
154
174
|
version_requirements: !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
155
176
|
requirements:
|
156
|
-
- - '>='
|
177
|
+
- - ! '>='
|
157
178
|
- !ruby/object:Gem::Version
|
158
179
|
version: '0'
|
159
180
|
- !ruby/object:Gem::Dependency
|
160
181
|
name: rake
|
161
182
|
requirement: !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
162
184
|
requirements:
|
163
|
-
- - '>='
|
185
|
+
- - ! '>='
|
164
186
|
- !ruby/object:Gem::Version
|
165
187
|
version: '0'
|
166
188
|
type: :development
|
167
189
|
prerelease: false
|
168
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
169
192
|
requirements:
|
170
|
-
- - '>='
|
193
|
+
- - ! '>='
|
171
194
|
- !ruby/object:Gem::Version
|
172
195
|
version: '0'
|
173
196
|
- !ruby/object:Gem::Dependency
|
174
197
|
name: fakeweb
|
175
198
|
requirement: !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
176
200
|
requirements:
|
177
|
-
- - '>='
|
201
|
+
- - ! '>='
|
178
202
|
- !ruby/object:Gem::Version
|
179
203
|
version: '0'
|
180
204
|
type: :development
|
181
205
|
prerelease: false
|
182
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
|
+
none: false
|
183
208
|
requirements:
|
184
|
-
- - '>='
|
209
|
+
- - ! '>='
|
185
210
|
- !ruby/object:Gem::Version
|
186
211
|
version: '0'
|
187
|
-
description: 'To have all your data in one place: the database'
|
212
|
+
description: ! 'To have all your data in one place: the database'
|
188
213
|
email:
|
189
214
|
- jarl@softace.dk
|
190
215
|
executables: []
|
@@ -234,34 +259,46 @@ files:
|
|
234
259
|
- lib/generators/paperclip_database/migration/templates/migration.rb.erb
|
235
260
|
- lib/paperclip/storage/database.rb
|
236
261
|
- lib/paperclip_database.rb
|
262
|
+
- lib/paperclip_database/deconstantize.rb
|
237
263
|
- lib/paperclip_database/version.rb
|
238
264
|
- paperclip_database.gemspec
|
239
265
|
- rails/init.rb
|
240
266
|
- spec/paperclip_database_spec.rb
|
241
267
|
- spec/spec_helper.rb
|
268
|
+
- test/database.yml
|
242
269
|
- test/fixtures/5k.png
|
270
|
+
- test/namespaced_models_test.rb
|
271
|
+
- test/test_helper.rb
|
243
272
|
homepage: https://github.com/softace/paperclip_database
|
244
|
-
licenses:
|
245
|
-
|
273
|
+
licenses:
|
274
|
+
- MIT
|
246
275
|
post_install_message:
|
247
276
|
rdoc_options: []
|
248
277
|
require_paths:
|
249
278
|
- lib
|
250
279
|
required_ruby_version: !ruby/object:Gem::Requirement
|
280
|
+
none: false
|
251
281
|
requirements:
|
252
|
-
- - '>='
|
282
|
+
- - ! '>='
|
253
283
|
- !ruby/object:Gem::Version
|
254
284
|
version: '0'
|
285
|
+
segments:
|
286
|
+
- 0
|
287
|
+
hash: -127264780216903599
|
255
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
289
|
+
none: false
|
256
290
|
requirements:
|
257
|
-
- - '>='
|
291
|
+
- - ! '>='
|
258
292
|
- !ruby/object:Gem::Version
|
259
293
|
version: '0'
|
294
|
+
segments:
|
295
|
+
- 0
|
296
|
+
hash: -127264780216903599
|
260
297
|
requirements:
|
261
298
|
- ImageMagick
|
262
|
-
rubyforge_project:
|
263
|
-
rubygems_version:
|
299
|
+
rubyforge_project:
|
300
|
+
rubygems_version: 1.8.23
|
264
301
|
signing_key:
|
265
|
-
specification_version:
|
302
|
+
specification_version: 3
|
266
303
|
summary: Database storage for paperclip
|
267
304
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 09d3aa4732581467b9fc42956a01b056ed8886f4
|
4
|
-
data.tar.gz: b6c7a2b6dc89f0b4cf417026c211b27c3a1f3099
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 0d4e3af513f1d0f97e07338ed3ad9f88bb4c452b4b5d06b124190b5e3b57873936ad55ac2693abc8c8d9366ae772849a31b90ea91abaa169d4b737ccce3f1127
|
7
|
-
data.tar.gz: 30e43365c0bd6612037944d90332da8285426a8f2930216ee2d1a6b7aa3b51cb0f68bbc8d1701c09f777982f3afa00aabc3cb07404ac85380487777501eeb8be
|