active_type 0.6.1 → 0.6.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: 92c728f619a6d8e84a202bb91649085ebf7af041
4
- data.tar.gz: ebdfd555c423a97ac64092948b5b1fae8523f1ea
3
+ metadata.gz: cc7ab992e4c50b6b75f74a62feb7b12c65a46703
4
+ data.tar.gz: 4b03beac33f4608904815d836cdf05fc68e2f769
5
5
  SHA512:
6
- metadata.gz: f1cbed5159da5c1b41e18da5c3656c5a2d2ccef766e317e25272fa7212cd17671754614c1b7ecf2648547808bc23001aa69a4112227348490deacfcc15ea8438
7
- data.tar.gz: ba963a430fc2d990c7bfc566d63adbdccbcf60f95dc65d504428c05b4313dad3c8af98c408654a34660030a571a8a50bf989d5a9ae1bcbb79c7a78fe6619f840
6
+ metadata.gz: 7cda677b927c7c8af52015bf23f2ebd3bb597ccf793bdecbc793ca3ea7a4da80bee0986d0f9a651b06dfdccdaae7ce2b7066de9aec7f76a5104db8d79918e79c
7
+ data.tar.gz: 8e4ce97d57197a2e618774e660a7ad70547ee12d906650d492cafb2f7c2dbf4adb4d12b29d3643d0e8de27917e2a93ac166cc5da000b66ba5d569ef2f1f14721
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ 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.2][] (2017-01-30)
8
+
9
+ * When used with Rails, defer loading to not interfere with `ActiveRecord` configuration in initializers.
10
+
11
+ ## [0.6.1][] (2016-12-05)
12
+
13
+ * Remove spec folder from packaged gem.
14
+
7
15
  ## [0.6.0][] (2016-07-05)
8
16
 
9
17
  * Drop support for 1.8.7.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- active_type (0.6.1)
4
+ active_type (0.6.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
data/lib/active_type.rb CHANGED
@@ -1,14 +1,31 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'active_type/version'
4
- require 'active_record'
5
- require 'active_type/util'
6
- require 'active_type/record'
7
- require 'active_type/object'
8
-
9
- if ActiveRecord::VERSION::STRING == '4.2.0'
10
- raise(<<-MESSAGE.strip_heredoc)
11
- ActiveType is not compatible with ActiveRecord 4.2.0. Please upgrade to 4.2.1
12
- For details see https://github.com/makandra/active_type/issues/31
13
- MESSAGE
4
+
5
+
6
+ load_now = proc do
7
+ require 'active_type/util'
8
+ require 'active_type/record'
9
+ require 'active_type/object'
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
17
+ end
18
+
19
+
20
+ if defined?(Rails) && defined?(ActiveSupport)
21
+ # If we are inside Rails, we'll assume active_record will be required anyways
22
+ # in this case, wait until then, to not mess with ActiveRecord configuration.
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()
14
31
  end
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.1
4
+ version: 0.6.2
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: 2016-12-05 00:00:00.000000000 Z
12
+ date: 2017-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler