administrate-field-paperclip 0.0.1 → 0.0.2

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: 3d41e35ed69b05f97239bfc3d8761ce29c423d55
4
- data.tar.gz: 1243a8110b8f491f69a82c3fdeb9cd9fa60d4e82
3
+ metadata.gz: ee16d28996faaddc47f31c7a8c5f817d46dd114a
4
+ data.tar.gz: 44f9346ebf5c4e3684c84aa057ddc36d084af810
5
5
  SHA512:
6
- metadata.gz: '01836a41e2120c6a1a2873770be1abe15893cc4082b914a2a224711164c7230c51942ddf6f4d1fc9f7244a7750b2465469f24e622cec89bd0048e13706eee0d2'
7
- data.tar.gz: b731b352618d245bcfb251be6b1e12f9f459925ce6ec8cf5c065903fdc0046b057f62ad379c87e53abd05d67c9f549405ea873a448eda74d36199f9bb4b4e557
6
+ metadata.gz: 7db40f29e4215404bf99062c401e1c23c76c1649f50cfbf83f3967476a65660631bd6948afd028119dbb76507c2b93a3dcf3670458fa5742fae69f4ec8919826
7
+ data.tar.gz: 5bc6bc633197f93dae28a596574d7d58d6028be0e37cd005d4f74ae91307e0b9b83a199b3299b3421c7b3301898b7a4e2597b35c1d059dade0c5215397f06c4e
data/README.md CHANGED
@@ -19,7 +19,7 @@ $ bundle install
19
19
 
20
20
  Follow the [instructions on Paperclip](https://github.com/thoughtbot/paperclip#quick-start) to get started with your models and migrations. Once you've added the Paperclip attribute to your models, edit your Administrate dashboards. If you added 'avatar' to 'User', then you should:
21
21
 
22
- * Add `avatar: Field::PaperclipField` to `ATTRIBUTE_TYPES`.
22
+ * Add `avatar: Field::Paperclip` to `ATTRIBUTE_TYPES`.
23
23
  * Add `:avatar` to `FORM_ATTRIBUTES`, `SHOW_PAGE_ATTRIBUTES` and (optionally) `COLLECTION_ATTRIBUTES`.
24
24
 
25
25
  Based on the [Administrate::Field::Image](https://github.com/thoughtbot/administrate-field-image) template.
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'administrate-field-paperclip'
5
- gem.version = '0.0.1'
5
+ gem.version = '0.0.2'
6
6
  gem.authors = ['Fernando Briano']
7
7
  gem.email = ['fernando@picandocodigo.net']
8
8
  gem.homepage = 'https://github.com/picandocodigo/administrate-field-paperclip'
@@ -3,7 +3,7 @@ require 'rails'
3
3
 
4
4
  module Administrate
5
5
  module Field
6
- class PaperclipField < Administrate::Field::Base
6
+ class Paperclip < Administrate::Field::Base
7
7
  def url
8
8
  data.url
9
9
  end
@@ -0,0 +1,14 @@
1
+ require "administrate/field/paperclip"
2
+
3
+ describe Administrate::Field::Paperclip do
4
+ describe '#to_partial_path' do
5
+ it 'returns a partial based on the page being rendered' do
6
+ page = :show
7
+ field = Administrate::Field::Paperclip.new(:paperclip, '/a.jpg', page)
8
+
9
+ path = field.to_partial_path
10
+
11
+ expect(path).to eq("/fields/paperclip/#{page}")
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -65,10 +65,11 @@ files:
65
65
  - README.md
66
66
  - Rakefile
67
67
  - administrate-field-paperclip.gemspec
68
- - app/views/fields/paperclip_field/_form.html.erb
69
- - app/views/fields/paperclip_field/_index.html.erb
70
- - app/views/fields/paperclip_field/_show.html.erb
68
+ - app/views/fields/paperclip/_form.html.erb
69
+ - app/views/fields/paperclip/_index.html.erb
70
+ - app/views/fields/paperclip/_show.html.erb
71
71
  - lib/administrate/field/paperclip.rb
72
+ - spec/paperclip_spec.rb
72
73
  homepage: https://github.com/picandocodigo/administrate-field-paperclip
73
74
  licenses:
74
75
  - MIT