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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aab84f6f3a0272e4e3745bace374ef628da306e77ab9c339b28bb320d8ff61dc
4
- data.tar.gz: b2b0d450245b3405fad0b2cec2f513032f65fb294c2a47819cc2d503eb986de4
3
+ metadata.gz: 2b05da5eb835516ae2be2ff5577c763a1a511678e3dc134d6629540c7bc31abe
4
+ data.tar.gz: dc3a893b7392eadbd7c4cd62b0782a3085db09bc376c26da8818d738d5b45ca6
5
5
  SHA512:
6
- metadata.gz: 8432e4d4a4f9a9ed2c4da5ae7ba7e95d46d79e424796aedee2fda45fdd2c7b61a4f23203d03a848869e65fe665a8ed9736c8b031515b8103d23710291312dd3b
7
- data.tar.gz: abe4967268a5f14621db4c24390c87bebdc1be02baaa1396d361e31c03863a3afd5295760d33697ad6c2dfc681aef02be90c509ad1dcd73f5763629b0ce9064f
6
+ metadata.gz: 2db3f6f0e334c2b21ad4a37b94bc7c163765d502e8709069395de7db28ed9a440ab646f64649f37c883d745da5b8cd75aeb1df4d49e266d9aa318a900b241d8e
7
+ data.tar.gz: e92e622115b257e8a6961a883c2454860e44eda32c3cb3636df777ea9fa5d0e34d37d822d3df2c11116faf52cda81806a12a33f5cf8fffcc3c463d61336ace56
@@ -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.3.1 2022-12-07
1
+ ## v2.4.0 2023-10-26c
2
2
 
3
3
  ### Changed
4
4
 
5
- * Add support for namespaced auto loading paths
6
- * Fix jruby to version 9.3.*
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
- [Compare v2.3.0...v2.3.1](https://github.com/rom-rb/rom-rails/compare/v2.3.0...v2.3.1)
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", '6.1.1').freeze
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 = { default: build(default_configuration.symbolize_keys) }
40
+ specs = {}
41
41
 
42
- if rails6?
43
- configurations.configs_for(env_name: env).each do |config|
44
- specs[config.spec_name.to_sym] = build(config.config.symbolize_keys)
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
- def default_configuration
52
- if rails6?
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
@@ -1,5 +1,5 @@
1
1
  module ROM
2
2
  module Rails
3
- VERSION = '2.3.1'.freeze
3
+ VERSION = '2.4.0'.freeze
4
4
  end
5
5
  end
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.4'
27
- spec.add_runtime_dependency 'dry-equalizer', '~> 0.2'
28
- spec.add_runtime_dependency 'railties', '>= 3.0', '< 6.2'
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"
@@ -1,5 +1,5 @@
1
1
  class User
2
- include Dry::Equalizer(:id, :name, :email)
2
+ include Dry::Core::Equalizer.new(:id, :name, :email)
3
3
 
4
4
  attr_reader :id, :name, :email
5
5
 
@@ -7,6 +7,7 @@ Bundler.setup(:default, Rails.env)
7
7
  require 'rom-sql'
8
8
  require 'rom-rails'
9
9
  require 'rspec-rails'
10
+ require 'dry/core/equalizer'
10
11
 
11
12
  module Dummy
12
13
  class Application < Rails::Application
@@ -5,7 +5,7 @@ module ROM
5
5
  end
6
6
 
7
7
  class Gateway < ROM::Gateway
8
- include Dry::Equalizer(:args)
8
+ include Dry::Core::Equalizer.new(:args)
9
9
  adapter :test_adapter
10
10
 
11
11
  attr_reader :args, :datasets
@@ -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.3.1
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: 2022-12-07 00:00:00.000000000 Z
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.4'
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.4'
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: '3.0'
48
+ version: '6.0'
63
49
  - - "<"
64
50
  - !ruby/object:Gem::Version
65
- version: '6.2'
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: '3.0'
58
+ version: '6.0'
73
59
  - - "<"
74
60
  - !ruby/object:Gem::Version
75
- version: '6.2'
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.2'
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.2'
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.32
280
+ rubygems_version: 3.2.33
295
281
  signing_key:
296
282
  specification_version: 4
297
283
  summary: Integrate Ruby Object Mapper with Rails