active_type 0.6.2 → 0.6.3
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Rakefile +22 -1
- data/gemfiles/Gemfile.3.2.mysql2 +1 -0
- data/gemfiles/Gemfile.3.2.mysql2.lock +2 -0
- data/gemfiles/Gemfile.3.2.sqlite3 +1 -0
- data/gemfiles/Gemfile.3.2.sqlite3.lock +2 -0
- data/gemfiles/Gemfile.4.0.sqlite3 +1 -0
- data/gemfiles/Gemfile.4.0.sqlite3.lock +2 -0
- data/gemfiles/Gemfile.4.1.sqlite3 +1 -0
- data/gemfiles/Gemfile.4.1.sqlite3.lock +2 -0
- data/gemfiles/Gemfile.4.2.1.mysql2 +1 -0
- data/gemfiles/Gemfile.4.2.1.mysql2.lock +2 -0
- data/gemfiles/Gemfile.4.2.1.pg +1 -0
- data/gemfiles/Gemfile.4.2.1.pg.lock +2 -0
- data/gemfiles/Gemfile.4.2.1.sqlite3 +1 -0
- data/gemfiles/Gemfile.4.2.1.sqlite3.lock +2 -0
- data/gemfiles/Gemfile.5.0.0.mysql2 +1 -0
- data/gemfiles/Gemfile.5.0.0.mysql2.lock +2 -0
- data/gemfiles/Gemfile.5.0.0.pg +1 -0
- data/gemfiles/Gemfile.5.0.0.pg.lock +2 -0
- data/gemfiles/Gemfile.5.0.0.sqlite3 +1 -0
- data/gemfiles/Gemfile.5.0.0.sqlite3.lock +2 -0
- data/lib/active_type.rb +11 -22
- data/lib/active_type/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae001f6573873833446638cad632eb52ca6c54e2
|
4
|
+
data.tar.gz: fd9903ddb3435cef627cba36dfd68a95a13a09a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a4bc20542bdddd93b52dc0c5e80177425450c32582b429bcd837ea916e2eea52d0e22f1602d5fc757d63a3cb6c1486a17030644e5d41c2737c7f235f12a547f
|
7
|
+
data.tar.gz: 3aaf32f0db3df343720e31e6adc4c3f94bb76e804956292f60a54594abc179e3ff929b9214da6b74b473ea9baae35a881a98f9df18af72af786319d28c88d6d9
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -19,7 +19,7 @@ gemfile:
|
|
19
19
|
before_script:
|
20
20
|
- psql -c 'create database active_type_test;' -U postgres
|
21
21
|
- mysql -e 'create database IF NOT EXISTS active_type_test;'
|
22
|
-
script: bundle exec
|
22
|
+
script: bundle exec rake spec
|
23
23
|
sudo: false
|
24
24
|
cache: bundler
|
25
25
|
notifications:
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
ActiveType is in a pre-1.0 state. This means that its APIs and behavior are subject to breaking changes without deprecation notices. Until 1.0, version numbers will follow a [Semver][]-ish `0.y.z` format, where `y` is incremented when new features or breaking changes are introduced, and `z` is incremented for lesser changes or bug fixes.
|
6
6
|
|
7
|
+
## [0.6.3][] (2017-01-30)
|
8
|
+
|
9
|
+
* Fix a load error when using `ActiveType::Object` before using `ActiveRecord::Base` within a Rails app.
|
10
|
+
|
7
11
|
## [0.6.2][] (2017-01-30)
|
8
12
|
|
9
13
|
* When used with Rails, defer loading to not interfere with `ActiveRecord` configuration in initializers.
|
data/Rakefile
CHANGED
@@ -4,13 +4,20 @@ require 'bundler/gem_tasks'
|
|
4
4
|
desc 'Default: Run all specs.'
|
5
5
|
task :default => 'all:spec'
|
6
6
|
|
7
|
+
|
8
|
+
desc "Run specs and isolated specs"
|
9
|
+
task :spec do
|
10
|
+
success = run_specs
|
11
|
+
fail "Tests failed" unless success
|
12
|
+
end
|
13
|
+
|
7
14
|
namespace :all do
|
8
15
|
|
9
16
|
desc "Run specs on all versions"
|
10
17
|
task :spec do
|
11
18
|
success = true
|
12
19
|
for_each_gemfile do
|
13
|
-
success &=
|
20
|
+
success &= run_specs
|
14
21
|
end
|
15
22
|
fail "Tests failed" unless success
|
16
23
|
end
|
@@ -40,3 +47,17 @@ def for_each_gemfile
|
|
40
47
|
yield
|
41
48
|
end
|
42
49
|
end
|
50
|
+
|
51
|
+
def for_each_isolated_spec
|
52
|
+
Dir["spec/isolated/**/*_spec.rb"].sort.each do |isolated_spec|
|
53
|
+
yield(isolated_spec)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def run_specs
|
58
|
+
success = system("bundle exec rspec spec --exclude-pattern '**/isolated/**'")
|
59
|
+
for_each_isolated_spec do |isolated_spec|
|
60
|
+
success &= system("bundle exec rspec #{isolated_spec}")
|
61
|
+
end
|
62
|
+
success
|
63
|
+
end
|
data/gemfiles/Gemfile.3.2.mysql2
CHANGED
@@ -24,6 +24,7 @@ GEM
|
|
24
24
|
i18n (0.6.11)
|
25
25
|
multi_json (1.11.2)
|
26
26
|
mysql2 (0.3.17)
|
27
|
+
rake (10.4.2)
|
27
28
|
rspec (3.4.0)
|
28
29
|
rspec-core (~> 3.4.0)
|
29
30
|
rspec-expectations (~> 3.4.0)
|
@@ -47,6 +48,7 @@ DEPENDENCIES
|
|
47
48
|
activerecord (= 3.2.22)
|
48
49
|
i18n (= 0.6.11)
|
49
50
|
mysql2 (= 0.3.17)
|
51
|
+
rake
|
50
52
|
rspec (~> 3.4)
|
51
53
|
|
52
54
|
BUNDLED WITH
|
@@ -23,6 +23,7 @@ GEM
|
|
23
23
|
diff-lcs (1.2.5)
|
24
24
|
i18n (0.6.11)
|
25
25
|
multi_json (1.11.2)
|
26
|
+
rake (10.4.2)
|
26
27
|
rspec (3.4.0)
|
27
28
|
rspec-core (~> 3.4.0)
|
28
29
|
rspec-expectations (~> 3.4.0)
|
@@ -46,6 +47,7 @@ DEPENDENCIES
|
|
46
47
|
active_type!
|
47
48
|
activerecord (= 3.2.22)
|
48
49
|
i18n (= 0.6.11)
|
50
|
+
rake
|
49
51
|
rspec (~> 3.4)
|
50
52
|
sqlite3
|
51
53
|
|
@@ -28,6 +28,7 @@ GEM
|
|
28
28
|
i18n (0.7.0)
|
29
29
|
minitest (4.7.5)
|
30
30
|
multi_json (1.11.2)
|
31
|
+
rake (10.4.2)
|
31
32
|
rspec (3.4.0)
|
32
33
|
rspec-core (~> 3.4.0)
|
33
34
|
rspec-expectations (~> 3.4.0)
|
@@ -51,6 +52,7 @@ PLATFORMS
|
|
51
52
|
DEPENDENCIES
|
52
53
|
active_type!
|
53
54
|
activerecord (~> 4.0.0)
|
55
|
+
rake
|
54
56
|
rspec (~> 3.4)
|
55
57
|
sqlite3
|
56
58
|
|
@@ -26,6 +26,7 @@ GEM
|
|
26
26
|
i18n (0.7.0)
|
27
27
|
json (1.8.3)
|
28
28
|
minitest (5.8.3)
|
29
|
+
rake (10.4.2)
|
29
30
|
rspec (3.4.0)
|
30
31
|
rspec-core (~> 3.4.0)
|
31
32
|
rspec-expectations (~> 3.4.0)
|
@@ -50,6 +51,7 @@ PLATFORMS
|
|
50
51
|
DEPENDENCIES
|
51
52
|
active_type!
|
52
53
|
activerecord (~> 4.1.0)
|
54
|
+
rake
|
53
55
|
rspec (~> 3.4)
|
54
56
|
sqlite3
|
55
57
|
|
@@ -27,6 +27,7 @@ GEM
|
|
27
27
|
json (1.8.3)
|
28
28
|
minitest (5.8.3)
|
29
29
|
mysql2 (0.3.20)
|
30
|
+
rake (10.4.2)
|
30
31
|
rspec (3.4.0)
|
31
32
|
rspec-core (~> 3.4.0)
|
32
33
|
rspec-expectations (~> 3.4.0)
|
@@ -51,6 +52,7 @@ DEPENDENCIES
|
|
51
52
|
active_type!
|
52
53
|
activerecord (~> 4.2.1)
|
53
54
|
mysql2 (~> 0.3.17)
|
55
|
+
rake
|
54
56
|
rspec (~> 3.4)
|
55
57
|
|
56
58
|
BUNDLED WITH
|
data/gemfiles/Gemfile.4.2.1.pg
CHANGED
@@ -27,6 +27,7 @@ GEM
|
|
27
27
|
json (1.8.3)
|
28
28
|
minitest (5.8.3)
|
29
29
|
pg (0.18.4)
|
30
|
+
rake (10.4.2)
|
30
31
|
rspec (3.4.0)
|
31
32
|
rspec-core (~> 3.4.0)
|
32
33
|
rspec-expectations (~> 3.4.0)
|
@@ -51,6 +52,7 @@ DEPENDENCIES
|
|
51
52
|
active_type!
|
52
53
|
activerecord (~> 4.2.1)
|
53
54
|
pg
|
55
|
+
rake
|
54
56
|
rspec (~> 3.4)
|
55
57
|
|
56
58
|
BUNDLED WITH
|
@@ -26,6 +26,7 @@ GEM
|
|
26
26
|
i18n (0.7.0)
|
27
27
|
json (1.8.3)
|
28
28
|
minitest (5.8.3)
|
29
|
+
rake (10.4.2)
|
29
30
|
rspec (3.4.0)
|
30
31
|
rspec-core (~> 3.4.0)
|
31
32
|
rspec-expectations (~> 3.4.0)
|
@@ -50,6 +51,7 @@ PLATFORMS
|
|
50
51
|
DEPENDENCIES
|
51
52
|
active_type!
|
52
53
|
activerecord (~> 4.2.1)
|
54
|
+
rake
|
53
55
|
rspec (~> 3.4)
|
54
56
|
sqlite3
|
55
57
|
|
@@ -24,6 +24,7 @@ GEM
|
|
24
24
|
i18n (0.7.0)
|
25
25
|
minitest (5.9.0)
|
26
26
|
mysql2 (0.3.21)
|
27
|
+
rake (10.4.2)
|
27
28
|
rspec (3.5.0)
|
28
29
|
rspec-core (~> 3.5.0)
|
29
30
|
rspec-expectations (~> 3.5.0)
|
@@ -48,6 +49,7 @@ DEPENDENCIES
|
|
48
49
|
active_type!
|
49
50
|
activerecord (~> 5.0.0)
|
50
51
|
mysql2 (~> 0.3.17)
|
52
|
+
rake
|
51
53
|
rspec (~> 3.4)
|
52
54
|
|
53
55
|
BUNDLED WITH
|
data/gemfiles/Gemfile.5.0.0.pg
CHANGED
@@ -24,6 +24,7 @@ GEM
|
|
24
24
|
i18n (0.7.0)
|
25
25
|
minitest (5.9.0)
|
26
26
|
pg (0.18.4)
|
27
|
+
rake (10.4.2)
|
27
28
|
rspec (3.5.0)
|
28
29
|
rspec-core (~> 3.5.0)
|
29
30
|
rspec-expectations (~> 3.5.0)
|
@@ -48,6 +49,7 @@ DEPENDENCIES
|
|
48
49
|
active_type!
|
49
50
|
activerecord (~> 5.0.0)
|
50
51
|
pg
|
52
|
+
rake
|
51
53
|
rspec (~> 3.4)
|
52
54
|
|
53
55
|
BUNDLED WITH
|
@@ -23,6 +23,7 @@ GEM
|
|
23
23
|
diff-lcs (1.2.5)
|
24
24
|
i18n (0.7.0)
|
25
25
|
minitest (5.9.0)
|
26
|
+
rake (10.4.2)
|
26
27
|
rspec (3.5.0)
|
27
28
|
rspec-core (~> 3.5.0)
|
28
29
|
rspec-expectations (~> 3.5.0)
|
@@ -47,6 +48,7 @@ PLATFORMS
|
|
47
48
|
DEPENDENCIES
|
48
49
|
active_type!
|
49
50
|
activerecord (~> 5.0.0)
|
51
|
+
rake
|
50
52
|
rspec (~> 3.4)
|
51
53
|
sqlite3
|
52
54
|
|
data/lib/active_type.rb
CHANGED
@@ -2,30 +2,19 @@
|
|
2
2
|
|
3
3
|
require 'active_type/version'
|
4
4
|
|
5
|
+
require 'active_record'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
if ActiveRecord::VERSION::STRING == '4.2.0'
|
12
|
-
raise(<<-MESSAGE.strip_heredoc)
|
13
|
-
ActiveType is not compatible with ActiveRecord 4.2.0. Please upgrade to 4.2.1
|
14
|
-
For details see https://github.com/makandra/active_type/issues/31
|
15
|
-
MESSAGE
|
16
|
-
end
|
7
|
+
if ActiveRecord::VERSION::STRING == '4.2.0'
|
8
|
+
raise(<<-MESSAGE.strip_heredoc)
|
9
|
+
ActiveType is not compatible with ActiveRecord 4.2.0. Please upgrade to 4.2.1
|
10
|
+
For details see https://github.com/makandra/active_type/issues/31
|
11
|
+
MESSAGE
|
17
12
|
end
|
18
13
|
|
14
|
+
module ActiveType
|
15
|
+
extend ActiveSupport::Autoload
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
# (compare https://github.com/rails/rails/issues/23589)
|
24
|
-
ActiveSupport.on_load(:active_record) do
|
25
|
-
load_now.call()
|
26
|
-
end
|
27
|
-
else
|
28
|
-
# No Rails.
|
29
|
-
require 'active_record'
|
30
|
-
load_now.call()
|
17
|
+
autoload :Object
|
18
|
+
autoload :Record
|
19
|
+
autoload :Util
|
31
20
|
end
|
data/lib/active_type/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|