test_dummy 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/test_dummy.rb +2 -2
  3. data/test_dummy.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
data/lib/test_dummy.rb CHANGED
@@ -253,11 +253,11 @@ module TestDummy
253
253
  when true
254
254
  # Configure association dummyr the first time it is called
255
255
  if (reflection = reflect_on_association(name))
256
- primary_key = reflection.primary_key_name.to_sym
256
+ foreign_key = (reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name).to_sym
257
257
 
258
258
  @test_dummy[name] =
259
259
  lambda do |model, with_attributes|
260
- (with_attributes and with_attributes.key?(primary_key)) ? nil : reflection.klass.send(:create_dummy)
260
+ (with_attributes and with_attributes.key?(foreign_key)) ? nil : reflection.klass.send(:create_dummy)
261
261
  end
262
262
  else
263
263
  raise "Cannot dummy unknown relationship #{name}"
data/test_dummy.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "test_dummy"
8
- s.version = "0.2.7"
8
+ s.version = "0.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tadman"]
12
- s.date = "2011-09-21"
12
+ s.date = "2011-10-03"
13
13
  s.description = "Test Dummy allows you to define how to fake models automatically so that you can use dummy data for testing instead of fixtures. Dummy models are always generated using the current schema and don't need to me migrated like fixtures."
14
14
  s.email = "github@tadman.ca"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_dummy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-21 00:00:00.000000000Z
12
+ date: 2011-10-03 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Test Dummy allows you to define how to fake models automatically so that
15
15
  you can use dummy data for testing instead of fixtures. Dummy models are always