machinery 0.9.1 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/machinery.rb +6 -3
  2. metadata +3 -3
data/lib/machinery.rb CHANGED
@@ -45,9 +45,12 @@ module Machinery
45
45
  self.instance_variables.each do |ivar|
46
46
  obj = self.instance_variable_get(ivar)
47
47
  next unless obj.is_a?(::ActiveRecord::Base)
48
- clone = obj.clone
49
- clone.id = obj.id
50
- clone.instance_variable_set('@new_record', obj.new_record?)
48
+
49
+ clone = obj.class.new
50
+ clone.instance_variable_set("@attributes", obj.instance_variable_get(:@attributes).dup)
51
+ clone.instance_variable_set("@new_record", obj.new_record?)
52
+ clone.instance_variable_set("@changed_attributes", nil)
53
+
51
54
  self.instance_variable_set(ivar, clone)
52
55
  end
53
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lawrence Pit
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 +11:00
12
+ date: 2009-11-02 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -53,6 +53,6 @@ rubyforge_project:
53
53
  rubygems_version: 1.3.5
54
54
  signing_key:
55
55
  specification_version: 3
56
- summary: Machinery to create object graphs and speed up tests.
56
+ summary: Machinery to create object graphs and speed up tests. No fixtures, no funny magic, just easy and fast plain old ruby.
57
57
  test_files: []
58
58