Commit 669ae57d by ivan Lan

Change the address of order into a json colum

parent a1bf8cc1
...@@ -51,7 +51,7 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1] ...@@ -51,7 +51,7 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
def create_order def create_order
create_table :shotengai_orders do |t| create_table :shotengai_orders do |t|
t.string :seq t.string :seq
t.string :address t.json :address
t.decimal :amount, precision: 9, scale: 2 t.decimal :amount, precision: 9, scale: 2
t.datetime :pay_time t.datetime :pay_time
t.datetime :delivery_time t.datetime :delivery_time
......
...@@ -48,7 +48,6 @@ module Shotengai ...@@ -48,7 +48,6 @@ module Shotengai
end end
before_action :set_resource, except: [:index, :create] before_action :set_resource, except: [:index, :create]
respond_to :json
# TODO: could not catch the exception # TODO: could not catch the exception
respond_to :json respond_to :json
......
...@@ -2,6 +2,7 @@ module Shotengai ...@@ -2,6 +2,7 @@ module Shotengai
class WebError < RuntimeError class WebError < RuntimeError
attr_accessor :message, :code, :status attr_accessor :message, :code, :status
def initialize message, code, status def initialize message, code, status
super()
@message, @code, @status = message, code, status @message, @code, @status = message, code, status
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment