dynamic-active-model 0.16.0 → 1.0.0
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/lib/dynamic-active-model/setup.rb +15 -15
- data/lib/dynamic-active-model/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 471bcb2966f59d8f8f4f7df9f32432cf6ff215685a770e2a99956844e0f2d8d5
|
|
4
|
+
data.tar.gz: 69941d0598425aaf866cfdc29a6e8252d38df291d61523e6edae6243d7f049c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7b6cd8138519d8879df5fab6349771b2cc586d340752d566431a985aac152f102c10654dd60098695f303f3fd35eec5b85f109d269ac24a489b51de0a6f2e05
|
|
7
|
+
data.tar.gz: 3402b23d14abd1b92525642021a5586a202d83aa09683cfe14ae576d9ead974fdccd72374bb7d4f47b77ffc56ca4ba8c8fbb48f3c8cdc371ba283b2f15f24a9f
|
|
@@ -63,11 +63,12 @@ module DynamicActiveModel
|
|
|
63
63
|
|
|
64
64
|
# Sets or gets the database connection options
|
|
65
65
|
# @param options [Hash, Symbol, String, nil] Anything establish_connection accepts:
|
|
66
|
-
# a config hash, or a Symbol naming a database.yml entry for the
|
|
67
|
-
# environment
|
|
68
|
-
# @return [Hash, Symbol] The current connection options
|
|
66
|
+
# a config hash, a URL, or a Symbol naming a database.yml entry for the
|
|
67
|
+
# current environment
|
|
68
|
+
# @return [Hash, Symbol, String] The current connection options
|
|
69
|
+
# @raise [ArgumentError] For a database.yml name given as a String
|
|
69
70
|
def connection_options(options = nil)
|
|
70
|
-
|
|
71
|
+
reject_database_yml_name!(options) if options.is_a?(String)
|
|
71
72
|
|
|
72
73
|
update_config(:connection_options, options) if options
|
|
73
74
|
|
|
@@ -173,17 +174,16 @@ module DynamicActiveModel
|
|
|
173
174
|
|
|
174
175
|
private
|
|
175
176
|
|
|
176
|
-
#
|
|
177
|
-
#
|
|
178
|
-
# @
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
ActiveRecord::Base.configurations.configs_for(env_name: ::Rails.env, name: name).configuration_hash
|
|
177
|
+
# A String database.yml name was deprecated in 0.16 and removed in 1.0. Without
|
|
178
|
+
# this check it would reach establish_connection as a URL and fail confusingly.
|
|
179
|
+
# @param options [String]
|
|
180
|
+
# @raise [ArgumentError] Unless the String is a URL
|
|
181
|
+
def reject_database_yml_name!(options)
|
|
182
|
+
return if options.include?('://')
|
|
183
|
+
|
|
184
|
+
raise ArgumentError,
|
|
185
|
+
"connection_options no longer accepts a database.yml name as a String (#{options.inspect}); " \
|
|
186
|
+
"pass a Symbol instead (connection_options #{options.to_sym.inspect})"
|
|
187
187
|
end
|
|
188
188
|
|
|
189
189
|
# Stores a single configuration value
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dynamic-active-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Doug Youch
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '7.1'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '7.1'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: inheritance-helper
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
71
71
|
requirements:
|
|
72
72
|
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '3.
|
|
74
|
+
version: '3.2'
|
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements:
|
|
77
77
|
- - ">="
|