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 +4 -4
- data/attribution.gemspec +1 -1
- data/lib/attribution.rb +2 -0
- data/lib/attribution/version.rb +1 -1
- data/test/attribution_test.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12d1ee66e33748f0273261f2f31f2aed9749fce0
|
4
|
+
data.tar.gz: e731e5e954f650d04db67440d47500523964c6b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 520ce9e0c904901bb12fe599b7b57d6a98bf9eced7772303bc00a8522791d4328a835f10e35ca31e3bc7274716866219a2905426ebac9f7026eec534b10de0f5
|
7
|
+
data.tar.gz: 4d06243ae2895146842389b96a95241777df5bf49f920fd2705bcdfcf0e6f2ca35d5b9081ed3d5af3dd159a41f5291a89a827514f428cc6ec3c593c7697f792c
|
data/attribution.gemspec
CHANGED
data/lib/attribution.rb
CHANGED
@@ -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)
|
data/lib/attribution/version.rb
CHANGED
data/test/attribution_test.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|