rom-rails 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -15
- data/CHANGELOG.md +12 -4
- data/Gemfile +2 -3
- data/lib/generators/rom/install/templates/application_model.rb +2 -1
- data/lib/rom/rails/active_record/configuration.rb +10 -19
- data/lib/rom/rails/version.rb +1 -1
- data/rom-rails.gemspec +3 -4
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/lib/rom/test_adapter.rb +1 -1
- data/spec/lib/active_record/configuration_spec.rb +3 -1
- data/spec/lib/generators/install_generator_spec.rb +2 -1
- metadata +11 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b05da5eb835516ae2be2ff5577c763a1a511678e3dc134d6629540c7bc31abe
|
4
|
+
data.tar.gz: dc3a893b7392eadbd7c4cd62b0782a3085db09bc376c26da8818d738d5b45ca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2db3f6f0e334c2b21ad4a37b94bc7c163765d502e8709069395de7db28ed9a440ab646f64649f37c883d745da5b8cd75aeb1df4d49e266d9aa318a900b241d8e
|
7
|
+
data.tar.gz: e92e622115b257e8a6961a883c2454860e44eda32c3cb3636df777ea9fa5d0e34d37d822d3df2c11116faf52cda81806a12a33f5cf8fffcc3c463d61336ace56
|
data/.github/workflows/ci.yml
CHANGED
@@ -24,25 +24,13 @@ jobs:
|
|
24
24
|
fail-fast: false
|
25
25
|
matrix:
|
26
26
|
ruby:
|
27
|
+
- '3.1'
|
28
|
+
- '3.0'
|
27
29
|
- '2.7'
|
28
|
-
- '2.6'
|
29
|
-
- '2.5'
|
30
|
-
- '2.4'
|
31
|
-
- 'jruby-9.3'
|
32
30
|
rails:
|
31
|
+
- "7.0.0"
|
33
32
|
- "6.1.0"
|
34
33
|
- "6.0.0"
|
35
|
-
- "5.2.0"
|
36
|
-
- "5.1.0"
|
37
|
-
- "5.0.0"
|
38
|
-
- "4.2.0"
|
39
|
-
exclude:
|
40
|
-
- ruby: "2.4"
|
41
|
-
rails: "6.0.0"
|
42
|
-
- ruby: "2.4"
|
43
|
-
rails: "6.1.0"
|
44
|
-
- ruby: "2.7"
|
45
|
-
rails: "4.2.0"
|
46
34
|
env:
|
47
35
|
APT_DEPS: libsqlite3-dev
|
48
36
|
RAILS_VERSION: "${{matrix.rails}}"
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
## v2.
|
1
|
+
## v2.4.0 2023-10-26c
|
2
2
|
|
3
3
|
### Changed
|
4
4
|
|
5
|
-
* Add
|
6
|
-
*
|
5
|
+
* Add configuration to allow not trigger reload on each request (alex-lairan)
|
6
|
+
* Allow namespace configuration from within an auto_registration path (sasa-b)
|
7
7
|
|
8
|
-
|
8
|
+
### Added
|
9
|
+
|
10
|
+
* Compatible with Rails 7.0 (nolantait)
|
11
|
+
* Compatible with Rails 7.1 (cflipse)
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
|
15
|
+
* Dropped support for Rails < 6.0
|
16
|
+
* Dropped support for Ruby < 2.7
|
9
17
|
|
10
18
|
## v2.3.0 2021-03-20
|
11
19
|
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
RAILS_VERSION = ENV.fetch("RAILS_VERSION", '
|
5
|
+
RAILS_VERSION = ENV.fetch("RAILS_VERSION", '7.0.4').freeze
|
6
6
|
|
7
7
|
%w(railties actionview actionpack activerecord).each do |name|
|
8
8
|
gem name, "~> #{RAILS_VERSION}"
|
@@ -11,8 +11,6 @@ end
|
|
11
11
|
gem 'byebug', platforms: :mri
|
12
12
|
gem 'sqlite3', platforms: [:mri, :rbx]
|
13
13
|
|
14
|
-
|
15
|
-
|
16
14
|
if ENV["USE_ROM_MASTER"].eql?("true")
|
17
15
|
gem 'rom', git: 'https://github.com/rom-rb/rom', branch: 'master' do
|
18
16
|
gem 'rom-core'
|
@@ -33,6 +31,7 @@ platforms :jruby do
|
|
33
31
|
end
|
34
32
|
|
35
33
|
group :test do
|
34
|
+
gem 'debug'
|
36
35
|
gem 'capybara'
|
37
36
|
gem 'codeclimate-test-reporter', require: nil
|
38
37
|
gem 'database_cleaner', "~> 1.8.1"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "types"
|
2
|
+
require "dry/core/equalizer"
|
2
3
|
|
3
4
|
class ApplicationModel < ROM::Struct
|
4
5
|
def self.inherited(base)
|
@@ -9,7 +10,7 @@ class ApplicationModel < ROM::Struct
|
|
9
10
|
base.extend ActiveModel::Naming
|
10
11
|
base.include ActiveModel::Conversion
|
11
12
|
|
12
|
-
base.include Dry::Equalizer(:id)
|
13
|
+
base.include Dry::Core::Equalizer.new(:id)
|
13
14
|
|
14
15
|
base.attribute :id, Types::ID
|
15
16
|
end
|
@@ -37,23 +37,20 @@ module ROM
|
|
37
37
|
#
|
38
38
|
# @api private
|
39
39
|
def call
|
40
|
-
specs = {
|
40
|
+
specs = {}
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
configurations.configs_for(env_name: env).each do |config|
|
43
|
+
if config.respond_to?(:configuration_hash)
|
44
|
+
name, hash = [config.name, config.configuration_hash]
|
45
|
+
else # Rails 6.0
|
46
|
+
name, hash = [config.spec_name, config.config]
|
45
47
|
end
|
46
|
-
end
|
47
|
-
|
48
|
-
specs
|
49
|
-
end
|
50
48
|
|
51
|
-
|
52
|
-
|
53
|
-
configurations.default_hash(env)
|
54
|
-
else
|
55
|
-
configurations.fetch(env)
|
49
|
+
specs[:default] ||= hash
|
50
|
+
specs[name.to_sym] = hash
|
56
51
|
end
|
52
|
+
|
53
|
+
specs.transform_values { |hash| build hash.symbolize_keys }
|
57
54
|
end
|
58
55
|
|
59
56
|
# Builds a configuration hash from a flat database config hash.
|
@@ -77,12 +74,6 @@ module ROM
|
|
77
74
|
uri = uri_builder.build(adapter, uri_options)
|
78
75
|
{ uri: uri, options: other_options }
|
79
76
|
end
|
80
|
-
|
81
|
-
private
|
82
|
-
|
83
|
-
def rails6?
|
84
|
-
::ActiveRecord::VERSION::MAJOR >= 6
|
85
|
-
end
|
86
77
|
end
|
87
78
|
end
|
88
79
|
end
|
data/lib/rom/rails/version.rb
CHANGED
data/rom-rails.gemspec
CHANGED
@@ -23,10 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
}
|
24
24
|
|
25
25
|
spec.add_runtime_dependency 'addressable', '~> 2.3'
|
26
|
-
spec.add_runtime_dependency 'dry-core', '~> 0
|
27
|
-
spec.add_runtime_dependency '
|
28
|
-
spec.add_runtime_dependency '
|
29
|
-
spec.add_runtime_dependency 'rom', '~> 5.2'
|
26
|
+
spec.add_runtime_dependency 'dry-core', '~> 1.0'
|
27
|
+
spec.add_runtime_dependency 'railties', '>= 6.0', '< 8.0.0'
|
28
|
+
spec.add_runtime_dependency 'rom', '~> 5.3'
|
30
29
|
|
31
30
|
spec.add_development_dependency "bundler"
|
32
31
|
spec.add_development_dependency "rake"
|
@@ -20,7 +20,9 @@ RSpec.describe ROM::Rails::ActiveRecord::Configuration do
|
|
20
20
|
URI.parse(uri.gsub(/^jdbc:/, ''))
|
21
21
|
end
|
22
22
|
|
23
|
-
it 'raises an error without specifying a database'
|
23
|
+
it 'raises an error without specifying a database' do
|
24
|
+
expect { read({}) }.to raise_error KeyError
|
25
|
+
end
|
24
26
|
|
25
27
|
context 'with postgresql adapter' do
|
26
28
|
it 'rewrites the scheme' do
|
@@ -64,6 +64,7 @@ RSpec.describe ROM::Generators::InstallGenerator, type: :generator do
|
|
64
64
|
file "application_model.rb" do
|
65
65
|
contains <<-CONTENT.strip_heredoc
|
66
66
|
require "types"
|
67
|
+
require "dry/core/equalizer"
|
67
68
|
|
68
69
|
class ApplicationModel < ROM::Struct
|
69
70
|
def self.inherited(base)
|
@@ -74,7 +75,7 @@ RSpec.describe ROM::Generators::InstallGenerator, type: :generator do
|
|
74
75
|
base.extend ActiveModel::Naming
|
75
76
|
base.include ActiveModel::Conversion
|
76
77
|
|
77
|
-
base.include Dry::Equalizer(:id)
|
78
|
+
base.include Dry::Core::Equalizer.new(:id)
|
78
79
|
|
79
80
|
base.attribute :id, Types::ID
|
80
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Flipse
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -31,62 +31,48 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0
|
34
|
+
version: '1.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: dry-equalizer
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0.2'
|
49
|
-
type: :runtime
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0.2'
|
41
|
+
version: '1.0'
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
43
|
name: railties
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
59
45
|
requirements:
|
60
46
|
- - ">="
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
48
|
+
version: '6.0'
|
63
49
|
- - "<"
|
64
50
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
51
|
+
version: 8.0.0
|
66
52
|
type: :runtime
|
67
53
|
prerelease: false
|
68
54
|
version_requirements: !ruby/object:Gem::Requirement
|
69
55
|
requirements:
|
70
56
|
- - ">="
|
71
57
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
58
|
+
version: '6.0'
|
73
59
|
- - "<"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
61
|
+
version: 8.0.0
|
76
62
|
- !ruby/object:Gem::Dependency
|
77
63
|
name: rom
|
78
64
|
requirement: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '5.
|
68
|
+
version: '5.3'
|
83
69
|
type: :runtime
|
84
70
|
prerelease: false
|
85
71
|
version_requirements: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '5.
|
75
|
+
version: '5.3'
|
90
76
|
- !ruby/object:Gem::Dependency
|
91
77
|
name: bundler
|
92
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -291,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
277
|
- !ruby/object:Gem::Version
|
292
278
|
version: '0'
|
293
279
|
requirements: []
|
294
|
-
rubygems_version: 3.2.
|
280
|
+
rubygems_version: 3.2.33
|
295
281
|
signing_key:
|
296
282
|
specification_version: 4
|
297
283
|
summary: Integrate Ruby Object Mapper with Rails
|