rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

dry-types 0.13.0 breaks how rom-relations uses relations #494

Closed joelvh closed 6 years ago

joelvh commented 6 years ago

Got errors with dry-types 0.13.0 with map_with calls on relations in repositories.

Locking in dry-types 0.12.2 fixes this.

An error occurred while loading ./spec/rom/env_spec.rb.
Failure/Error: require 'rom-repository'
NameError:
  undefined method `map_with' for class `ROM::Relation::Curried'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:26:in `<class:Curried>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:19:in `<class:Relation>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:10:in `<module:ROM>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation/curried.rb:9:in `<top (required)>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation.rb:16:in `require'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/relation.rb:16:in `<top (required)>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/core.rb:11:in `require'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-core-4.2.0/lib/rom/core.rb:11:in `<top (required)>'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-repository-2.0.2/lib/rom-repository.rb:1:in `require'
# /home/travis/.rvm/gems/ruby-2.5.1/gems/rom-repository-2.0.2/lib/rom-repository.rb:1:in `<top (required)>'
# ./lib/ruby_event_store/rom.rb:3:in `require'
# ./lib/ruby_event_store/rom.rb:3:in `<top (required)>'
# ./spec/spec_helper.rb:1:in `require'
# ./spec/spec_helper.rb:1:in `<top (required)>'
# ./spec/rom/env_spec.rb:1:in `require'
# ./spec/rom/env_spec.rb:1:in `<top (required)>'
flash-gordon commented 6 years ago

rom 4 isn't compatible with the recent dry-types/dry-struct releases, there's a branch which nearly works https://github.com/rom-rb/rom/pull/478 but atm this has a breaking change

solnic commented 6 years ago

we gotta push a new release with fixed version spec for dry-types :/

flash-gordon commented 6 years ago

@solnic we first need to discuss the plan in https://github.com/rom-rb/rom/pull/478#issuecomment-384019000 If we fix the spec it will be a breaking change so we can't do it. Instead, we can mimic the current behavior in 4.0 but change it in 5.0, or leave it as it is (inconsistent with current dry-struct behavior).

solnic commented 6 years ago

@flash-gordon we can't push a 4.x release that also upgrades dry-types/struct, because this would potentially break rom structs and/or custom types that people may have. So our only option, for now, is to push a 4.x release with dry-types/struct version specs updated to dry-types ~> 0.12.2 and dry-struct ~> 0.4.0.

flash-gordon commented 6 years ago

4.2.1 pushed to rubygems