populate-me 0.1.3 → 0.1.4

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: ffa555c375c147ea8402816359b8b225d60c7368
4
- data.tar.gz: d0336d760d44cdcdc82a682b0cc59354df8eafeb
3
+ metadata.gz: 5b6361df8f1da8095437a2994ff4f4eca04b8b73
4
+ data.tar.gz: 486c990a158a2e243ca4f955f00c4be9f5eccc6f
5
5
  SHA512:
6
- metadata.gz: 2db9d92250e619bfb7fea8c8970b739de5f46c790616ff41e7694a02171b931107b1d8b3524ce50982892a4c311b8dbdda251705d626cff95d7763212febc765
7
- data.tar.gz: e2b70515a0afedf3d878d13e061d8e3c2a2cd8ed1748c9e3d32c828c0dfb5c4ce086d985041c391455b44c3f70942d40367431c847bc6e8a1fb2a9ab693b8adc
6
+ metadata.gz: e8a3edaf3676f55612be187c14e8416d70a93018f09b6ac2aaf7bf38968814d89a7d0aa512d7fa9950c5b25e28b382502778a607e8f488b08bd812b780da9ec3
7
+ data.tar.gz: b5630bcd1521d975440b53e34f9e167e38711e8dd5e2b58cc8e25f1cdbb28e63ed3f1c7307b846b1f64268b7d2e3f204af062ee16f5f98f48f07b36c7a61fe29
@@ -53,7 +53,7 @@ module PopulateMe
53
53
  end
54
54
 
55
55
  def variations
56
- self.document.class.fields[self.field][:variations]
56
+ self.document.class.fields[self.field][:variations] || []
57
57
  end
58
58
 
59
59
  def field_filename variation_name=:original
@@ -1,4 +1,4 @@
1
1
  module PopulateMe
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
4
4
 
@@ -17,6 +17,7 @@ describe PopulateMe::Attachment do
17
17
  PopulateMe::Variation.new_image_magick_job(:negated, :jpg, '-negate'),
18
18
  PopulateMe::Variation.new_image_magick_job(:negated_gif, :gif, '-negate')
19
19
  ]
20
+ field :pdf, type: :attachment
20
21
  end
21
22
 
22
23
  subject { NiceAttachment.new(document, field) }
@@ -48,6 +49,11 @@ describe PopulateMe::Attachment do
48
49
  assert_equal 2, variations.size
49
50
  assert_equal :negated, variations[0].name
50
51
  end
52
+ it "Returns an empty array when there is none (as opposed to nil)" do
53
+ variations = NiceAttachment.new(document, :pdf).variations
54
+ assert_instance_of Array, variations
55
+ assert_equal 0, variations.size
56
+ end
51
57
  end
52
58
 
53
59
  describe "#attachee_prefix" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: populate-me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickael Riga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2017-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: web-utils