active_type 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -1
  4. data/README.md +4 -4
  5. data/gemfiles/Gemfile.3.2.mysql2 +1 -1
  6. data/gemfiles/Gemfile.3.2.mysql2.lock +16 -11
  7. data/gemfiles/Gemfile.3.2.sqlite3 +1 -1
  8. data/gemfiles/Gemfile.3.2.sqlite3.lock +16 -11
  9. data/gemfiles/Gemfile.4.0.sqlite3 +1 -1
  10. data/gemfiles/Gemfile.4.0.sqlite3.lock +16 -11
  11. data/gemfiles/Gemfile.4.1.sqlite3 +1 -1
  12. data/gemfiles/Gemfile.4.1.sqlite3.lock +16 -11
  13. data/gemfiles/Gemfile.4.2.1.mysql2 +1 -1
  14. data/gemfiles/Gemfile.4.2.1.mysql2.lock +16 -11
  15. data/gemfiles/Gemfile.4.2.1.pg +1 -1
  16. data/gemfiles/Gemfile.4.2.1.pg.lock +16 -11
  17. data/gemfiles/Gemfile.4.2.1.sqlite3 +1 -1
  18. data/gemfiles/Gemfile.4.2.1.sqlite3.lock +16 -11
  19. data/lib/active_type/version.rb +1 -1
  20. data/lib/active_type/virtual_attributes.rb +1 -1
  21. data/spec/active_type/extended_record/single_table_inheritance_spec.rb +6 -6
  22. data/spec/active_type/extended_record_spec.rb +32 -26
  23. data/spec/active_type/nested_attributes_spec.rb +51 -51
  24. data/spec/active_type/object_spec.rb +44 -33
  25. data/spec/active_type/record_spec.rb +15 -11
  26. data/spec/active_type/util_spec.rb +25 -25
  27. data/spec/integration/holidays_spec.rb +13 -13
  28. data/spec/integration/shape_spec.rb +12 -14
  29. data/spec/integration/sign_in_spec.rb +12 -12
  30. data/spec/integration/sign_up_spec.rb +9 -9
  31. data/spec/shared_examples/accessors.rb +3 -3
  32. data/spec/shared_examples/belongs_to.rb +2 -2
  33. data/spec/shared_examples/coercible_columns.rb +27 -27
  34. data/spec/shared_examples/constructor.rb +2 -2
  35. data/spec/shared_examples/defaults.rb +10 -10
  36. data/spec/shared_examples/dirty_tracking.rb +4 -4
  37. data/spec/shared_examples/dupable.rb +4 -4
  38. data/spec/shared_examples/mass_assignment.rb +1 -1
  39. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c606ca3a39a6de576a55fedfd5c421e279bca952
4
- data.tar.gz: a29bd51fb2cc519da17b32729ef2ba5f11b15387
3
+ metadata.gz: facbcaa21321fefe498b9dfd06e01373a76bc0c4
4
+ data.tar.gz: 1d49f4942cea269483f1e9f4c1054ef517267a8f
5
5
  SHA512:
6
- metadata.gz: 71674d907ca1f9e9b6ce9ddd960f55a7776fdee1cc2377285dc3218de61d881ffb501e2e3a4ef11d6eb22ec2ec01c6a1957baa2c862d5f06433916c5f721d771
7
- data.tar.gz: a010dbbb16b4c1ece311d31f8ddb1aaded8f4ec07254bd809d4b42be5246d2dca7a5496800be15b5aa112944256971a5eedf48d6485faff398bb996a2fe11536
6
+ metadata.gz: 37658e011161ce41985c72c649f62f6686f6465a7ead8e7546accfe7a38bc82fdde513701d3b2c7d3eb59ba63774d4597bad2f87b6c2b9e0b1bcd50606ac3c2e
7
+ data.tar.gz: 99064aa007b6b5b3f16063f884bee388e63ae2fdbed7b3b4afeae9aa5080ef01702edb2b63318ca402a195d3ea00d931d60a99abae56dc05c494167fab4b1643
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.2.4
data/.travis.yml CHANGED
@@ -4,7 +4,7 @@ rvm:
4
4
  - "1.9.3"
5
5
  - "2.0.0"
6
6
  - "2.1.7"
7
- - "2.2.3"
7
+ - "2.2.4"
8
8
  gemfile:
9
9
  - gemfiles/Gemfile.3.2.mysql2
10
10
  - gemfiles/Gemfile.3.2.sqlite3
data/README.md CHANGED
@@ -207,10 +207,10 @@ end
207
207
  - or as an array
208
208
 
209
209
  ```ruby
210
- {
211
- [ date: "new record's date" ],
212
- [ id: '3', date: "existing record's date" ]
213
- }
210
+ [
211
+ { date: "new record's date" },
212
+ { id: '3', date: "existing record's date" }
213
+ ]
214
214
  ```
215
215
 
216
216
  To use it with single records, use `nests_one`. It works like `accept_nested_attributes` does for `has_one`. Use `.record_attributes =` to build the child record.
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '=3.2.22'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~> 3.4'
5
5
  gem 'mysql2', '= 0.3.17'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -24,14 +24,19 @@ GEM
24
24
  i18n (0.6.11)
25
25
  multi_json (1.11.2)
26
26
  mysql2 (0.3.17)
27
- rspec (2.14.1)
28
- rspec-core (~> 2.14.0)
29
- rspec-expectations (~> 2.14.0)
30
- rspec-mocks (~> 2.14.0)
31
- rspec-core (2.14.8)
32
- rspec-expectations (2.14.5)
33
- diff-lcs (>= 1.1.3, < 2.0)
34
- rspec-mocks (2.14.6)
27
+ rspec (3.4.0)
28
+ rspec-core (~> 3.4.0)
29
+ rspec-expectations (~> 3.4.0)
30
+ rspec-mocks (~> 3.4.0)
31
+ rspec-core (3.4.1)
32
+ rspec-support (~> 3.4.0)
33
+ rspec-expectations (3.4.0)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.4.0)
36
+ rspec-mocks (3.4.1)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.4.0)
39
+ rspec-support (3.4.1)
35
40
  tzinfo (0.3.46)
36
41
 
37
42
  PLATFORMS
@@ -42,7 +47,7 @@ DEPENDENCIES
42
47
  activerecord (= 3.2.22)
43
48
  i18n (= 0.6.11)
44
49
  mysql2 (= 0.3.17)
45
- rspec (< 2.99)
50
+ rspec (~> 3.4)
46
51
 
47
52
  BUNDLED WITH
48
- 1.10.6
53
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '=3.2.22'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~>3.4'
5
5
  gem 'sqlite3'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -23,14 +23,19 @@ GEM
23
23
  diff-lcs (1.2.5)
24
24
  i18n (0.6.11)
25
25
  multi_json (1.11.2)
26
- rspec (2.14.1)
27
- rspec-core (~> 2.14.0)
28
- rspec-expectations (~> 2.14.0)
29
- rspec-mocks (~> 2.14.0)
30
- rspec-core (2.14.8)
31
- rspec-expectations (2.14.5)
32
- diff-lcs (>= 1.1.3, < 2.0)
33
- rspec-mocks (2.14.6)
26
+ rspec (3.4.0)
27
+ rspec-core (~> 3.4.0)
28
+ rspec-expectations (~> 3.4.0)
29
+ rspec-mocks (~> 3.4.0)
30
+ rspec-core (3.4.1)
31
+ rspec-support (~> 3.4.0)
32
+ rspec-expectations (3.4.0)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.4.0)
35
+ rspec-mocks (3.4.1)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.4.0)
38
+ rspec-support (3.4.1)
34
39
  sqlite3 (1.3.11)
35
40
  tzinfo (0.3.46)
36
41
 
@@ -41,8 +46,8 @@ DEPENDENCIES
41
46
  active_type!
42
47
  activerecord (= 3.2.22)
43
48
  i18n (= 0.6.11)
44
- rspec (< 2.99)
49
+ rspec (~> 3.4)
45
50
  sqlite3
46
51
 
47
52
  BUNDLED WITH
48
- 1.10.6
53
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~>4.0.0'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~>3.4'
5
5
  gem 'sqlite3'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -28,14 +28,19 @@ GEM
28
28
  i18n (0.7.0)
29
29
  minitest (4.7.5)
30
30
  multi_json (1.11.2)
31
- rspec (2.14.1)
32
- rspec-core (~> 2.14.0)
33
- rspec-expectations (~> 2.14.0)
34
- rspec-mocks (~> 2.14.0)
35
- rspec-core (2.14.8)
36
- rspec-expectations (2.14.5)
37
- diff-lcs (>= 1.1.3, < 2.0)
38
- rspec-mocks (2.14.6)
31
+ rspec (3.4.0)
32
+ rspec-core (~> 3.4.0)
33
+ rspec-expectations (~> 3.4.0)
34
+ rspec-mocks (~> 3.4.0)
35
+ rspec-core (3.4.1)
36
+ rspec-support (~> 3.4.0)
37
+ rspec-expectations (3.4.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.4.0)
40
+ rspec-mocks (3.4.1)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.4.0)
43
+ rspec-support (3.4.1)
39
44
  sqlite3 (1.3.11)
40
45
  thread_safe (0.3.5)
41
46
  tzinfo (0.3.46)
@@ -46,8 +51,8 @@ PLATFORMS
46
51
  DEPENDENCIES
47
52
  active_type!
48
53
  activerecord (~> 4.0.0)
49
- rspec (< 2.99)
54
+ rspec (~> 3.4)
50
55
  sqlite3
51
56
 
52
57
  BUNDLED WITH
53
- 1.10.6
58
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~>4.1.0'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~>3.4'
5
5
  gem 'sqlite3'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -26,14 +26,19 @@ GEM
26
26
  i18n (0.7.0)
27
27
  json (1.8.3)
28
28
  minitest (5.8.3)
29
- rspec (2.14.1)
30
- rspec-core (~> 2.14.0)
31
- rspec-expectations (~> 2.14.0)
32
- rspec-mocks (~> 2.14.0)
33
- rspec-core (2.14.8)
34
- rspec-expectations (2.14.5)
35
- diff-lcs (>= 1.1.3, < 2.0)
36
- rspec-mocks (2.14.6)
29
+ rspec (3.4.0)
30
+ rspec-core (~> 3.4.0)
31
+ rspec-expectations (~> 3.4.0)
32
+ rspec-mocks (~> 3.4.0)
33
+ rspec-core (3.4.1)
34
+ rspec-support (~> 3.4.0)
35
+ rspec-expectations (3.4.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.4.0)
38
+ rspec-mocks (3.4.1)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.4.0)
41
+ rspec-support (3.4.1)
37
42
  sqlite3 (1.3.11)
38
43
  thread_safe (0.3.5)
39
44
  tzinfo (1.2.2)
@@ -45,8 +50,8 @@ PLATFORMS
45
50
  DEPENDENCIES
46
51
  active_type!
47
52
  activerecord (~> 4.1.0)
48
- rspec (< 2.99)
53
+ rspec (~> 3.4)
49
54
  sqlite3
50
55
 
51
56
  BUNDLED WITH
52
- 1.10.6
57
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~>4.2.1'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~>3.4'
5
5
  gem 'mysql2', '~> 0.3.17'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -27,14 +27,19 @@ GEM
27
27
  json (1.8.3)
28
28
  minitest (5.8.3)
29
29
  mysql2 (0.3.20)
30
- rspec (2.14.1)
31
- rspec-core (~> 2.14.0)
32
- rspec-expectations (~> 2.14.0)
33
- rspec-mocks (~> 2.14.0)
34
- rspec-core (2.14.8)
35
- rspec-expectations (2.14.5)
36
- diff-lcs (>= 1.1.3, < 2.0)
37
- rspec-mocks (2.14.6)
30
+ rspec (3.4.0)
31
+ rspec-core (~> 3.4.0)
32
+ rspec-expectations (~> 3.4.0)
33
+ rspec-mocks (~> 3.4.0)
34
+ rspec-core (3.4.1)
35
+ rspec-support (~> 3.4.0)
36
+ rspec-expectations (3.4.0)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.4.0)
39
+ rspec-mocks (3.4.1)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.4.0)
42
+ rspec-support (3.4.1)
38
43
  thread_safe (0.3.5)
39
44
  tzinfo (1.2.2)
40
45
  thread_safe (~> 0.1)
@@ -46,7 +51,7 @@ DEPENDENCIES
46
51
  active_type!
47
52
  activerecord (~> 4.2.1)
48
53
  mysql2 (~> 0.3.17)
49
- rspec (< 2.99)
54
+ rspec (~> 3.4)
50
55
 
51
56
  BUNDLED WITH
52
- 1.10.6
57
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~>4.2.1'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~>3.4'
5
5
  gem 'pg'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -27,14 +27,19 @@ GEM
27
27
  json (1.8.3)
28
28
  minitest (5.8.3)
29
29
  pg (0.18.4)
30
- rspec (2.14.1)
31
- rspec-core (~> 2.14.0)
32
- rspec-expectations (~> 2.14.0)
33
- rspec-mocks (~> 2.14.0)
34
- rspec-core (2.14.8)
35
- rspec-expectations (2.14.5)
36
- diff-lcs (>= 1.1.3, < 2.0)
37
- rspec-mocks (2.14.6)
30
+ rspec (3.4.0)
31
+ rspec-core (~> 3.4.0)
32
+ rspec-expectations (~> 3.4.0)
33
+ rspec-mocks (~> 3.4.0)
34
+ rspec-core (3.4.1)
35
+ rspec-support (~> 3.4.0)
36
+ rspec-expectations (3.4.0)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.4.0)
39
+ rspec-mocks (3.4.1)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.4.0)
42
+ rspec-support (3.4.1)
38
43
  thread_safe (0.3.5)
39
44
  tzinfo (1.2.2)
40
45
  thread_safe (~> 0.1)
@@ -46,7 +51,7 @@ DEPENDENCIES
46
51
  active_type!
47
52
  activerecord (~> 4.2.1)
48
53
  pg
49
- rspec (< 2.99)
54
+ rspec (~> 3.4)
50
55
 
51
56
  BUNDLED WITH
52
- 1.10.6
57
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~>4.2.1'
4
- gem 'rspec', '<2.99'
4
+ gem 'rspec', '~> 3.4'
5
5
  gem 'sqlite3'
6
6
 
7
7
  gem 'active_type', :path => '..'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.4.4)
4
+ active_type (0.4.5)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -26,14 +26,19 @@ GEM
26
26
  i18n (0.7.0)
27
27
  json (1.8.3)
28
28
  minitest (5.8.3)
29
- rspec (2.14.1)
30
- rspec-core (~> 2.14.0)
31
- rspec-expectations (~> 2.14.0)
32
- rspec-mocks (~> 2.14.0)
33
- rspec-core (2.14.8)
34
- rspec-expectations (2.14.5)
35
- diff-lcs (>= 1.1.3, < 2.0)
36
- rspec-mocks (2.14.6)
29
+ rspec (3.4.0)
30
+ rspec-core (~> 3.4.0)
31
+ rspec-expectations (~> 3.4.0)
32
+ rspec-mocks (~> 3.4.0)
33
+ rspec-core (3.4.1)
34
+ rspec-support (~> 3.4.0)
35
+ rspec-expectations (3.4.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.4.0)
38
+ rspec-mocks (3.4.1)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.4.0)
41
+ rspec-support (3.4.1)
37
42
  sqlite3 (1.3.11)
38
43
  thread_safe (0.3.5)
39
44
  tzinfo (1.2.2)
@@ -45,8 +50,8 @@ PLATFORMS
45
50
  DEPENDENCIES
46
51
  active_type!
47
52
  activerecord (~> 4.2.1)
48
- rspec (< 2.99)
53
+ rspec (~> 3.4)
49
54
  sqlite3
50
55
 
51
56
  BUNDLED WITH
52
- 1.10.6
57
+ 1.11.2
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.5'
3
3
  end
@@ -118,7 +118,7 @@ module ActiveType
118
118
 
119
119
  def initialize_dup(other)
120
120
  @virtual_attributes_cache = {}
121
- @virtual_attributes = VirtualAttributes.deep_dup(@virtual_attributes)
121
+ @virtual_attributes = VirtualAttributes.deep_dup(virtual_attributes)
122
122
 
123
123
  super
124
124
  end
@@ -24,11 +24,11 @@ describe 'ActiveType::Record[STIModel]' do
24
24
 
25
25
  def should_save_and_load(save_as, load_as)
26
26
  record = save_as.new(:persisted_string => "string")
27
- record.save.should be_true
27
+ expect(record.save).to eq(true)
28
28
 
29
29
  reloaded_child = load_as.find(record.id)
30
- reloaded_child.persisted_string.should == "string"
31
- reloaded_child.should be_a(load_as)
30
+ expect(reloaded_child.persisted_string).to eq("string")
31
+ expect(reloaded_child).to be_a(load_as)
32
32
  end
33
33
 
34
34
  it 'can save and load the active type record' do
@@ -46,11 +46,11 @@ describe 'ActiveType::Record[STIModel]' do
46
46
 
47
47
  it 'can load via the base class and convert to active type record' do
48
48
  record = STISpec::ExtendedChild.new(:persisted_string => "string")
49
- record.save.should be_true
49
+ expect(record.save).to eq(true)
50
50
 
51
51
  reloaded_child = STISpec::Child.find(record.id).becomes(STISpec::ExtendedChild)
52
- reloaded_child.persisted_string.should == "string"
53
- reloaded_child.should be_a(STISpec::ExtendedChild)
52
+ expect(reloaded_child.persisted_string).to eq("string")
53
+ expect(reloaded_child).to be_a(STISpec::ExtendedChild)
54
54
  end
55
55
 
56
56
  it 'can save classes further down the inheritance tree' do