Skip to content

Commit

Permalink
add abi model
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Jul 5, 2018
1 parent 2687d29 commit eb47751
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/models/abi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Abi < ApplicationRecord
validates :address, presence: true
end
11 changes: 11 additions & 0 deletions db/migrate/20180705032658_create_abis.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateAbis < ActiveRecord::Migration[5.2]
def change
create_table :abis do |t|
t.string :address
t.integer :block_number
t.text :value

t.timestamps
end
end
end
10 changes: 9 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2018_07_04_092420) do
ActiveRecord::Schema.define(version: 2018_07_05_032658) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "abis", force: :cascade do |t|
t.string "address"
t.integer "block_number"
t.text "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "balances", force: :cascade do |t|
t.string "address"
t.integer "height"
Expand Down
7 changes: 7 additions & 0 deletions test/models/abi_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class AbiTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit eb47751

Please sign in to comment.