carrierwave-postgresql 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/carrierwave-postgresql.gemspec +3 -3
- data/lib/carrierwave/storage/postgresql_lo.rb +3 -3
- data/spec/storage/file_spec.rb +5 -0
- data/spec/support/active_record.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d569c47974ded4a8ce2a9b2f6592f7e04ef9d51f
|
4
|
+
data.tar.gz: 847284f0bcb132d7516ca309899e31b463d13acf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dace2513b9a0a8cdf883d64d54f2ebbc1f443ca206afea3caa5750b4f665ee74dcfd2132fc22ccc8aa387a468582c58878375c82fac31b6065b21c07447c3e8
|
7
|
+
data.tar.gz: 82a26928c5edb5360e5c442aa49c8e9f9474b615619cbce17828ec12089adaaec69b0cabac2ea23de8cb0d6953edeec1720b48847f7112a8138bf823930523ee
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "carrierwave-postgresql"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Diogo Biazus"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-11-19"
|
13
13
|
s.description = "This gem adds to carrierwave a storage facility which will use the PostgreSQL's oid datatype to reference a large object residing in the databse. It supports up to 2GB files, though it's better suited for smaller ones. Makes life easier for fast prototyping and put all your data in the same place, allows one backup for all your data and file storage in heroku servers."
|
14
14
|
s.email = "diogo@biazus.me"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.homepage = "http://diogob.github.com/carrierwave-postgresql/"
|
41
41
|
s.licenses = ["MIT"]
|
42
42
|
s.require_paths = ["lib"]
|
43
|
-
s.rubygems_version = "2.0.
|
43
|
+
s.rubygems_version = "2.0.7"
|
44
44
|
s.summary = "Use PostgreSQL large objects (AKA BLOBs) to store your files inside the database"
|
45
45
|
|
46
46
|
if s.respond_to? :specification_version then
|
@@ -8,7 +8,7 @@ module CarrierWave
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def url
|
11
|
-
"/#{@uploader.model.class.name.
|
11
|
+
"/#{@uploader.model.class.name.underscore.gsub('/', '_')}_#{@uploader.mounted_as.to_s.underscore}/#{identifier}"
|
12
12
|
end
|
13
13
|
|
14
14
|
def read
|
@@ -48,7 +48,7 @@ module CarrierWave
|
|
48
48
|
alias :size :file_length
|
49
49
|
|
50
50
|
def connection
|
51
|
-
@connection ||= @uploader.model.connection.raw_connection
|
51
|
+
@connection ||= @uploader.model.class.connection.raw_connection
|
52
52
|
end
|
53
53
|
|
54
54
|
def identifier
|
@@ -78,7 +78,7 @@ module CarrierWave
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def connection
|
81
|
-
@connection ||= uploader.model.connection.raw_connection
|
81
|
+
@connection ||= uploader.model.class.connection.raw_connection
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
data/spec/storage/file_spec.rb
CHANGED
@@ -16,6 +16,11 @@ describe CarrierWave::Storage::PostgresqlLo::File do
|
|
16
16
|
describe "#url" do
|
17
17
|
subject{ file.url }
|
18
18
|
it{ should == "/test_file/0" }
|
19
|
+
|
20
|
+
context "on a namespaced model" do
|
21
|
+
let(:test_model){ Namespace::Test.new }
|
22
|
+
it{ should == "/namespace_test_file/0" }
|
23
|
+
end
|
19
24
|
end
|
20
25
|
|
21
26
|
describe "#write" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diogo Biazus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.0.
|
162
|
+
rubygems_version: 2.0.7
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Use PostgreSQL large objects (AKA BLOBs) to store your files inside the database
|