-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marketplace
: Sprout model for OrderNotificationMethod
- #1511 OK this is awkwardly named, but it is the first tiny step towards allowing us to manage multiple order notification emails without the silly comma separated value.
- Loading branch information
Showing
5 changed files
with
36 additions
and
2 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,12 @@ | ||
# frozen_string_literal: true | ||
|
||
class Marketplace | ||
class OrderNotificationMethod < Record | ||
self.table_name = :marketplace_order_notification_methods | ||
location(parent: :marketplace) | ||
belongs_to :marketplace, inverse_of: :order_notification_methods | ||
|
||
has_encrypted :contact_location | ||
validates :contact_location, presence: true | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
db/migrate/20230615002110_add_marketplace_order_notification_methods.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 AddMarketplaceOrderNotificationMethods < ActiveRecord::Migration[7.0] | ||
def change | ||
create_table :marketplace_order_notification_methods, id: :uuid do |t| | ||
t.references :marketplace, type: :uuid, foreign_key: {to_table: :furnitures} | ||
t.string :contact_method, default: :email, null: false | ||
t.string :contact_location_ciphertext, 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