Skip to content

Commit 0275e31

Browse files
committed
Add desc column to models
1 parent 1d4ede4 commit 0275e31

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

app/models/recipe.rb

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# created_at :datetime not null
1010
# updated_at :datetime not null
1111
# origin_id :integer
12+
# desc :string
1213
#
1314

1415
class Recipe < ApplicationRecord

app/models/step.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# == Schema Information
22
#
3+
# Table name: steps
4+
#
35
# id :bigint(8) not null, primary key
46
# step_ingredient_id :integer
57
# recipe_id :integer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddDescColumnToRecipe < ActiveRecord::Migration[5.2]
2+
def change
3+
add_column :recipes, :desc, :string
4+
end
5+
end

db/schema.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 2018_09_12_062302) do
13+
ActiveRecord::Schema.define(version: 2018_11_10_141418) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"
@@ -35,6 +35,7 @@
3535
t.datetime "created_at", null: false
3636
t.datetime "updated_at", null: false
3737
t.integer "origin_id"
38+
t.string "desc"
3839
end
3940

4041
create_table "steps", force: :cascade do |t|

spec/models/recipe_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# created_at :datetime not null
1010
# updated_at :datetime not null
1111
# origin_id :integer
12+
# desc :string
1213
#
1314

1415
require 'rails_helper'

0 commit comments

Comments
 (0)