attribution 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87e85e249e4cf33c4188ac53fc9920613e503d6a
4
- data.tar.gz: 4da999e16adcfa45572dbd58525387857ef62498
3
+ metadata.gz: 12d1ee66e33748f0273261f2f31f2aed9749fce0
4
+ data.tar.gz: e731e5e954f650d04db67440d47500523964c6b7
5
5
  SHA512:
6
- metadata.gz: 4c468e7ef528a1ca4ee2188238141ba795d9c8e6a57972828b8cee6a55c38af4cf07e3ea158e73296f28d4edc6f5b1a2d66df08d26e1a81694e311fda214fcbd
7
- data.tar.gz: 7813df84bb4b4b8da04efe111aa3a6b5f3296540656fa91385f8da5457cdaddf363e443b805bd5de38ee38b6cc4c8353e79dfcda82201596f2e4ad4f2dbd0f41
6
+ metadata.gz: 520ce9e0c904901bb12fe599b7b57d6a98bf9eced7772303bc00a8522791d4328a835f10e35ca31e3bc7274716866219a2905426ebac9f7026eec534b10de0f5
7
+ data.tar.gz: 4d06243ae2895146842389b96a95241777df5bf49f920fd2705bcdfcf0e6f2ca35d5b9081ed3d5af3dd159a41f5291a89a827514f428cc6ec3c593c7697f792c
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "attribution"
5
- gem.version = "0.9.2"
5
+ gem.version = "0.10.0"
6
6
  gem.authors = ["Paul Barry"]
7
7
  gem.email = ["mail@paulbarry.com"]
8
8
  gem.description = %q{Add attributes to Ruby objects}
@@ -340,6 +340,8 @@ module Attribution
340
340
  instance_variable_get(ivar)
341
341
  elsif self.class.autoload_associations? && association_class.respond_to?(:all)
342
342
  instance_variable_set(ivar, Array(association_class.all("#{self.class.name.underscore}_id" => id)))
343
+ else
344
+ []
343
345
  end
344
346
  else # Ex: Book.all(:name => "The..."), so we do not want to cache it
345
347
  if self.class.autoload_associations? && association_class.respond_to?(:all)
@@ -1,3 +1,3 @@
1
1
  module Attribution
2
- VERSION = "0.9.2"
2
+ VERSION = "0.10.0"
3
3
  end
@@ -266,6 +266,7 @@ class AttributionTest < Test::Unit::TestCase
266
266
  assert_equal nil, book.time_zone
267
267
  assert_equal nil, book.numbers
268
268
  assert_equal nil, book.location
269
+ assert_equal [], book.chapters
269
270
  end
270
271
 
271
272
  def test_nil
@@ -293,6 +294,7 @@ class AttributionTest < Test::Unit::TestCase
293
294
  assert_equal nil, book.time_zone
294
295
  assert_equal [], book.numbers
295
296
  assert_equal({}, book.location)
297
+ assert_equal [], book.chapters
296
298
  end
297
299
 
298
300
  def test_array_with_scalar
@@ -369,7 +371,7 @@ class AttributionTest < Test::Unit::TestCase
369
371
  def test_disabled_autoload_has_many_associations
370
372
  product = Product.new
371
373
  Order.expects(:all).never
372
- product.orders
374
+ assert_equal [], product.orders
373
375
  end
374
376
 
375
377
  def test_associations
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2013-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport