Skip to content

Commit

Permalink
Adding th review model
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmounir committed Mar 4, 2017
1 parent eb6bf6a commit 5f3029d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/review.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Review < ApplicationRecord
end
10 changes: 10 additions & 0 deletions db/migrate/20170304100335_create_reviews.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateReviews < ActiveRecord::Migration[5.0]
def change
create_table :reviews do |t|
t.string :message
t.decimal :rating

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

ActiveRecord::Schema.define(version: 20170304100034) do
ActiveRecord::Schema.define(version: 20170304100335) do

create_table "hotels", force: :cascade do |t|
t.string "website"
Expand All @@ -21,6 +21,13 @@
t.datetime "updated_at", null: false
end

create_table "reviews", force: :cascade do |t|
t.string "message"
t.decimal "rating"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "users", force: :cascade do |t|
t.string "first_name"
t.string "last_name"
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/reviews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
message: MyString
rating: 9.99

two:
message: MyString
rating: 9.99
7 changes: 7 additions & 0 deletions test/models/review_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

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

0 comments on commit 5f3029d

Please sign in to comment.