-
-
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.
✨🥔
Marketplace
: Product
s have TaxRate
s
- #1137 There's a bit of low-hanging 🌸, but I don't want to block on them. In particular: - It would be nice if we had a well-styled `Component` or partial for the `collection_check_boxes` form helper, since right now the `input[type="checkbox"]` and the `label` for each option are stacked on top of each other. Nasteh! - There's probably a way to show the tax rate amount with a humanized percentage when selecting options, but I didn't want to figure it out
- Loading branch information
Showing
11 changed files
with
55 additions
and
9 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
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,8 @@ | ||
class Marketplace | ||
class ProductTaxRate < Record | ||
self.table_name = :marketplace_product_tax_rates | ||
|
||
belongs_to :product, inverse_of: :product_tax_rates | ||
belongs_to :tax_rate, inverse_of: :product_tax_rates | ||
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,4 @@ | ||
<div> | ||
<%= form.label attribute %> | ||
<%= form.collection_check_boxes attribute, collection, value_method, text_method %> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
db/migrate/20230307031329_create_marketplace_product_tax_rates.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,11 @@ | ||
class CreateMarketplaceProductTaxRates < ActiveRecord::Migration[7.0] | ||
def change | ||
remove_reference :marketplace_products, :tax_rate | ||
|
||
create_table :marketplace_product_tax_rates, id: :uuid do |t| | ||
t.references :tax_rate, type: :uuid, foreign_key: {to_table: :marketplace_tax_rates} | ||
t.references :product, type: :uuid, foreign_key: {to_table: :marketplace_products} | ||
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