Skip to content

Commit

Permalink
Use new public API from rom-repository (#16)
Browse files Browse the repository at this point in the history
`Repository#set_relation` in rom-sql was deprecated, as it was a private API. It didn't set anything so the name was confusing. Now there is a newly added `Repository#prepare_relation`, which is properly public. Use this new method and update the rom gem dependencies to ensure this method is present.
  • Loading branch information
flash-gordon authored Jan 10, 2025
1 parent 344a149 commit a26c1ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hanami-db.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
}

spec.required_ruby_version = ">= 3.1"
spec.add_dependency "rom", "~> 5.3"
spec.add_dependency "rom-sql", "~> 3.6", ">= 3.6.4"
spec.add_dependency "rom", "~> 5.4", ">= 5.4.1"
spec.add_dependency "rom-sql", "~> 3.7"
spec.add_dependency "zeitwerk", "~> 2.6"

spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
Expand Down
2 changes: 1 addition & 1 deletion lib/hanami/db/repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(*, **)
# means _every_ repo ends up with an inferred root, many of which will not exist as
# relations. To avoid errors from fetching these non-existent relations, check first before
# setting the root.
@root = set_relation(self.class.root) if set_relation?(self.class.root)
@root = prepare_relation(self.class.root) if set_relation?(self.class.root)
end

private
Expand Down

0 comments on commit a26c1ad

Please sign in to comment.