-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ROM gem dependencies and relation class (#2)
Bring in rom and rom-sql gem dependencies, and create a Hanami::DB::Relation class, which defaults to using the :sql adapter.
- Loading branch information
Showing
4 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rom" | ||
require "rom-sql" | ||
require "zeitwerk" | ||
|
||
module Hanami | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
module Hanami | ||
module DB | ||
# @api public | ||
# @since 2.2.0 | ||
class Relation < ROM::Relation[:sql] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Hanami::DB::Relation do | ||
subject(:relation) { Class.new(described_class) } | ||
|
||
it "defaults to the :sql adapter" do | ||
expect(relation.adapter).to eq :sql | ||
end | ||
end |