Giter VIP home page Giter VIP logo

rom-rails's People

Contributors

007lva avatar aflatter avatar alex-lairan avatar artofhuman avatar bilby91 avatar cervajz avatar cflipse avatar chastell avatar cllns avatar duduribeiro avatar endash avatar flash-gordon avatar janjiss avatar kchien avatar maetl avatar maximderbin avatar mjtko avatar morgoth avatar nolantait avatar pex avatar plashchynski avatar radar avatar sasa-b avatar solnic avatar stevehodgkiss avatar ur5us avatar vbyno avatar vrish88 avatar xaviershay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rom-rails's Issues

Not working on JRuby 9.4.0

Describe the bug

JRuby spec checks are failing because the latest JRuby version is being pulled, 9.4.0, which is not compatible with rspec gem version used for rom-rails.

As per JRuby website:

  • JRuby 9.4.0.0 is our point release of our Ruby 3.1.x support.
  • JRuby 9.3.9.0 is our point release of our Ruby 2.6.x support.

For the time being we should either add JRuby version constraint for 9.3 or see if we can update the gems to solve the issue.

Expected behavior

JRuby checks not failing on build pipeline

Unclear From Documentation How To Properly Access ROM in Rails/RSpec

The documentation shows ROM.env as the way to access things from Rails' CLI, e.g., ROM.env.relations(:users)`. If used in specs, this seems to set things up a little differently than the subsequent documentation demonstrates. For example, with:

class UsersRelation < ROM::Relation[:sql]
  def by_username(search_username)
    [etc]

Running a spec containing something like this will work:

ROM.env.relation(:users).count

But this will not:

ROM.env.relation(:users).by_username('testuser')

 Failure/Error: ROM.env.relation(:users).by_username('testuser')
 NoMethodError:
   undefined method `by_username' for #<#<Class:0x007fe701c8f240>:0x007fe6fe26e930>

If ROM.env is returning the same thing that the documentation just refers to as the local variable "rom" later on, then something is missing.

Similarly, trying to wrap all that in a Repository (unclear if those are deprecated) nets a similar result:

class UserRepository < ROM::Repository::Base
  relations :users

  def by_username(username)
    users.by_username(username)
    [etc]

UserRepository.new(ROM.env).by_username('testuser')

Failure/Error: found = UserRepository.new(ROM.env).by_username('testuser')
NoMethodError:
    undefined method `by_username' for #<ROM::Repository::LoadingProxy:0x007fd95ad44870>

After showing the ROM.env example for use in the CLI, the documentation just shows rom as in rom.relation(). I couldn't find where that rom might be defined (and therefore how.)

Gem Load Error is: uninitialized constant Int

Fresh project, ruby-2.4.0, rails-5.2.0. After installing rom-rails gem I can't start project and can't run specs. I'm getting:

/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rom-rails'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Int
Backtrace for gem load error is:
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `block in load_missing_constant'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `rescue in load_missing_constant'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:43:in `load_missing_constant'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:38:in `<class:Curried>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:19:in `<class:Relation>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:10:in `<module:ROM>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:9:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/relation.rb:16:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom/core.rb:11:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-core-4.2.0/lib/rom-core.rb:1:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-4.2.0/lib/rom.rb:1:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/rom-rails-1.1.1/lib/rom-rails.rb:1:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:71:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:71:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:70:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:79:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `each'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `block in require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `each'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler.rb:114:in `require'
/home/riky/work/warehouse/config/application.rb:18:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:145:in `block in perform'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `each'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `block in require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `each'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bundler-1.16.2/lib/bundler.rb:114:in `require'
        from /home/riky/work/warehouse/config/application.rb:18:in `<main>'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:145:in `block in perform'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
        from /home/riky/.rvm/gems/ruby-2.4.0@warehouse/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
        from bin/rails:4:in `<main>'

`adapter_class': undefined method `to_sym' for nil:NilClass

I cannot setup rom-rails

When I do a "bin/rails", I got :

/var/lib/gems/2.4.0/gems/sequel-5.6.0/lib/sequel/database/connecting.rb:17:in adapter_class': undefined method to_sym' for nil:NilClass (NoMethodError)

# config/initializers/rom.rb
ROM::Rails::Railtie.configure do |config|
  config.gateways[:default] = [:sql, 'localhost'] 
end
gem 'rom'
gem 'rom-sql'
gem 'rom-rails'

0.6.0 not working with spring 1.7.1

Using the current versions of rom-rails (0.6.0) and rom-sql (0.7.0) along with spring (1.7.1) I get the following error ONLY when using spring:

.../gems/rom-1.0.0/lib/rom/container.rb:125:in `each_key': undefined method `disconnect' for :default:Symbol (NoMethodError)

However, it works fine when I run e.g. DISABLE_SPRING=true rails c

Also, spring stop does not solve the issue.

How to handle uniqueness constraints?

I saw validates_uniqueness_of doesn't work.
I'm guessing this is because it requires access to the database during validation?

So I was wondering how (or where) these kind of "database-dependent" validations should be implemented?

Not working with sqlite

Describe the bug

I followed your guide on setting up rom-rails and it doesn't work with Sqlite database, to make sure that it's not outdated and that it actually works I switched to Postgres and everything went fine. I think the issue is that the Sequel adapter expects sqlite in the protocol part of the DATABASE_URL but Ruby On Rails actually uses sqlite3 and looks like rom-rails relies on both?

This is the stack trace with DATABASE_URL=sqlite:///Users/sasablagojevic/Developer/Projects/rails_data_mapper/db/development.sqlite3

/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': Could not load the 'sqlite' Active Record adapter. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile. (LoadError)
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1205:in `resolve_pool_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1046:in `establish_connection'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:52:in `establish_connection'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/railtie.rb:222:in `block (2 levels) in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:51:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/base.rb:15:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/active_record/configuration.rb:25:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:106:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:106:in `load_active_record_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:90:in `gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `create_configuration'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:78:in `create_container'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:45:in `block in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `catch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:199:in `block in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/reloader.rb:88:in `prepare!'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in `run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application.rb:391:in `initialize!'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/config/environment.rb:5:in `<main>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:37:in `start'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:135:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/rails:5:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/command.rb:7:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client.rb:30:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/bin/spring:49:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:10:in `block in <top (required)>'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:7:in `<top (required)>'
        from bin/rails:2:in `load'
        from bin/rails:2:in `<main>'
/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- active_record/connection_adapters/sqlite_adapter (LoadError)
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1205:in `resolve_pool_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1046:in `establish_connection'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:52:in `establish_connection'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/railtie.rb:222:in `block (2 levels) in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:51:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-6.1.7/lib/active_record/base.rb:15:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/active_record/configuration.rb:25:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:106:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:106:in `load_active_record_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:90:in `gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `create_configuration'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:78:in `create_container'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:45:in `block in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `catch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:199:in `block in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/reloader.rb:88:in `prepare!'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in `run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application.rb:391:in `initialize!'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/config/environment.rb:5:in `<main>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:37:in `start'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:135:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/rails:5:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/command.rb:7:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client.rb:30:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/bin/spring:49:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:10:in `block in <top (required)>'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:7:in `<top (required)>'
        from bin/rails:2:in `load'
        from bin/rails:2:in `<main>'

And this is the stack trace with DATABASE_URL=DATABASE_URL=sqlite3:///Users/sasablagojevic/Developer/Projects/rails_data_mapper/db/development.sqlite3:

Exiting
/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': LoadError: cannot load such file -- sequel/adapters/sqlite3 (Sequel::AdapterNotFound)
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:87:in `load_adapter'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:17:in `adapter_class'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:36:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/core.rb:124:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-sql-3.5.0/lib/rom/sql/gateway.rb:222:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-sql-3.5.0/lib/rom/sql/gateway.rb:82:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/gateway.rb:96:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/gateway.rb:96:in `setup'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:54:in `block in normalize_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `each_with_object'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `normalize_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:28:in `configure_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:20:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/configuration.rb:53:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/configuration.rb:53:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `create_configuration'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:78:in `create_container'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:45:in `block in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `catch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:199:in `block in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/reloader.rb:88:in `prepare!'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in `run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application.rb:391:in `initialize!'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/config/environment.rb:5:in `<main>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:37:in `start'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:135:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/rails:5:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/command.rb:7:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client.rb:30:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/bin/spring:49:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:10:in `block in <top (required)>'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:7:in `<top (required)>'
        from bin/rails:2:in `load'
        from bin/rails:2:in `<main>'
/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- sequel/adapters/sqlite3 (LoadError)
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:38:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:87:in `load_adapter'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:17:in `adapter_class'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/database/connecting.rb:36:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sequel-5.62.0/lib/sequel/core.rb:124:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-sql-3.5.0/lib/rom/sql/gateway.rb:222:in `connect'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-sql-3.5.0/lib/rom/sql/gateway.rb:82:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/gateway.rb:96:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/gateway.rb:96:in `setup'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:54:in `block in normalize_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `each_with_object'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:47:in `normalize_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:28:in `configure_gateways'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/environment.rb:20:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/configuration.rb:53:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-core-5.2.6/lib/rom/configuration.rb:53:in `initialize'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `new'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:73:in `create_configuration'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:78:in `create_container'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rom-rails-2.3.0/lib/rom/rails/railtie.rb:45:in `block in <class:Railtie>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `catch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:199:in `block in halting'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/reloader.rb:88:in `prepare!'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `instance_exec'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in `run_initializers'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/application.rb:391:in `initialize!'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/config/environment.rb:5:in `<main>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:37:in `start'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:135:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<main>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/rails:5:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/rails.rb:28:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client/command.rb:7:in `call'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/client.rb:30:in `run'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/bin/spring:49:in `<top (required)>'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `load'
        from /Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/spring-4.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/sasablagojevic/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:10:in `block in <top (required)>'
        from <internal:kernel>:90:in `tap'
        from /Users/sasablagojevic/Developer/Projects/rails_data_mapper/bin/spring:7:in `<top (required)>'
        from bin/rails:2:in `load'
        from bin/rails:2:in `<main>'

So looks like it fails at different points but it interacts with both Sequel's Sqlite adapter and Ruby On Rails' Sqlite3 adapter

To Reproduce

Just use the sqlite database and provide the URL via ENV

Expected behavior

It would be expected for Ruby On Rails to work with Sqlite database when being setup as you describe in the docs

Your environment

  • Affects my production application: NO
  • Ruby version: 3.1
  • Ruby On Rails version: 6.1.7
  • OS: MacOS

ControllerExtension for ApplicationController::API

When building an API Rails application the ControllerExtension methods aren't available in controllers because ApplicationController inherits from ActionController::API rather than ActionController::Base.

Should the railtie instead include the extension directly into ApplicationController for Rails 5.0+ applications?

My current temporary fix is to manually include the extension in ApplicationController:

# app/controllers/application_controller.rb
class ApplicationController < ActionController::API
  include ROM::Rails::ControllerExtension
end

Documentation

Could you describe in README what exactly this extension adds to Rails?

Thank you!

undefined local variable or method `rom' for #<TasksController:0x007fc6b0684bc8>

This works fine:

class TasksController < ApplicationController
  def index
    render json: rom.read(:tasks).all
  end
end

This blows up:

class TasksController < ActionController::Base
  def index
    render json: rom.read(:tasks).all
  end
end

This is because the ControllerExtension is included in ApplicationController and not ActionController::Base.

Some documentation where this rom method is coming from and how you can get one in your own controller base class would be nice.

Remove dependency on rom-model

ROM Model was extracted from this gem, but it should not be a hard runtime dependency.

[ ] Make the form generator optional
[x] investigate the various validation proxies
[ ] update specs to not (necessarily) depend on ROM::Model::Forms

App directory appended to auto_registration_paths

Question.. Is there a particular reason the app folder is joined onto the end of paths added in auto_registration_paths?

lib/rom/rails/railtie.rb:32

result.concat(COMPONENT_DIRS.map { |dir| root_path.join('app', dir).to_s })

If not, could I suggest a change where it's dropped (or another path registry is added if backwards compatibility is essential) in favor of letting the user configure their own full path. Unfortunately because of the current setup a folder structure like the one shown below isn't really possible.

app
  |-- persistence
       |-- commands
       |-- mappers
       |-- relations

As well, if a user wanted all of their persistence code in say lib, before it could be eager loaded you'd have to have the directory lib\app which seems like an odd requirement.

Allow set configuration.auto_registration namespace TRUE

Hi,

I would like to know if there is way to set the namespace config to TRUE since in the rom-rb the default value is true.

In the:
lib/rom/rails/railtie.rb
we have the hard coded value:
configuration.auto_registration(::Rails.root.join(root_path), namespace: false)

Documentation or Example of Configuration Without database.yml

The only information I could find for configuring a SQL gateway was by examining the files generated by Rake tasks in the Rails tutorial. Unfortunately, those files use an approach that depends on a database.yml file.

For situations where database.yml isn't the best solution, how can we configure this?

Note: I took a few stables at placing ROM.setup in a few different spots, but it seems the railtie isn't having any of that nonsense.

Reform integration

I'd like to provide some form of reform integration support.

This may simply come in the form of a generator, or we may have to build some kind of reform adapter -- there are a few subtle translation points that need to be handled (eg, the save(&block) yields a string-keyed hash ...) that can get repetitive fast

I'm not sure if it's worth it to try to provide a translation module to aid transition of existing ROM::Model::Form classes to use reform.

Relations not auto loading

I created a new Rails 4.2.4 app and configured it according to the directions. The Sqlite connection in my rom initializer works as running a db:migrate works. The app when in the console will not autoload relations. With a user class like this in app/relations/users.rb:

class Users < ROM::Relation[:sql]
  # some methods
  dataset :users
  register_as :users
end

In the console if I type

ROM.container
 => #<ROM::Container gateways={} relations=#<ROM::RelationRegistry elements={}> mappers=#<ROM::Registry elements={}> commands=#<ROM::Registry elements={}>>

Then I see that the relations are empty.

Rails - Nested resource routes and forms

From @pnomolos on June 2, 2015 3:6

I've run into difficulty when using a form for a nested resource, because it's the Form object itself defining to_model, rather than the object instance. Of course, with nested resources this means that I will need to build a Form instance for every object that is used to generated a URL for the route, and that seems like a bit of a waste. At the same time, I appreciate that you're trying to avoid the monolithic/maximalist approach that Rails has taken. Wondering if there might be any suggestions or ideas on how to solve this? Mine would be a simplistic base interface you can include that implements the necessary ActiveModel extensions, but wondering if there's a better way about this.

Edit: I'm working around this for now by also passing url:, but that's obviously less than ideal as well.

ROM-SQL Connection remains on development

Describe the bug

ROM keep previous connections when rails reload the codebase.
Due to this behavior, after some changes you get a

PG::ConnectionBad: FATAL:  remaining connection slots are reserved for non-replication superuser connections

To Reproduce

A Rails app with ROM and ROM-SQL.

Change multiple times the codebase with the Rails server started.

Expected behavior

After each reload, ROM should clear his connections.

Your environment

  • Affects my production application: NO
  • Ruby version: 2.6.6
  • OS: All

Rake db:reset is not working because of multiple connections

Hey, I am using ROM in conjunction with AR and when I try to do rake db:reset, ROM has an active connection and disallows to drop the database.

rake db:reset
PG::ObjectInUse: ERROR: database "makeweight_development" is being accessed by other users
DETAIL: There is 1 other session using the database.
: DROP DATABASE IF EXISTS "makeweight_development"

naming convention

I run:

> rails g rom:mapper AppUser

got

class AppUserMapper < ROM::Mapper
  relation :app_users
  register_as :appuser
  ...

Is appuser a mistake? Or it is so special convention?

Error undefined method `symbolize_keys' in rails v 6rc2

I added rom-rails to my project on rails 6rc2 version and caught the following error:

/Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/active_record/configuration.rb:29:in `call': undefined method `symbolize_keys' for #<Array:0x00007fadefc74490> (NoMethodError)
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/railtie.rb:105:in `infer_default_gateway'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/railtie.rb:89:in `gateways'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/railtie.rb:73:in `create_configuration'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/railtie.rb:78:in `create_container'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/railtie.rb:190:in `public_send'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/railtie.rb:190:in `method_missing'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/rom-rails-2.0.0/lib/rom/rails/railtie.rb:45:in `block in <class:Railtie>'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:429:in `instance_exec'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:429:in `block in make_lambda'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:201:in `block (2 levels) in halting'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:607:in `block (2 levels) in default_terminator'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:606:in `catch'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:606:in `block in default_terminator'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:202:in `block in halting'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:514:in `block in invoke_before'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:514:in `each'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:514:in `invoke_before'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/callbacks.rb:134:in `run_callbacks'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0.rc2/lib/active_support/reloader.rb:88:in `prepare!'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/initializable.rb:32:in `instance_exec'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/initializable.rb:32:in `run'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `call'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
	from /Users/markfrost/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/initializable.rb:60:in `run_initializers'
	from /Users/markfrost/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0.rc2/lib/rails/application.rb:363:in `initialize!'
	from /Users/markfrost/oss/to_oss/config/environment.rb:5:in `<main>'


...

Feedback on ROM - Rails setup

I'd like to work with y'all on preparing some kind of quickstart guide for setting up ROM. I'm working my way through trying to setup a bare bones rails project to use ROM and trying to piece together the exact steps I need to follow to get a very basic configuration going is excruciatingly painful. I don't mind doing legwork or anything, but it shouldn't be quite such a pain in the ass to figure out what needs to be done and where.

As just one example, on the associations page, you've got this line:

rom = ROM.container(:memory) do |config| config.register_relation(Users, Tasks) end

Where is this meant to go in a rails application? In the initializer script? It's not at all obvious from the context of the example.

Other examples would include the fact that nowhere in the Rails setup chapter do you explicitly mention that you need to swap out 'require rails/all' for each of the railties, omitting ActiveRecord or that you need to include both rom-rails and rom-sql, or that you need to explicitly set DATABASE_URLs as environment variables.

I really love the concept behind ROM and I'd love to use it on a project, but there needs to be some kind of documentation that takes you quickly through the process of scaffolding up a project.

Generator chooses adapters alphabetically

The relations generator chooses which relation to use alphabetically, so that :http is chosen in preference to :sql ... it's probable that this isn't a thing that the user actually wants.

The generator should look for a default gateway first, and use it's type.
Lacking a default gateway ... can fall back to alphabetical, but also the relation won't work because it doesn't specify a gateway; in that circumstance, the generator should probably force specifying which gateway to use

uninitialized constant Int (NameError)

rom-core fix this problem in this commit rom-rb/rom@4e2a922
but when i install rom-rails gem i have this error

Traceback (most recent call last):
        80: from bin/rails:3:in `<main>'
        79: from bin/rails:3:in `load'
        78: from /home/developer/Projects/backend/bin/spring:15:in `<top (required)>'
        77: from /home/developer/Projects/backend/bin/spring:15:in `require'
        76: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
        75: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
        74: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
        73: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
        72: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
        71: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
        70: from /home/developer/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
        69: from /home/developer/Projects/backend/bin/rails:9:in `<top (required)>'
        68: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        67: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        66: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        65: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        64: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        63: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
        62: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command.rb:46:in `invoke'
        61: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command/base.rb:65:in `perform'
        60: from /home/developer/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        59: from /home/developer/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        58: from /home/developer/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        57: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `perform'
        56: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `tap'
        55: from /home/developer/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:145:in `block in perform'
        54: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        53: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        52: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        51: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        50: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        49: from /home/developer/Projects/backend/config/application.rb:19:in `<main>'
        48: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler.rb:114:in `require'
        47: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `require'
        46: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `each'
        45: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `block in require'
        44: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `each'
        43: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bundler-1.17.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
        42: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        41: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        40: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        39: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        38: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        37: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-rails-1.2.0/lib/rom-rails.rb:1:in `<main>'
        36: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        35: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        34: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        33: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        32: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        31: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-4.2.0/lib/rom.rb:1:in `<main>'
        30: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        29: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        28: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        27: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        26: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        25: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom-core.rb:1:in `<main>'
        24: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        23: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        22: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        21: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        20: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        19: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/core.rb:11:in `<main>'
        18: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        17: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        16: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        15: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        14: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        13: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation.rb:16:in `<main>'
        12: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        11: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        10: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
         9: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
         8: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
         7: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:9:in `<main>'
         6: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:10:in `<module:ROM>'
         5: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:19:in `<class:Relation>'
         4: from /home/developer/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:38:in `<class:Curried>'
         3: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:42:in `load_missing_constant'
         2: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `rescue in load_missing_constant'
         1: from /home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/home/developer/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `block in load_missing_constant': uninitialized constant Int (NameError)

0.6.0 Attempting to Load Every File in /relations as a Relation

For example, I've relations/archivable_queries.rb that looks like so:

module ArchivableQueries
  def list(options = {archived: false})
    where(archived: options[:archived])
  end
end

This is included in various relations. This worked in 0.5.0. However in 0.6.0, rom attempts to load the module as a relation and throws a NoMethodError because ArchivableQueries doesn't define #gateway.

I put together a commit for a little clearer errors that may help understand what I'm getting at:
sensedata/rom@a0edcc3

With that code in and the following config:

config.gateways[:default] = [:sql, database_url, encoding: 'unicode']

I then see:

rom/lib/rom/setup/finalize.rb:135:in `rescue in block in infer_relation?': Cannot infer relation for schema_info with ArchivableQueries; undefined method `dataset' for ArchivableQueries:Module. (RuntimeError)

With inference off, as in:

config.gateways[:default] = [:sql, database_url, encoding: 'unicode', infer_relations: false]

I then see:

rom/lib/rom/setup/finalize/relations.rb:31:in `rescue in block in run!': Cannot finalize relation class ArchivableQueries; undefined method `gateway' for ArchivableQueries:Module. (RuntimeError)

Whether the fix should be to skip non-relation classes and modules (e.g., by checking if they respond to an essential method such as #gateway) as it seemed in 0.5.0, or throwing a more helpful error (e.g., "you put your non-relation class in my relation dir!"), or something else, I don't know. The current state is problematic.

undefined method `finalize' for ROM::Rails::Railtie:Class (NoMethodError)

From @kchien on June 16, 2015 16:57

Using the following gems:

# Gemfile
gem 'rails', '3.0.20'
gem 'rom', '0.7.1'
gem 'rom-rails', :git => 'https://github.com/kchien/rom-rails.git', :branch => 'wip_lower_version_in_gemspec'
gem 'rom-yaml', '0.1.0'

I got the following error when running my tests:

/Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/bundler/gems/rom-rails-4dc4edcb9332/lib/rom/rails/railtie.rb:46:in `block in <class:Railtie>': undefined method `finalize' for ROM::Rails::Railtie:Class (NoMethodError)
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:420:in `_run_prepare_callbacks'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `each'from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:162:in `app'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `run'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `each'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:134:in `initialize!'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:77:in `method_missing'

Should #finalize be defined as a singleton method instead of as an instance method?

Rom rb 4.0

Hey, how to update rom-rb to 4.0 version within this gem? Bundle installs 3.3.3 in my Gemfile.lock.

Use same timezone as Rails in rom-rails

From @nwallace on July 14, 2015 2:27

Rails configuration includes a timezone setting, but rom-rails does not configure the database layer to use that timezone.

In my app, I'm using rom-sql (for a Postgres DB), so I can workaround this issue by configuring Sequel manually (docs here), but this seems like the kind of thing it would be good for rom-rails to do automatically

The "Form" name is misleading

I think when we say "form object" (at least in rubyland, from what I see in other form object projects) we mean an object that takes simple input and (using other objects by composition, keeping separation of concerns in mind), prepares (coerce, strip, etc) and validates the input. And that's it.

That said, an object (ROM::Model::Form) that uses a form (input + validation blocks) to prepare and validate the data, and then performs an action by orchestrating message passing between other objects (the commit! method orchestrating ROM commands) and using the prepared and validated input, as ROM::Model::Form does, looks much more like an Operation, Service Object, Interactor, whatever you call these kind of objects, than just a Form.

A good example, that is close to what a ROM::Model::Form does, is a Trailblazer::Operation (from the trailblazer project), it uses a form object (called a contract there) to prepare and validate the input, and then act upon it within the perform method.

I think calling this object Interactor or Operation would make much more sense (and that it should be extracted to a separate gem, because it has a lot of potential).

Also, I love using ROM, and thank you for all your hard work in trying to make the ruby community a better place!

Separate input params and validation logic

Many people have been confused about params and validations being mixed together. Right now when you include ROM::Model::Params into a class you get attribute DSL and ActiveModel::Validations DSL too. One caveat here is that those validations don't support interaction with a database so for instance if you want to use uniqueness validation you need to override default ROM::Model::Validator logic and do things manually there.

This does work (I use it in my app already) but is suboptimal and ugly and confusing. To improve that I believe it should be possible to have something like that:

class NewUserParams
  include ROM::Model::Params

  attribute :name, String
  attribute :email, String
end

class NewUserValidator
  include ROM::Model::Validator

  validates :name, presence: true
  validates :email, uniqueness: true
end

# "standalone" usage:
params = NewUserParams.new(name: 'Jane', email: '[email protected]')
validator = NewUserValidator.new(params).call

# in command it stays the same, so
ROM.commands(:users) do
  define(:create) do
    input NewUserParams
    validator NewUserValidator
    result :one
  end
end

There are a couple of thing to keep in mind:

  • ActiveModel::Validations (that would be mixed into ROM::Model::Validator) require access to attributes, which means we would need to forward :name and :email to injected params instance (I hope it will work and we won't have to define instance variables copied from params)
  • We would have to come up with a new object type that encapsulates both attributes and error messages object if we want to make it work with various form helpers that expect just one object (notice that an AM-compliant object has both attributes and errors)
  • We would have to extend ROM::Model::Validator to be able to accept relations registry for validations that require database access

refs #14

Add support for logging

Info

Example implementation can be found in sequel-rails project however I'm not sure if that's the current "best practice".

TODO

  • configure Rails.logger for all repositories in the initializer
  • add log subscriber with AS instrumentation support

Unquiness validation fails for updates

From @cflipse on June 13, 2015 13:0

When updating an existing record, the uniqueness validation check does not filter out the "current" relation, and therefore fails.

Need to add a where id <> {id} to the uniquness criteria used.

Look into using dry-system instead of the custom railtie

This is a biggerish one, but it would be good to at least look into using dry-system for managing rom within a rails env. This means skipping rom railtie entirely and using dry-system's railtie instead.

Prerequisites: actual rails support for dry-system

Fails to load a custom struct through Rails autoloading

How to reproduce

user_repo = UserRepository.new(ROM.env)
u = user_repo.users.first
puts u.login

Expected

Some string printed

Actual

ROM::Struct::MissingAttribute: undefined method `login' for #<Entities::User:0x005644dfbd85b0> (not loaded attribute?)

Additional info

This seems to be an autoloading issue since setting config.eager_load to true produces the expected result.

The full code of the Rails project can be found here.

Mapper is ignored when using custom command

So I have rom-http installed, and I need to create auth. So I've created Login command:

class Login < ROM::Commands::Create[:http]
  relation :session_users
  register_as :login
  result :one

  def execute(login, password)
    response = relation
        .dataset
        .with_base_path('/customer-sessions/login')
        .with_options(request_method: :put, params: {
            login: login,
            password: password
        })
        .response
    [response]
  end
end

A relation:

class SessionUsersRelation < ROM::Relation[:http]
  gateway :volgaspot

  schema(:session_users) do
    attribute :id, Types::Strict::Int
    attribute :login, Types::Strict::String
    attribute :full_name, Types::Strict::String
  end
end

And a repository

class SessionUserRepository < ROM::Repository::Root
  root :session_users

  def login(login:, password:)
    session_users
        .map_with(:session_users_mapper)
        .command(:login)
        .call(login, password)
  end
end

I need to rename a couple of fields and instantiate custom model with the methods I need. For testing purposes, all I've done right now is renaming full_name to name:

class SessionUserMapper < ROM::Mapper
  relation :session_users

  model SessionUser

  register_as :session_users_mapper

  attribute :id
  attribute :login
  attribute :name, from: :full_name
end

Also here's a model with a custom method

class SessionUser < ROM::Struct
  constructor_type :schema

  attribute :id, Types::Strict::Int
  attribute :login, Types::Strict::String
  attribute :name, Types::Strict::String.optional

  def test
    "hello world"
  end
end

So what I'm expecting is that the mapper renames full_name to name and instantiates my custom model. But for some weird reason it ignores my mapper, and creates instance of ROM::Struct::SessionUser with full_name attribute (and of course no test method). And what confuses me the most is that under almost identical conditions (same relations, same mappers) fetching of users does work and renames as expected.

Remove virtus dependency

virtus is used in one place, ROM::Rails::Configuration ... we should be able to update that to one of the DRY gems and remove the virtus runtime dependency

Already initialized constant rom-rails v0.9.0.beta1

Upgrading to rom v3.0.0.rc1 with rom-rails v0.9.0.beta1 causes the following warnings on load.

λ rails console
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rom-support-2.0.0/lib/rom/support/constants.rb:2: warning: already initialized constant ROM::Undefined
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/dry-core-0.2.3/lib/dry/core/constants.rb:52: warning: previous definition of Undefined was here
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rom-support-2.0.0/lib/rom/support/constants.rb:3: warning: already initialized constant ROM::EMPTY_HASH
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/dry-core-0.2.3/lib/dry/core/constants.rb:52: warning: previous definition of EMPTY_HASH was here
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rom-support-2.0.0/lib/rom/support/constants.rb:4: warning: already initialized constant ROM::EMPTY_ARRAY
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/dry-core-0.2.3/lib/dry/core/constants.rb:52: warning: previous definition of EMPTY_ARRAY was here
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rom-support-2.0.0/lib/rom/support/constants.rb:5: warning: already initialized constant ROM::EMPTY_STRING
/usr/local/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/dry-core-0.2.3/lib/dry/core/constants.rb:52: warning: previous definition of EMPTY_STRING was here
Loading development environment (Rails 5.0.1)
irb(main):001:0>

Rom Initializer config/initializers/rom.rb

ROM::Rails::Railtie.configure do |config|
  config.gateways[:default] = [
    :sql,
    ENV.fetch('DATABASE_URL'),
    not_inferrable_relations: [:schema_migrations]
  ]
end

Incase it's relevant config/initializers/rom_monkey.rb

module ROM
  module Rails
    class Railtie < ::Rails::Railtie
      alias_method :create_container!, :create_container
      def create_container
        begin
          create_container!
        rescue => e
          puts "Container failed to initialize because of #{e.inspect}"
          puts "This message comes from the monkey patch in #{__FILE__}, if you are using rake, then this is fine"
        end
      end
    end
  end
end

Environment:

ruby: v2.3.3p222
rails: v5.0.1
rom: v3.0.0.rc1
rom-rails: v0.9.0.beta1
rom-repository: v1.0.0.rc1
rom-sql: v1.0.0.rc1
sequel: v4.42.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.