administrate-field-refile 0.0.4 → 0.0.6

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: b25b0355ece96b62de76eee04f22574bae84d371
4
- data.tar.gz: adcaee2f588943cf6a8b2b5fd908266c611454b5
3
+ metadata.gz: c798c3e86aa6610b9606e620138d03b4bea02ec1
4
+ data.tar.gz: af0cfe616ad3977963b8e03e603f9e62fca381d9
5
5
  SHA512:
6
- metadata.gz: 761714bb5ff0ac0103b722439e9db2b380d02f928e72587196d3daea08a053e99baa6d42d84fc08b127ec11409298a561cf012cc809297a55f8fa642fe4cf6b9
7
- data.tar.gz: e984f587c16a58746cc8d27f0b20ba280d5d424bb725fd950c6f285feca229542743e5c85e40a839858c62555e93c2a9d063a1355161ef82df330c1363e8f1a8
6
+ metadata.gz: 0cbafad564601329e5228f575df372e48280be79a3b0545dddd7298e5a62ddb7a29ffffad8840ea4ab5a50c7e7d290ef35e41380690873479420e58cc1c1e792
7
+ data.tar.gz: a6900c8219b90524eed0ee0d4aeeec83c72bdc8f79fa612a8d59b231f86479c0a41bcbdb7fc0ce0be7acf38a4d24ce550eaed83dc515aa71e7d7d99052f1685a
@@ -1,10 +1,8 @@
1
1
  $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
- require './lib/administrate/field/refile'
4
-
5
3
  Gem::Specification.new do |gem|
6
4
  gem.name = 'administrate-field-refile'
7
- gem.version = Administrate::Field::Refile::VERSION
5
+ gem.version = '0.0.6'
8
6
  gem.authors = ['Adrian Rangel']
9
7
  gem.email = ['adrian@disruptiveangels.com']
10
8
  gem.homepage = 'https://github.com/disruptiveangels/administrate-field-refile'
@@ -17,7 +15,7 @@ Gem::Specification.new do |gem|
17
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
16
 
19
17
  gem.add_dependency 'administrate', '>= 0.2.0', '< 0.3.0'
20
- gem.add_dependency 'rails', '~> 4.2'
18
+ gem.add_dependency 'rails', '>= 4.2', '< 5.1'
21
19
  gem.add_dependency 'refile', '~> 0.6'
22
20
 
23
21
  gem.add_development_dependency 'rspec', '~> 3.4'
@@ -13,4 +13,11 @@ By default, the attribute is rendered as a link tag.
13
13
 
14
14
  %>
15
15
 
16
- <%= link_to field.attribute, attachment_url(field.parent_instance, field.attribute) %>
16
+ <% return nil if field.data.nil? %>
17
+ <% if @_requested_resource.public_send("#{field.name}").is_a?(Array) %>
18
+ <% @_requested_resource.public_send("#{field.name.split('_')[0]}").each do |photo| %>
19
+ <%= link_to photo.file_filename, attachment_url(photo, :file) %>
20
+ <% end %>
21
+ <% else %>
22
+ <%= link_to @_requested_resource.public_send("#{field.name}_filename"), attachment_url(@_requested_resource, field.attribute) %>
23
+ <% end %>
@@ -4,7 +4,6 @@ require 'rails'
4
4
  module Administrate
5
5
  module Field
6
6
  class Refile < Administrate::Field::Base
7
- VERSION = '0.0.4'
8
7
  class Engine < ::Rails::Engine
9
8
  end
10
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-refile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Rangel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: rails
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '4.2'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '5.1'
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
45
48
  - !ruby/object:Gem::Version
46
49
  version: '4.2'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '5.1'
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: refile
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
114
  version: '0'
109
115
  requirements: []
110
116
  rubyforge_project:
111
- rubygems_version: 2.6.1
117
+ rubygems_version: 2.5.1
112
118
  signing_key:
113
119
  specification_version: 4
114
120
  summary: Add Refile fields to Administrate