rails_relations_fix 1.1.0 → 1.1.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -57,7 +57,7 @@ module ActiveRecord
57
57
 
58
58
  method_name = "belongs_to_counter_cache_after_add_for_#{reflection.name}".to_sym
59
59
  define_method(method_name) do
60
- association = self.subject_type.constantize.find(self.subject_id) rescue nil
60
+ association = send(reflection.name).reload rescue nil
61
61
 
62
62
  if send("#{reflection.primary_key_name}_changed?") && send("#{reflection.primary_key_name}_change") != send("#{reflection.primary_key_name}_change").compact
63
63
  association.class.increment_counter(cache_column, association.id) unless association.nil?
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails_relations_fix}
8
- s.version = "1.1.0"
8
+ s.version = "1.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Stanis\305\202aw Kolarzowski"]
12
- s.date = %q{2010-12-27}
12
+ s.date = %q{2010-12-28}
13
13
  s.description = %q{Fix for 2 rails bugs. #3005 Counter_cache and polymorhic association. #3964 Not refreshing association after destroy}
14
14
  s.email = %q{stanislaw.kolarzowski@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_relations_fix
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Stanis\xC5\x82aw Kolarzowski"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-27 00:00:00 +01:00
18
+ date: 2010-12-28 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21