carrierwave-postgresql 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: dfbb1cb610edffb3f683a73ef0a3e5e288e89a2b
4
- data.tar.gz: 9aa4809b2a07dba40154fce9134900810fa2d4f6
3
+ metadata.gz: 49dae63eba24bc9843965bb2868b89d8538fae5f
4
+ data.tar.gz: 7704451803cbe91f568ab8c77627b0a9d54aa905
5
5
  SHA512:
6
- metadata.gz: 826aa1d1108d53bfee914085735a3862561431e2e9f7a60c2714b8b92b962a2f3c99577cbc2ab954283cbb5f5e3f798d040145d8191b713ed7f8a942dc2bab66
7
- data.tar.gz: 4c16d15339ee777b1539d9238f42331c05292898f4d154da712b4187e2e64146abd76bc4ba57934e11fb1b4257829a2d384141b39cd01837c07176192aabc598
6
+ metadata.gz: 1a2108e137c5898a15a47e993ada63e3ed2f8e537c0d25ee1bdea1d199381bd0a668a42ae68ddcca8c38fb106a41bc8bd2a43724bad15df46f8df16c79d38602
7
+ data.tar.gz: b71412a2b2e4e95d68c3914a1da097a518d13bf76f222e45f025d5d24f7ffe7c0ba7f2f9d8514370723c1524c7be0ecfad59e4b07e281f6be873a2e311dd607d
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This gem adds to [CarrierWave](https://github.com/jnicklas/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.
4
4
 
5
- For more information on PostgreSQL Large Objects you can take a look at the [oficial docs](http://www.postgresql.org/docs/9.2/static/largeobjects.html)
5
+ For more information on PostgreSQL Large Objects you can take a look at the [official docs](http://www.postgresql.org/docs/9.2/static/largeobjects.html)
6
6
 
7
7
  ## Installation
8
8
 
@@ -88,7 +88,7 @@ For more info on CarrierWave take a look at the main [Carrierwave repository](ht
88
88
  Since carrierwave-postgresql doesn't make the files available via HTTP.
89
89
  You can do this using the Rails engine [postgresql_lo_streamer](http://diogob.github.com/postgresql_lo_streamer/).
90
90
 
91
- Alternatively (in case you are not using Rails) you con stream them yourself.
91
+ Alternatively (in case you are not using Rails) you can stream them yourself.
92
92
 
93
93
  The url that will be available from the field where you mounted the uploader will be the model name followed by the attribute name and with the oid as the resource id.
94
94
 
@@ -71,11 +71,12 @@ module CarrierWave
71
71
 
72
72
  def retrieve!(identifier)
73
73
  raise "This uploader must be mounted in an ActiveRecord model to work" unless uploader.model
74
+ @oid = identifier
74
75
  CarrierWave::Storage::PostgresqlLo::File.new(uploader)
75
76
  end
76
77
 
77
78
  def identifier
78
- @oid ||= uploader.model.read_attribute(uploader.mounted_as) || connection.lo_creat
79
+ @oid ||= connection.lo_creat
79
80
  end
80
81
 
81
82
  def connection
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-postgresql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diogo Biazus
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.2.0
133
+ rubygems_version: 2.4.5.1
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Carrierwave storing files in a PostgreSQL database