carrierwave_accessors 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3891fe384b5b4099aa661d645161a118e0f8276b
|
4
|
+
data.tar.gz: 6367c61a53d93866b62bda3897e2aec9a6cc2095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f78cb99b0988cae0b7d378462a70e1684eff11f936e97d22ed378dc3e159ba929e40bf42f6d3232d72d0d0573170fc33528449264d3528488f83b246a93a1b03
|
7
|
+
data.tar.gz: 40e8388b81aca10d9eec1eca79907f844268a4bd5b0066a067b721063c401398007eb20bf94aa085a918dc202f9eababe68e7526f04ade233d1803cf8bdaf62d
|
@@ -9,7 +9,7 @@ module CarrierWave
|
|
9
9
|
def mount_uploader(column, uploader=nil, options={}, &block)
|
10
10
|
super
|
11
11
|
|
12
|
-
ar_store = self.stored_attributes.find{|store, attributes| attributes.include?(column)}.first
|
12
|
+
ar_store = self.stored_attributes.find{|store, attributes| attributes.include?(column)}.try(:first)
|
13
13
|
if ar_store
|
14
14
|
class_eval <<-RUBY, __FILE__, __LINE__+1
|
15
15
|
|
@@ -23,7 +23,7 @@ module CarrierWave
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def write_uploader(column, identifier)
|
26
|
-
ar_store = self.class.stored_attributes.find{|store, attributes| attributes.include?(column)}.first
|
26
|
+
ar_store = self.class.stored_attributes.find{|store, attributes| attributes.include?(column)}.try(:first)
|
27
27
|
if ar_store
|
28
28
|
self.send(ar_store)[column.to_s] = identifier
|
29
29
|
else
|
@@ -32,7 +32,7 @@ module CarrierWave
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def read_uploader(column)
|
35
|
-
ar_store = self.class.stored_attributes.find{|store, attributes| attributes.include?(column)}.first
|
35
|
+
ar_store = self.class.stored_attributes.find{|store, attributes| attributes.include?(column)}.try(:first)
|
36
36
|
if ar_store
|
37
37
|
self.send(ar_store)[column.to_s]
|
38
38
|
else
|