deep_cloneable 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db1696a5b12a6de3c8780ae4eabaf94531dc7213
4
- data.tar.gz: 392237ca46af2ff5c40e19b03988fc4c092fec89
3
+ metadata.gz: 7a7680d6c3370d3475be4b547fbf43ffc7ea8226
4
+ data.tar.gz: 2677691cbdaf728802ef7d1b3f43f4d6d4f276ca
5
5
  SHA512:
6
- metadata.gz: e6925639f7cb22d67cd55e24357df3a1f9a53093f0547c2e6bb0e56b268868c31eb8695b675b2b6f81dd16a750e0b4c6702aec2605b73efbfecfd5b546525925
7
- data.tar.gz: b53468ac2757bc8149fe40b50732e85ed618e14803d95d7c95489f9bbd4a5b31bf71118f3d233f553f946593f997cc26b39d634fa454015748f963b4f81f5829
6
+ metadata.gz: b815aae3d32934a3d1bd8c477f22a2f872943f2d056276ab1e1450ff6ff5f87c3499169af4c57530cdf4db869093f7b49d03ea5c0b6f585b0b1b23e8d7ae3b3c
7
+ data.tar.gz: 719fd3c785ebea996fbf61095e9703fe5ba0df685278ed2276f768f05e3fe9dfe61680fa919b4f89b30fdc89613baa5f2088e6c5483ed2ba13faff950be0dfcc
data/.travis.yml CHANGED
@@ -3,12 +3,14 @@ rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.5
6
7
 
7
8
  gemfile:
8
9
  - gemfiles/3.1.gemfile
9
10
  - gemfiles/3.2.gemfile
10
11
  - gemfiles/4.0.gemfile
11
12
  - gemfiles/4.1.gemfile
13
+ - gemfiles/4.2.gemfile
12
14
 
13
15
  matrix:
14
16
  exclude:
@@ -16,7 +18,11 @@ matrix:
16
18
  gemfile: gemfiles/4.0.gemfile
17
19
  - rvm: 1.8.7
18
20
  gemfile: gemfiles/4.1.gemfile
21
+ - rvm: 1.8.7
22
+ gemfile: gemfiles/4.2.gemfile
19
23
  - rvm: 1.9.2
20
24
  gemfile: gemfiles/4.0.gemfile
21
25
  - rvm: 1.9.2
22
- gemfile: gemfiles/4.1.gemfile
26
+ gemfile: gemfiles/4.1.gemfile
27
+ - rvm: 1.9.2
28
+ gemfile: gemfiles/4.2.gemfile
data/Appraisals CHANGED
@@ -12,4 +12,8 @@ end
12
12
 
13
13
  appraise '4.1' do
14
14
  gem 'activerecord', '~> 4.1.0'
15
+ end
16
+
17
+ appraise '4.2' do
18
+ gem 'activerecord', '~> 4.2.0.rc3'
15
19
  end
data/Gemfile CHANGED
@@ -6,7 +6,8 @@ gem 'minitest', :group => :test
6
6
  gem 'appraisal', :group => :test
7
7
  gem 'sqlite3', :group => :test
8
8
  gem 'rdoc', '>= 2.4.2', :group => :test
9
- #gem 'debugger', :group => :test
9
+
10
+ gem 'nokogiri', '~> 1.5.0', :group => :test
10
11
 
11
12
  group :test do
12
13
  gem 'jeweler'
data/Gemfile.lock CHANGED
@@ -1,31 +1,29 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (4.0.1)
5
- activesupport (= 4.0.1)
6
- builder (~> 3.1.0)
7
- activerecord (4.0.1)
8
- activemodel (= 4.0.1)
9
- activerecord-deprecated_finders (~> 1.0.2)
10
- activesupport (= 4.0.1)
11
- arel (~> 4.0.0)
12
- activerecord-deprecated_finders (1.0.3)
13
- activesupport (4.0.1)
14
- i18n (~> 0.6, >= 0.6.4)
15
- minitest (~> 4.2)
16
- multi_json (~> 1.3)
4
+ activemodel (4.2.0.rc3)
5
+ activesupport (= 4.2.0.rc3)
6
+ builder (~> 3.1)
7
+ activerecord (4.2.0.rc3)
8
+ activemodel (= 4.2.0.rc3)
9
+ activesupport (= 4.2.0.rc3)
10
+ arel (~> 6.0)
11
+ activesupport (4.2.0.rc3)
12
+ i18n (>= 0.7.0.beta1, < 0.8)
13
+ json (~> 1.7, >= 1.7.7)
14
+ minitest (~> 5.1)
17
15
  thread_safe (~> 0.1)
18
- tzinfo (~> 0.3.37)
19
- addressable (2.3.5)
20
- appraisal (0.5.2)
16
+ tzinfo (~> 1.1)
17
+ addressable (2.3.6)
18
+ appraisal (1.0.2)
21
19
  bundler
22
20
  rake
23
- arel (4.0.1)
24
- atomic (1.1.14)
25
- builder (3.1.4)
26
- faraday (0.8.8)
21
+ thor (>= 0.14.0)
22
+ arel (6.0.0)
23
+ builder (3.2.2)
24
+ faraday (0.8.9)
27
25
  multipart-post (~> 1.2.0)
28
- git (1.2.6)
26
+ git (1.2.8)
29
27
  github_api (0.10.1)
30
28
  addressable
31
29
  faraday (~> 0.8.1)
@@ -33,42 +31,40 @@ GEM
33
31
  multi_json (~> 1.4)
34
32
  nokogiri (~> 1.5.2)
35
33
  oauth2
36
- hashie (2.0.4)
37
- highline (1.6.20)
38
- httpauth (0.2.0)
39
- i18n (0.6.5)
40
- jeweler (1.8.8)
34
+ hashie (3.3.2)
35
+ highline (1.6.21)
36
+ i18n (0.7.0.beta1)
37
+ jeweler (2.0.1)
41
38
  builder
42
- bundler (~> 1.0)
39
+ bundler (>= 1.0)
43
40
  git (>= 1.2.5)
44
- github_api (= 0.10.1)
41
+ github_api
45
42
  highline (>= 1.6.15)
46
- nokogiri (= 1.5.10)
43
+ nokogiri (>= 1.5.10)
47
44
  rake
48
45
  rdoc
49
46
  json (1.8.1)
50
- jwt (0.1.8)
51
- multi_json (>= 1.5)
52
- minitest (4.7.5)
53
- multi_json (1.8.2)
47
+ jwt (1.2.0)
48
+ minitest (5.5.0)
49
+ multi_json (1.10.1)
54
50
  multi_xml (0.5.5)
55
51
  multipart-post (1.2.0)
56
- nokogiri (1.5.10)
57
- oauth2 (0.9.2)
58
- faraday (~> 0.8)
59
- httpauth (~> 0.2)
60
- jwt (~> 0.1.4)
61
- multi_json (~> 1.0)
52
+ nokogiri (1.5.11)
53
+ oauth2 (1.0.0)
54
+ faraday (>= 0.8, < 0.10)
55
+ jwt (~> 1.0)
56
+ multi_json (~> 1.3)
62
57
  multi_xml (~> 0.5)
63
58
  rack (~> 1.2)
64
59
  rack (1.5.2)
65
- rake (10.1.0)
66
- rdoc (4.0.1)
60
+ rake (10.4.2)
61
+ rdoc (4.2.0)
67
62
  json (~> 1.4)
68
- sqlite3 (1.3.8)
69
- thread_safe (0.1.3)
70
- atomic
71
- tzinfo (0.3.38)
63
+ sqlite3 (1.3.10)
64
+ thor (0.19.1)
65
+ thread_safe (0.3.4)
66
+ tzinfo (1.2.2)
67
+ thread_safe (~> 0.1)
72
68
 
73
69
  PLATFORMS
74
70
  ruby
@@ -78,5 +74,6 @@ DEPENDENCIES
78
74
  appraisal
79
75
  jeweler
80
76
  minitest
77
+ nokogiri (~> 1.5.0)
81
78
  rdoc (>= 2.4.2)
82
79
  sqlite3
data/README.rdoc CHANGED
@@ -6,9 +6,9 @@ This gem gives every ActiveRecord::Base object the possibility to do a deep clon
6
6
 
7
7
  == Requirements
8
8
 
9
- * Ruby 1.8.7, 1.9.3, 2.0.0
9
+ * Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.5 (tested)
10
10
 
11
- * Activerecord 3.1, 3.2, 4.0, 4.1
11
+ * Activerecord 3.1, 3.2, 4.0, 4.1, 4.2.0.rc3
12
12
 
13
13
  * Rails 2.x/3.0 users, please check out the 'rails2.x-3.0' branch.
14
14
 
@@ -16,7 +16,7 @@ This gem gives every ActiveRecord::Base object the possibility to do a deep clon
16
16
 
17
17
  * In your Gemfile:
18
18
 
19
- gem 'deep_cloneable', '~> 2.0.0'
19
+ gem 'deep_cloneable', '~> 2.0.2'
20
20
 
21
21
  == Upgrading from v1
22
22
 
@@ -65,6 +65,9 @@ When an object isn't found in the dictionary, it will be populated. By passing i
65
65
  kopy.cloned_from_id = original.id if kopy.respond_to?(:cloned_from_id)
66
66
  end
67
67
 
68
+ *Note*: Using deep_clone with a block will also pass the associated objects that are being cloned to the block,
69
+ so be sure to check whether the object actually responds to your method of choice.
70
+
68
71
  === Cloning without validations
69
72
  pirate.deep_clone :include => {:treasures => :gold_pieces}, :validate => false
70
73
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.2
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: deep_cloneable 2.0.0 ruby lib
5
+ # stub: deep_cloneable 2.0.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "deep_cloneable"
9
- s.version = "2.0.0"
9
+ s.version = "2.0.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Reinier de Lange"]
14
- s.date = "2014-06-26"
14
+ s.date = "2014-12-17"
15
15
  s.description = "Extends the functionality of ActiveRecord::Base#clone to perform a deep clone that includes user specified associations. "
16
16
  s.email = "r.j.delange@nedforce.nl"
17
17
  s.extra_rdoc_files = [
@@ -37,6 +37,8 @@ Gem::Specification.new do |s|
37
37
  "gemfiles/4.0.gemfile.lock",
38
38
  "gemfiles/4.1.gemfile",
39
39
  "gemfiles/4.1.gemfile.lock",
40
+ "gemfiles/4.2.gemfile",
41
+ "gemfiles/4.2.gemfile.lock",
40
42
  "init.rb",
41
43
  "lib/deep_cloneable.rb",
42
44
  "test/database.yml",
@@ -46,7 +48,7 @@ Gem::Specification.new do |s|
46
48
  "test/test_helper.rb"
47
49
  ]
48
50
  s.homepage = "http://github.com/moiristo/deep_cloneable"
49
- s.rubygems_version = "2.2.2"
51
+ s.rubygems_version = "2.4.2"
50
52
  s.summary = "This gem gives every ActiveRecord::Base object the possibility to do a deep clone."
51
53
 
52
54
  if s.respond_to? :specification_version then
data/gemfiles/3.1.gemfile CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "minitest", :group=>:test
6
- gem "appraisal", :group=>:test
7
- gem "sqlite3", :group=>:test
8
- gem "rdoc", ">= 2.4.2", :group=>:test
9
5
  gem "activerecord", "~> 3.1.0"
6
+ gem "minitest", :group => :test
7
+ gem "appraisal", :group => :test
8
+ gem "sqlite3", :group => :test
9
+ gem "rdoc", ">= 2.4.2", :group => :test
10
+ gem "nokogiri", "~> 1.5.0", :group => :test
10
11
 
12
+ group :test do
13
+ gem "jeweler"
14
+ end
@@ -12,20 +12,55 @@ GEM
12
12
  tzinfo (~> 0.3.29)
13
13
  activesupport (3.1.12)
14
14
  multi_json (~> 1.0)
15
- appraisal (0.5.2)
15
+ addressable (2.3.6)
16
+ appraisal (1.0.2)
16
17
  bundler
17
18
  rake
19
+ thor (>= 0.14.0)
18
20
  arel (2.2.3)
19
21
  builder (3.0.4)
20
- i18n (0.6.4)
21
- json (1.8.0)
22
- minitest (4.7.5)
23
- multi_json (1.7.9)
24
- rake (10.1.0)
25
- rdoc (4.0.1)
22
+ faraday (0.8.9)
23
+ multipart-post (~> 1.2.0)
24
+ git (1.2.8)
25
+ github_api (0.10.1)
26
+ addressable
27
+ faraday (~> 0.8.1)
28
+ hashie (>= 1.2)
29
+ multi_json (~> 1.4)
30
+ nokogiri (~> 1.5.2)
31
+ oauth2
32
+ hashie (3.3.2)
33
+ highline (1.6.21)
34
+ i18n (0.6.11)
35
+ jeweler (2.0.1)
36
+ builder
37
+ bundler (>= 1.0)
38
+ git (>= 1.2.5)
39
+ github_api
40
+ highline (>= 1.6.15)
41
+ nokogiri (>= 1.5.10)
42
+ rake
43
+ rdoc
44
+ json (1.8.1)
45
+ jwt (1.2.0)
46
+ minitest (5.5.0)
47
+ multi_json (1.10.1)
48
+ multi_xml (0.5.5)
49
+ multipart-post (1.2.0)
50
+ nokogiri (1.5.11)
51
+ oauth2 (1.0.0)
52
+ faraday (>= 0.8, < 0.10)
53
+ jwt (~> 1.0)
54
+ multi_json (~> 1.3)
55
+ multi_xml (~> 0.5)
56
+ rack (~> 1.2)
57
+ rack (1.5.2)
58
+ rake (10.4.2)
59
+ rdoc (4.2.0)
26
60
  json (~> 1.4)
27
- sqlite3 (1.3.7)
28
- tzinfo (0.3.37)
61
+ sqlite3 (1.3.10)
62
+ thor (0.19.1)
63
+ tzinfo (0.3.42)
29
64
 
30
65
  PLATFORMS
31
66
  ruby
@@ -33,6 +68,8 @@ PLATFORMS
33
68
  DEPENDENCIES
34
69
  activerecord (~> 3.1.0)
35
70
  appraisal
71
+ jeweler
36
72
  minitest
73
+ nokogiri (~> 1.5.0)
37
74
  rdoc (>= 2.4.2)
38
75
  sqlite3
data/gemfiles/3.2.gemfile CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "minitest", :group=>:test
6
- gem "appraisal", :group=>:test
7
- gem "sqlite3", :group=>:test
8
- gem "rdoc", ">= 2.4.2", :group=>:test
9
5
  gem "activerecord", "~> 3.2.0"
6
+ gem "minitest", :group => :test
7
+ gem "appraisal", :group => :test
8
+ gem "sqlite3", :group => :test
9
+ gem "rdoc", ">= 2.4.2", :group => :test
10
+ gem "nokogiri", "~> 1.5.0", :group => :test
10
11
 
12
+ group :test do
13
+ gem "jeweler"
14
+ end
@@ -1,31 +1,66 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (3.2.14)
5
- activesupport (= 3.2.14)
4
+ activemodel (3.2.21)
5
+ activesupport (= 3.2.21)
6
6
  builder (~> 3.0.0)
7
- activerecord (3.2.14)
8
- activemodel (= 3.2.14)
9
- activesupport (= 3.2.14)
7
+ activerecord (3.2.21)
8
+ activemodel (= 3.2.21)
9
+ activesupport (= 3.2.21)
10
10
  arel (~> 3.0.2)
11
11
  tzinfo (~> 0.3.29)
12
- activesupport (3.2.14)
12
+ activesupport (3.2.21)
13
13
  i18n (~> 0.6, >= 0.6.4)
14
14
  multi_json (~> 1.0)
15
- appraisal (0.5.2)
15
+ addressable (2.3.6)
16
+ appraisal (1.0.2)
16
17
  bundler
17
18
  rake
18
- arel (3.0.2)
19
+ thor (>= 0.14.0)
20
+ arel (3.0.3)
19
21
  builder (3.0.4)
20
- i18n (0.6.4)
21
- json (1.8.0)
22
- minitest (4.7.5)
23
- multi_json (1.7.9)
24
- rake (10.1.0)
25
- rdoc (4.0.1)
22
+ faraday (0.8.9)
23
+ multipart-post (~> 1.2.0)
24
+ git (1.2.8)
25
+ github_api (0.10.1)
26
+ addressable
27
+ faraday (~> 0.8.1)
28
+ hashie (>= 1.2)
29
+ multi_json (~> 1.4)
30
+ nokogiri (~> 1.5.2)
31
+ oauth2
32
+ hashie (3.3.2)
33
+ highline (1.6.21)
34
+ i18n (0.6.11)
35
+ jeweler (2.0.1)
36
+ builder
37
+ bundler (>= 1.0)
38
+ git (>= 1.2.5)
39
+ github_api
40
+ highline (>= 1.6.15)
41
+ nokogiri (>= 1.5.10)
42
+ rake
43
+ rdoc
44
+ json (1.8.1)
45
+ jwt (1.2.0)
46
+ minitest (5.5.0)
47
+ multi_json (1.10.1)
48
+ multi_xml (0.5.5)
49
+ multipart-post (1.2.0)
50
+ nokogiri (1.5.11)
51
+ oauth2 (1.0.0)
52
+ faraday (>= 0.8, < 0.10)
53
+ jwt (~> 1.0)
54
+ multi_json (~> 1.3)
55
+ multi_xml (~> 0.5)
56
+ rack (~> 1.2)
57
+ rack (1.5.2)
58
+ rake (10.4.2)
59
+ rdoc (4.2.0)
26
60
  json (~> 1.4)
27
- sqlite3 (1.3.7)
28
- tzinfo (0.3.37)
61
+ sqlite3 (1.3.10)
62
+ thor (0.19.1)
63
+ tzinfo (0.3.42)
29
64
 
30
65
  PLATFORMS
31
66
  ruby
@@ -33,6 +68,8 @@ PLATFORMS
33
68
  DEPENDENCIES
34
69
  activerecord (~> 3.2.0)
35
70
  appraisal
71
+ jeweler
36
72
  minitest
73
+ nokogiri (~> 1.5.0)
37
74
  rdoc (>= 2.4.2)
38
75
  sqlite3
data/gemfiles/4.0.gemfile CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "minitest", :group=>:test
6
- gem "appraisal", :group=>:test
7
- gem "sqlite3", :group=>:test
8
- gem "rdoc", ">= 2.4.2", :group=>:test
9
5
  gem "activerecord", "~> 4.0.0"
6
+ gem "minitest", :group => :test
7
+ gem "appraisal", :group => :test
8
+ gem "sqlite3", :group => :test
9
+ gem "rdoc", ">= 2.4.2", :group => :test
10
+ gem "nokogiri", "~> 1.5.0", :group => :test
10
11
 
12
+ group :test do
13
+ gem "jeweler"
14
+ end
@@ -1,38 +1,71 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (4.0.0)
5
- activesupport (= 4.0.0)
4
+ activemodel (4.0.8)
5
+ activesupport (= 4.0.8)
6
6
  builder (~> 3.1.0)
7
- activerecord (4.0.0)
8
- activemodel (= 4.0.0)
7
+ activerecord (4.0.8)
8
+ activemodel (= 4.0.8)
9
9
  activerecord-deprecated_finders (~> 1.0.2)
10
- activesupport (= 4.0.0)
10
+ activesupport (= 4.0.8)
11
11
  arel (~> 4.0.0)
12
12
  activerecord-deprecated_finders (1.0.3)
13
- activesupport (4.0.0)
14
- i18n (~> 0.6, >= 0.6.4)
13
+ activesupport (4.0.8)
14
+ i18n (~> 0.6, >= 0.6.9)
15
15
  minitest (~> 4.2)
16
16
  multi_json (~> 1.3)
17
17
  thread_safe (~> 0.1)
18
18
  tzinfo (~> 0.3.37)
19
- appraisal (0.5.2)
19
+ addressable (2.3.6)
20
+ appraisal (1.0.2)
20
21
  bundler
21
22
  rake
22
- arel (4.0.0)
23
- atomic (1.1.12)
23
+ thor (>= 0.14.0)
24
+ arel (4.0.2)
24
25
  builder (3.1.4)
25
- i18n (0.6.4)
26
- json (1.8.0)
26
+ faraday (0.8.9)
27
+ multipart-post (~> 1.2.0)
28
+ git (1.2.8)
29
+ github_api (0.10.1)
30
+ addressable
31
+ faraday (~> 0.8.1)
32
+ hashie (>= 1.2)
33
+ multi_json (~> 1.4)
34
+ nokogiri (~> 1.5.2)
35
+ oauth2
36
+ hashie (3.3.2)
37
+ highline (1.6.21)
38
+ i18n (0.6.11)
39
+ jeweler (2.0.1)
40
+ builder
41
+ bundler (>= 1.0)
42
+ git (>= 1.2.5)
43
+ github_api
44
+ highline (>= 1.6.15)
45
+ nokogiri (>= 1.5.10)
46
+ rake
47
+ rdoc
48
+ json (1.8.1)
49
+ jwt (1.2.0)
27
50
  minitest (4.7.5)
28
- multi_json (1.7.9)
29
- rake (10.1.0)
30
- rdoc (4.0.1)
51
+ multi_json (1.10.1)
52
+ multi_xml (0.5.5)
53
+ multipart-post (1.2.0)
54
+ nokogiri (1.5.11)
55
+ oauth2 (1.0.0)
56
+ faraday (>= 0.8, < 0.10)
57
+ jwt (~> 1.0)
58
+ multi_json (~> 1.3)
59
+ multi_xml (~> 0.5)
60
+ rack (~> 1.2)
61
+ rack (1.5.2)
62
+ rake (10.4.2)
63
+ rdoc (4.2.0)
31
64
  json (~> 1.4)
32
- sqlite3 (1.3.7)
33
- thread_safe (0.1.2)
34
- atomic
35
- tzinfo (0.3.37)
65
+ sqlite3 (1.3.10)
66
+ thor (0.19.1)
67
+ thread_safe (0.3.4)
68
+ tzinfo (0.3.42)
36
69
 
37
70
  PLATFORMS
38
71
  ruby
@@ -40,6 +73,8 @@ PLATFORMS
40
73
  DEPENDENCIES
41
74
  activerecord (~> 4.0.0)
42
75
  appraisal
76
+ jeweler
43
77
  minitest
78
+ nokogiri (~> 1.5.0)
44
79
  rdoc (>= 2.4.2)
45
80
  sqlite3
data/gemfiles/4.1.gemfile CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "minitest", :group=>:test
6
- gem "appraisal", :group=>:test
7
- gem "sqlite3", :group=>:test
8
- gem "rdoc", ">= 2.4.2", :group=>:test
9
5
  gem "activerecord", "~> 4.1.0"
6
+ gem "minitest", :group => :test
7
+ gem "appraisal", :group => :test
8
+ gem "sqlite3", :group => :test
9
+ gem "rdoc", ">= 2.4.2", :group => :test
10
+ gem "nokogiri", "~> 1.5.0", :group => :test
10
11
 
12
+ group :test do
13
+ gem "jeweler"
14
+ end
@@ -1,35 +1,69 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (4.1.0)
5
- activesupport (= 4.1.0)
4
+ activemodel (4.1.8)
5
+ activesupport (= 4.1.8)
6
6
  builder (~> 3.1)
7
- activerecord (4.1.0)
8
- activemodel (= 4.1.0)
9
- activesupport (= 4.1.0)
7
+ activerecord (4.1.8)
8
+ activemodel (= 4.1.8)
9
+ activesupport (= 4.1.8)
10
10
  arel (~> 5.0.0)
11
- activesupport (4.1.0)
11
+ activesupport (4.1.8)
12
12
  i18n (~> 0.6, >= 0.6.9)
13
13
  json (~> 1.7, >= 1.7.7)
14
14
  minitest (~> 5.1)
15
15
  thread_safe (~> 0.1)
16
16
  tzinfo (~> 1.1)
17
- appraisal (1.0.0)
17
+ addressable (2.3.6)
18
+ appraisal (1.0.2)
18
19
  bundler
19
20
  rake
20
21
  thor (>= 0.14.0)
21
22
  arel (5.0.1.20140414130214)
22
23
  builder (3.2.2)
23
- i18n (0.6.9)
24
+ faraday (0.8.9)
25
+ multipart-post (~> 1.2.0)
26
+ git (1.2.8)
27
+ github_api (0.10.1)
28
+ addressable
29
+ faraday (~> 0.8.1)
30
+ hashie (>= 1.2)
31
+ multi_json (~> 1.4)
32
+ nokogiri (~> 1.5.2)
33
+ oauth2
34
+ hashie (3.3.2)
35
+ highline (1.6.21)
36
+ i18n (0.6.11)
37
+ jeweler (2.0.1)
38
+ builder
39
+ bundler (>= 1.0)
40
+ git (>= 1.2.5)
41
+ github_api
42
+ highline (>= 1.6.15)
43
+ nokogiri (>= 1.5.10)
44
+ rake
45
+ rdoc
24
46
  json (1.8.1)
25
- minitest (5.3.3)
26
- rake (10.3.0)
27
- rdoc (4.1.1)
47
+ jwt (1.2.0)
48
+ minitest (5.5.0)
49
+ multi_json (1.10.1)
50
+ multi_xml (0.5.5)
51
+ multipart-post (1.2.0)
52
+ nokogiri (1.5.11)
53
+ oauth2 (1.0.0)
54
+ faraday (>= 0.8, < 0.10)
55
+ jwt (~> 1.0)
56
+ multi_json (~> 1.3)
57
+ multi_xml (~> 0.5)
58
+ rack (~> 1.2)
59
+ rack (1.5.2)
60
+ rake (10.4.2)
61
+ rdoc (4.2.0)
28
62
  json (~> 1.4)
29
- sqlite3 (1.3.9)
63
+ sqlite3 (1.3.10)
30
64
  thor (0.19.1)
31
- thread_safe (0.3.3)
32
- tzinfo (1.1.0)
65
+ thread_safe (0.3.4)
66
+ tzinfo (1.2.2)
33
67
  thread_safe (~> 0.1)
34
68
 
35
69
  PLATFORMS
@@ -38,6 +72,8 @@ PLATFORMS
38
72
  DEPENDENCIES
39
73
  activerecord (~> 4.1.0)
40
74
  appraisal
75
+ jeweler
41
76
  minitest
77
+ nokogiri (~> 1.5.0)
42
78
  rdoc (>= 2.4.2)
43
79
  sqlite3
@@ -0,0 +1,14 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.2.0.rc3"
6
+ gem "minitest", :group => :test
7
+ gem "appraisal", :group => :test
8
+ gem "sqlite3", :group => :test
9
+ gem "rdoc", ">= 2.4.2", :group => :test
10
+ gem "nokogiri", "~> 1.5.0", :group => :test
11
+
12
+ group :test do
13
+ gem "jeweler"
14
+ end
@@ -0,0 +1,79 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (4.2.0.rc3)
5
+ activesupport (= 4.2.0.rc3)
6
+ builder (~> 3.1)
7
+ activerecord (4.2.0.rc3)
8
+ activemodel (= 4.2.0.rc3)
9
+ activesupport (= 4.2.0.rc3)
10
+ arel (~> 6.0)
11
+ activesupport (4.2.0.rc3)
12
+ i18n (>= 0.7.0.beta1, < 0.8)
13
+ json (~> 1.7, >= 1.7.7)
14
+ minitest (~> 5.1)
15
+ thread_safe (~> 0.1)
16
+ tzinfo (~> 1.1)
17
+ addressable (2.3.6)
18
+ appraisal (1.0.2)
19
+ bundler
20
+ rake
21
+ thor (>= 0.14.0)
22
+ arel (6.0.0)
23
+ builder (3.2.2)
24
+ faraday (0.8.9)
25
+ multipart-post (~> 1.2.0)
26
+ git (1.2.8)
27
+ github_api (0.10.1)
28
+ addressable
29
+ faraday (~> 0.8.1)
30
+ hashie (>= 1.2)
31
+ multi_json (~> 1.4)
32
+ nokogiri (~> 1.5.2)
33
+ oauth2
34
+ hashie (3.3.2)
35
+ highline (1.6.21)
36
+ i18n (0.7.0.beta1)
37
+ jeweler (2.0.1)
38
+ builder
39
+ bundler (>= 1.0)
40
+ git (>= 1.2.5)
41
+ github_api
42
+ highline (>= 1.6.15)
43
+ nokogiri (>= 1.5.10)
44
+ rake
45
+ rdoc
46
+ json (1.8.1)
47
+ jwt (1.2.0)
48
+ minitest (5.5.0)
49
+ multi_json (1.10.1)
50
+ multi_xml (0.5.5)
51
+ multipart-post (1.2.0)
52
+ nokogiri (1.5.11)
53
+ oauth2 (1.0.0)
54
+ faraday (>= 0.8, < 0.10)
55
+ jwt (~> 1.0)
56
+ multi_json (~> 1.3)
57
+ multi_xml (~> 0.5)
58
+ rack (~> 1.2)
59
+ rack (1.5.2)
60
+ rake (10.4.2)
61
+ rdoc (4.2.0)
62
+ json (~> 1.4)
63
+ sqlite3 (1.3.10)
64
+ thor (0.19.1)
65
+ thread_safe (0.3.4)
66
+ tzinfo (1.2.2)
67
+ thread_safe (~> 0.1)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ activerecord (~> 4.2.0.rc3)
74
+ appraisal
75
+ jeweler
76
+ minitest
77
+ nokogiri (~> 1.5.0)
78
+ rdoc (>= 2.4.2)
79
+ sqlite3
@@ -63,8 +63,11 @@ class ActiveRecord::Base
63
63
  end
64
64
  end
65
65
 
66
+ association_type = association_reflection.macro
67
+ association_type = "#{association_type}_through" if association_reflection.is_a?(ActiveRecord::Reflection::ThroughReflection)
68
+
66
69
  cloned_object = send(
67
- "dup_#{association_reflection.macro}_#{association_reflection.class.name.demodulize.underscore.gsub('_reflection', '')}",
70
+ "dup_#{association_type}_association",
68
71
  { :reflection => association_reflection, :association => association, :copy => kopy, :dup_options => dup_options },
69
72
  &block
70
73
  )
@@ -101,7 +104,7 @@ class ActiveRecord::Base
101
104
  end
102
105
  end
103
106
 
104
- def dup_has_many_through options, &block
107
+ def dup_has_many_through_association options, &block
105
108
  dup_join_association(
106
109
  options.merge(:macro => :has_many, :primary_key_name => options[:reflection].through_reflection.foreign_key.to_s),
107
110
  &block)
@@ -295,7 +295,7 @@ class TestDeepCloneable < MiniTest::Unit::TestCase
295
295
  assert_equal deep_clone_parent.errors.messages, :children => ["is invalid"]
296
296
  end
297
297
 
298
- def test_child_validations_run_on_save_after_clone
298
+ def test_child_validations_run_on_save_after_clone_without_validation
299
299
  child = ChildWithValidation.new
300
300
  child.save :validate => false
301
301
  parent = ParentWithValidation.create :name => 'John', :children => [child]
data/test/test_helper.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'yaml'
3
3
  require 'minitest/autorun'
4
- #require 'pp'
5
- #require 'debugger'
6
4
 
7
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
8
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_cloneable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reinier de Lange
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -57,6 +57,8 @@ files:
57
57
  - gemfiles/4.0.gemfile.lock
58
58
  - gemfiles/4.1.gemfile
59
59
  - gemfiles/4.1.gemfile.lock
60
+ - gemfiles/4.2.gemfile
61
+ - gemfiles/4.2.gemfile.lock
60
62
  - init.rb
61
63
  - lib/deep_cloneable.rb
62
64
  - test/database.yml
@@ -83,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
85
  version: '0'
84
86
  requirements: []
85
87
  rubyforge_project:
86
- rubygems_version: 2.2.2
88
+ rubygems_version: 2.4.2
87
89
  signing_key:
88
90
  specification_version: 4
89
91
  summary: This gem gives every ActiveRecord::Base object the possibility to do a deep