attribution 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/attribution.gemspec +1 -1
- data/lib/attribution/version.rb +1 -1
- data/lib/attribution.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abcb3ede33930d68c99d76201000eea2a878ba72
|
4
|
+
data.tar.gz: 78d1eb1a1e21148853afbd7edc6b7c4e67bdc0a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3c00d1d2eaa859e537daf1fc2b73f3a17a327b3d19efcd686308584ed090792fe0efa4f47483d04805b5bc31f0919ca3f8934fd985e5f407543e3da1f7a2f33
|
7
|
+
data.tar.gz: 6da0d3f42ae5c6d1f1483c75157509d16ac0947d1f0cffab831d80fdd23cd2a0acca833f12f5d79c463a49025d4f27a491560e4420f17efee419cdbec1de6897
|
data/attribution.gemspec
CHANGED
data/lib/attribution/version.rb
CHANGED
data/lib/attribution.rb
CHANGED
@@ -210,7 +210,7 @@ module Attribution
|
|
210
210
|
id_getter = "#{association_name}_id".to_sym
|
211
211
|
add_attribute(id_getter, :integer, metadata)
|
212
212
|
|
213
|
-
association_class_name = metadata.try(:fetch, :class_name, [name.
|
213
|
+
association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.classify].reject(&:blank?).join('::'))
|
214
214
|
|
215
215
|
define_method(id_getter) do
|
216
216
|
ivar = "@#{id_getter}"
|
@@ -274,7 +274,7 @@ module Attribution
|
|
274
274
|
# defaults to a class name based on the association name
|
275
275
|
def has_many(association_name, metadata={})
|
276
276
|
|
277
|
-
association_class_name = metadata.try(:fetch, :class_name, [name.
|
277
|
+
association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.singularize.classify].reject(&:blank?).join('::'))
|
278
278
|
|
279
279
|
# foos
|
280
280
|
define_method(association_name) do |*query|
|