-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Auto-register namespaces Oaken now auto-registers namespaced models as well. So in addition to `accounts` => `Account`, we can also auto-register partial and fully nested namespaces, in this order: ``` account_jobs => AccountJob | Account::Job account_job_tasks => AccountJobTask | Account::JobTask | Account::Job::Task ``` If you have classes that don't follow this naming convention, you must call `register` manually. * Add a deeply-nested model to aid test coverage * Add a partial namespace test
- Loading branch information
Showing
7 changed files
with
70 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Menu::Item::Detail < ApplicationRecord | ||
belongs_to :menu_item, class_name: "Menu::Item" | ||
end |
10 changes: 10 additions & 0 deletions
10
test/dummy/db/migrate/20240630172609_create_menu_item_details.rb
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 @@ | ||
class CreateMenuItemDetails < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :menu_item_details do |t| | ||
t.references :menu_item, null: false, foreign_key: true | ||
t.text :description, null: false | ||
|
||
t.timestamps | ||
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
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
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