dumpable 0.1.1 → 0.1.2

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/dumpable.gemspec +1 -1
  3. data/lib/dumpable.rb +5 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/dumpable.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "dumpable"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Hunter"]
data/lib/dumpable.rb CHANGED
@@ -45,7 +45,11 @@ module Dumpable
45
45
  if reflection.macro == :belongs_to
46
46
  object.send("#{reflection.association_foreign_key}=", object.id + id_padding)
47
47
  elsif [:has_many, :has_one].include? reflection.macro
48
- child_object.send("#{reflection.association_primary_key}=", object.id + id_padding)
48
+ if reflection.respond_to?(:foreign_key)
49
+ child_object.send("#{reflection.foreign_key}=", object.id + id_padding)
50
+ else
51
+ child_object.send("#{reflection.primary_key_name}=", object.id + id_padding)
52
+ end
49
53
  end
50
54
  puts child_object.send(:generate_insert_query, id_padding)
51
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumpable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: -1145907992056819388
129
+ hash: -2248843498865931733
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements: