sample_models 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5
1
+ 1.2.6
@@ -107,7 +107,12 @@ module SampleModels
107
107
  model.validation_collections.each do |field, validation_collection|
108
108
  assoc_key = nil
109
109
  if assoc = model.belongs_to_associations.detect { |a|
110
- a.association_foreign_key == field.to_s
110
+ foreign_key = if a.respond_to?(:foreign_key)
111
+ a.foreign_key
112
+ else
113
+ a.primary_key_name
114
+ end
115
+ foreign_key == field.to_s
111
116
  }
112
117
  assoc_key = assoc.name
113
118
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sample_models}
8
- s.version = "1.2.5"
8
+ s.version = "1.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Francis Hwang"]
12
- s.date = %q{2011-11-16}
12
+ s.date = %q{2011-11-18}
13
13
  s.description = %q{
14
14
  A library for making it extremely fast for Rails developers to set up and save ActiveRecord instances when writing test cases. It aims to:
15
15
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sample_models
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 5
10
- version: 1.2.5
9
+ - 6
10
+ version: 1.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Francis Hwang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-16 00:00:00 -05:00
18
+ date: 2011-11-18 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency