-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹
Furniture
: Consolidate to Furniture
to prep to drop `FurnitureP…
…lacement` (#1208) * 🧹 `Furniture`: Streamline routing & instantiation - #709 This helps prepare us to rename from `FurniturePlacement` down to `Furniture` by getting rid of some unnecessary fiddly bits. Theoretically, our next step is to inline the `Furniture` namespace into `FurniturePlacement` to make space at the `Furniture` namespace; then rename `FurniturePlacement` to `Furniture`... And then we don't have `Placement` anymore! Just `Furniture`! * `Furniture`: Inline `Furniture` into `FurniturePlacement` This gets us almost all the way to the rename; since we don't have the `Furniture` namespace in the way... * 🧹 `Furniture`: Dynamic registry to get around circular class-load dependency So: ```app/furniture/form.rb class Form < FurniturePlacement end ``` loads ```app/models/furniture_placement.rb class FurniturePlacement REGISTRY = { Form } end ``` Which loads... You guessed it! ```app/furniture/form.rb class Form < FurniturePlacement end ``` Pulling the registry definition out of interpret-time and into runtime fixes that; since the `Form` constant isn't referenced until the `FurniturePlacement.registry` method is accessed.
- Loading branch information
Showing
10 changed files
with
33 additions
and
51 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# @see features/furniture/marketplace.feature.md | ||
class Marketplace | ||
def self.from_placement(placement) | ||
placement.becomes(Marketplace) | ||
end | ||
end | ||
class Marketplace; 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