composite_primary_keys 5.0.11 → 5.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 5.0.12 2013-01-21
2
+ * Fix HasManyAssociation foreign_key_present? method to work with non CPK assocations (Charlie Savage)
3
+
1
4
  == 5.0.11 2013-01-19
2
5
  * Patch HasManyAssociation foreign_key_present? method to work with array of keys (tbeauvais)
3
6
  * Patch reverse_sql_order method to break apart CPKs (tbeauvais)
@@ -41,7 +41,7 @@ module ActiveRecord
41
41
  def foreign_key_present?
42
42
  # CPK
43
43
  # owner.attribute_present?(reflection.association_primary_key)
44
- reflection.association_primary_key.all?{ |key| owner.attribute_present?(key) }
44
+ Array(reflection.association_primary_key).all? {|key| owner.attribute_present?(key)}
45
45
  end
46
46
  end
47
47
  end
@@ -2,7 +2,7 @@ module CompositePrimaryKeys
2
2
  module VERSION
3
3
  MAJOR = 5
4
4
  MINOR = 0
5
- TINY = 11
5
+ TINY = 12
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.11
4
+ version: 5.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-19 00:00:00.000000000 Z
13
+ date: 2013-01-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord