Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_registration('/path/to/lib') assumptions #195

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/learn/advanced/explicit-setup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ <h4>Namespaces inferred from directory structure</h4>
<p>By default, auto-registration assumes that the directory structure reflects your module/class
organization, for example:</p>
<pre class="syntax ruby"><code><span class="c1"># lib/relations/users.rb</span>
<span class="k">module</span> <span class="nn">Relations</span>
<span class="k">class</span> <span class="nc">Users</span> <span class="o">&lt;</span> <span class="no">ROM</span><span class="o">::</span><span class="no">Relation</span><span class="p">[</span><span class="ss">:sql</span><span class="p">]</span>
<span class="n">schema</span><span class="p">(</span><span class="ss">infer: </span><span class="kp">true</span><span class="p">)</span>
<span class="k">module</span> <span class="nn">Lib</span>
<span class="k">module</span> <span class="nn">Relations</span>
<span class="k">class</span> <span class="nc">Users</span> <span class="o">&lt;</span> <span class="no">ROM</span><span class="o">::</span><span class="no">Relation</span><span class="p">[</span><span class="ss">:sql</span><span class="p">]</span>
<span class="n">schema</span><span class="p">(</span><span class="ss">infer: </span><span class="kp">true</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>

Expand Down
8 changes: 5 additions & 3 deletions source/3.0/learn/advanced/explicit-setup.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ organization, for example:

``` ruby
# lib/relations/users.rb
module Relations
class Users < ROM::Relation[:sql]
schema(infer: true)
module Lib
module Relations
class Users < ROM::Relation[:sql]
schema(infer: true)
end
end
end

Expand Down