Skip to content

Commit

Permalink
Models
Browse files Browse the repository at this point in the history
  • Loading branch information
ztratify committed Nov 30, 2020
1 parent ab7f090 commit c6e84df
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/link.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Link < ApplicationRecord
end
10 changes: 10 additions & 0 deletions db/migrate/20201130011635_create_links.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateLinks < ActiveRecord::Migration[6.0]
def change
create_table :links do |t|
t.string :url
t.text :description

t.timestamps
end
end
end
22 changes: 22 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_11_30_011635) do

create_table "links", force: :cascade do |t|
t.string "url"
t.text "description"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

end
9 changes: 9 additions & 0 deletions test/fixtures/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
url: MyString
description: MyText

two:
url: MyString
description: MyText
7 changes: 7 additions & 0 deletions test/models/link_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

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

0 comments on commit c6e84df

Please sign in to comment.