From 98176f839d221ce6b5e114d57a4de9ec8fe09cf0 Mon Sep 17 00:00:00 2001 From: wyx <414722560@qq.com> Date: Fri, 24 Jul 2020 17:49:07 +0800 Subject: [PATCH] create coinchange --- app/models/coin_change.rb | 2 ++ db/migrate/20200724094729_create_coin_changes.rb | 13 +++++++++++++ spec/models/coin_change_spec.rb | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 app/models/coin_change.rb create mode 100644 db/migrate/20200724094729_create_coin_changes.rb create mode 100644 spec/models/coin_change_spec.rb diff --git a/app/models/coin_change.rb b/app/models/coin_change.rb new file mode 100644 index 000000000..9722a1330 --- /dev/null +++ b/app/models/coin_change.rb @@ -0,0 +1,2 @@ +class CoinChange < ApplicationRecord +end diff --git a/db/migrate/20200724094729_create_coin_changes.rb b/db/migrate/20200724094729_create_coin_changes.rb new file mode 100644 index 000000000..6999312b3 --- /dev/null +++ b/db/migrate/20200724094729_create_coin_changes.rb @@ -0,0 +1,13 @@ +class CreateCoinChanges < ActiveRecord::Migration[5.2] + def change + create_table :coin_changes do |t| + t.integer :amount + t.string :description + t.string :reason + t.integer :to_wallet_id + t.integer :from_wallet_id + + t.timestamps + end + end +end diff --git a/spec/models/coin_change_spec.rb b/spec/models/coin_change_spec.rb new file mode 100644 index 000000000..313ecf1f9 --- /dev/null +++ b/spec/models/coin_change_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe CoinChange, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end