forked from zinc-collective/convene
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- #1 - zinc-collective#709 - For a #9 to leverage the behavior we described, we need a way to put tobias on the web. zinc-collective#709 are the equivalent of an "App" in the Convene world. - Note: `Gizmo` and `Furniture` are equivalent. We probably should finish zinc-collective#1472 - The migration change makes sure that ahttps://github.com//issues/4 is connected to #1
- Loading branch information
Showing
9 changed files
with
50 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
class Tobias | ||
class Tobias < Furniture | ||
has_many :trusts, inverse_of: :tobias | ||
default_scope { where(furniture_kind: "tobias") } | ||
location(parent: :room) | ||
end | ||
|
||
# TOBIAS is hard to pluralize... Rails presumed TOBIAS was plural, | ||
# So this tells Rails that TOBIAS is the singular form, and that TOBIASes | ||
# is the plural. | ||
ActiveSupport::Inflector.inflections(:en) do |inflect| | ||
inflect.plural(/^(tobias)$/i, '\1\2es') | ||
inflect.singular(/^(tobias)es/i, '\1') | ||
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 @@ | ||
class Tobias | ||
class Record < ApplicationRecord | ||
self.abstract_class = true | ||
|
||
def self.model_name | ||
@_model_name ||= ActiveModel::Name.new(self, ::Tobias) | ||
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 @@ | ||
class Tobias | ||
class Routes | ||
def self.append_routes(router) | ||
router.resources :tobiases, module: "tobias" do | ||
router.resources :trusts | ||
end | ||
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
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,5 @@ | ||
FactoryBot.define do | ||
factory :tobias do | ||
room | ||
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
require_relative "tobias_factory" | ||
|
||
FactoryBot.define do | ||
factory :tobias_trust, class: "Tobias::Trust" do | ||
tobias | ||
end | ||
end |