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: 9cff36ae9c3e8743716b07f85beea65160d1db37
4
- data.tar.gz: a9c9e9fa6d03d26a75e8cbe0e2a72ba742dc6d1e
3
+ metadata.gz: 3891fe384b5b4099aa661d645161a118e0f8276b
4
+ data.tar.gz: 6367c61a53d93866b62bda3897e2aec9a6cc2095
5
5
  SHA512:
6
- metadata.gz: 77a76711b1d3c05e27320707284405691d1d227cf44f31ac370eb70a40bcea17eb13fb832b758f56bf7348ffd1e6435b55cbdd253435bc1206c43ab141e20686
7
- data.tar.gz: 48375bfa1cc24273bacd240ae7a9d9549e64aed4374de26bf3f40e36f0956168cbe04c562e02ee38fe3c414acbc6db44689929499961d9d163c06a0bb2b4432e
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
@@ -1,3 +1,3 @@
1
1
  module CarrierwaveAccessors
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_accessors
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
  - Grigory Antonov