Skip to content

Commit

Permalink
기능 : 베오런 / Order Info에 ordered_at추가, 기존 alias제거 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
june20516 authored Jul 3, 2020
1 parent ad844c3 commit 697bf30
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/models/order_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class OrderInfo < NationRecord

delegate :order_status, to: :cart
# alias_attribute :status, :order_status
alias_attribute :ordered_at, :created_at
delegate :delivery_amount, to: :ship_info, allow_nil: true
delegate :amount, to: :payment, allow_nil: true
delegate :pay_method, to: :payment, allow_nil: true
Expand Down
11 changes: 11 additions & 0 deletions db/data/20200624093947_set_ordered_at_to_order_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class SetOrderedAtToOrderInfo < ActiveRecord::Migration[6.0]
def up
ApplicationRecord.country_context_with 'global' do
OrderInfo.update_all('ordered_at=created_at')
end
end

def down
raise ActiveRecord::IrreversibleMigration
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddColumnOrderedAtToOrderInfo < ActiveRecord::Migration[6.0]
def change
add_column :order_infos, :ordered_at, :datetime
end
end

0 comments on commit 697bf30

Please sign in to comment.