pluck_all 1.2.2 → 1.2.3

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: 596ba4bec488bc6ca468807fd12b00bc5674fa53
4
- data.tar.gz: 61b78429832d6da496f584c9d53d34f06ca3bbe1
3
+ metadata.gz: 378c4d5a457ca1c5fc1fdcd8b7d3c0cf99c7f384
4
+ data.tar.gz: b660f69cab16a7a0634acd5140383cd65c2eb7ba
5
5
  SHA512:
6
- metadata.gz: 75b6d5c5b6a09b391dd4670c12db2cf293113b04bef353b440af808cb87b56efa7a162e546c3b6201508ea329630077887b44b0c6714f90f09952d59ced79731
7
- data.tar.gz: b836df66e260f585700edaf1d1ca6a48df6079b84e7b7a3364d5e7ca8db8ea685f7d14a4f2b8df24edab44423dac904a54337ae782dd9f663cd7bd863e060168
6
+ metadata.gz: d8f59e9f34c641b1215a0451a55e082da510de9376e11dd13e5f57e731f92236446e4b0a6908ff332ad5e252a8aa2502cabb9f3aa7cf2535ed705a7f1af64e3f
7
+ data.tar.gz: 749572698595cc02c2a184194f69146d06eab02ab837aeb2b13d0fab6196832a26812b6755553ffcc4537e127f837392c2e303692ef921a2d4664afde80b92fd
@@ -68,13 +68,14 @@ private
68
68
  # Support casting CarrierWave url
69
69
  #----------------------------------
70
70
  def cast_carrier_wave_uploader_url(attributes)
71
- if defined?(CarrierWave)
71
+ if defined?(CarrierWave) && klass.respond_to?(:uploaders)
72
72
  @pluck_all_cast_klass ||= klass
73
73
  @pluck_all_uploaders ||= @pluck_all_cast_klass.uploaders.select{|key, uploader| attributes.key?(key.to_s) }
74
74
  @pluck_all_uploaders.each do |key, uploader|
75
- obj = @pluck_all_cast_klass.new
75
+ hash = {}
76
+ @pluck_all_cast_need_columns.each{|k| hash[k] = attributes[k] } if @pluck_all_cast_need_columns
77
+ obj = @pluck_all_cast_klass.new(hash)
76
78
  obj[key] = attributes[key_s = key.to_s]
77
- @pluck_all_cast_need_columns.each{|s| obj[s] = attributes[s] } if @pluck_all_cast_need_columns
78
79
  attributes[key_s] = obj.send(:_mounter, key).uploader #uploaders.first
79
80
  end
80
81
  end
@@ -1,3 +1,3 @@
1
1
  module PluckAll
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "sqlite3", "~> 1.3"
33
33
  spec.add_development_dependency "minitest", "~> 5.0"
34
34
 
35
- spec.add_dependency "rails", ">= 3"
35
+ spec.add_dependency "activerecord", ">= 3"
36
36
 
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluck_all
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rails
70
+ name: activerecord
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="