activerecord-has_count 0.0.5 → 0.1.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: 78e52c38ff10b1de794719aa6f327544b8304ae0
4
- data.tar.gz: 766dc1b12804864e4568afbc69291f8a47cfea33
3
+ metadata.gz: ffb8dbb43a6182ea418d3f984bce272c260c9281
4
+ data.tar.gz: 7aa5927f002580f27aa43045f0e47ac2f3bef58b
5
5
  SHA512:
6
- metadata.gz: 62ac8e11836b08725342c7789503a2e88e9221aa751a48428475eb5ade3ae31d691044adc4c2bc86e2d71ed7dd72c93cd181ff210707c67fc380c6242a53c2d3
7
- data.tar.gz: 09ad20680cdb8ffee408de3247931f115d8f3043e1f690136936feca611423439e051ce20c2aa3672202be6fdddbcc6b0fd34104f04ec056c0589b39af6e77a9
6
+ metadata.gz: bc66a7bf53b05c3103b1c37ca912ccdbc634296b3e38e50a3d0b98c115bbcaf289d817e704de6c23f70a869b48d42710d328e169502b78c8f5453fa43e43717b
7
+ data.tar.gz: 4c7288b358022b5ba972524058e9c2fb50f8b5895a704b733a7e4a8e8769872b8f5f66b74c8da349a82c32bfe65552d91907e0283cb05ecfb15af5b5f01334fd
@@ -5,7 +5,7 @@ module ActiveRecord::Associations::Builder
5
5
  end
6
6
 
7
7
  def valid_options
8
- [:foreign_key]
8
+ [:class_name, :foreign_key]
9
9
  end
10
10
 
11
11
  def self.valid_dependent_options
@@ -16,7 +16,7 @@ module ActiveRecord
16
16
  def klass_with_has_count
17
17
  case macro
18
18
  when :has_count
19
- @klass ||= active_record.send(:compute_type, name_without_count.singularize.classify)
19
+ @klass ||= active_record.send(:compute_type, options[:class_name] || name_without_count.singularize.classify)
20
20
  else
21
21
  klass_without_has_count
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module HasCount
3
- VERSION = "0.0.5"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-has_count
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord