Closed julienXX closed 7 years ago
@julienXX the namespace:
option should be passed a String
and not a class. e.g.
configuration.auto_registration(File.join(__dir__, 'library_api_client'), namespace: 'LibraryApiClient')
(fwiw this results in the same error on CRuby and JRuby)
@julienXX btw I had to make various other fixes (missing requires, removal of Relations
, Mappers
) to the example project you posted. See here:
https://github.com/myabc/jruby_rom_repro/commit/18998eaa53bd0fdfc3ffde0cabea7ca017830c43
Aah! Thanks for help @myabc
I think you just want to add namespace: true
because that will make auto-registration assume that the root dir of components is the namespace name. If you pass a namespace name explicitly (which must be a string as Alex mentioned) then auto-registration will load files from the path that you provided but it will not assume Relations
and Mappers
namespaces, so in this case LibraryApiClient::Books
would be the expected relation class when you set namespace: "LibraryApiClient"
.
Anyhow, just set namespace: true
and it'll work (I checked).
Thanks a lot @myabc & @solnic :)
Hello I'm having an issue with a lib of mine under JRuby.
It seems that it's related to ROM when doing an
auto_registation
on a ROM::Configuration the klass_name inlib/ruby/gems/shared/gems/rom-2.0.2/lib/rom/setup/auto_registration.rb
is nil for arelations
entity.Here is a stripped down version of the lib to repro the issue https://github.com/julienXX/jruby_rom_repro