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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d198859156d76d0e0c11d018834a556df0dbdfcb
4
- data.tar.gz: 0a103445301e0ea36e62bf12b6d2089b015b9496
3
+ metadata.gz: abcb3ede33930d68c99d76201000eea2a878ba72
4
+ data.tar.gz: 78d1eb1a1e21148853afbd7edc6b7c4e67bdc0a7
5
5
  SHA512:
6
- metadata.gz: 053aeb28529a3da23866dfdf01f4ccc53d1c9d07517c9e2e22647acef67d73614800b69517f7984b39af2112235f5cda34caab72a3390b8958e7b65bad754629
7
- data.tar.gz: 380264f5c4aaf9df41bc2030de3c281d914983d7482939bcd54b54a2195bf8158b79a3d76a693c97f6ce58ee0aa7c9a5ec7ff44bcecf88b38affac8a9dd6f0fe
6
+ metadata.gz: f3c00d1d2eaa859e537daf1fc2b73f3a17a327b3d19efcd686308584ed090792fe0efa4f47483d04805b5bc31f0919ca3f8934fd985e5f407543e3da1f7a2f33
7
+ data.tar.gz: 6da0d3f42ae5c6d1f1483c75157509d16ac0947d1f0cffab831d80fdd23cd2a0acca833f12f5d79c463a49025d4f27a491560e4420f17efee419cdbec1de6897
data/attribution.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "attribution"
5
- gem.version = "0.6.4"
5
+ gem.version = "0.6.5"
6
6
  gem.authors = ["Paul Barry"]
7
7
  gem.email = ["mail@paulbarry.com"]
8
8
  gem.description = %q{Add attributes to Ruby objects}
@@ -1,3 +1,3 @@
1
1
  module Attribution
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
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.deconstantize, association_name.to_s.classify].reject(&:blank?).join('::'))
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.deconstantize, association_name.to_s.singularize.classify].reject(&:blank?).join('::'))
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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Barry