parent
41095dc0e3
commit
1a8d2c3e96
@ -0,0 +1,2 @@
|
|||||||
|
class ReviewsController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module ReviewsHelper
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class Review < ApplicationRecord
|
||||||
|
belongs_to :movie
|
||||||
|
end
|
@ -0,0 +1,12 @@
|
|||||||
|
class CreateReviews < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
create_table :reviews do |t|
|
||||||
|
t.string :name
|
||||||
|
t.integer :stars
|
||||||
|
t.text :comment
|
||||||
|
t.references :movie, null: false, foreign_key: true
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class ReviewsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
name: MyString
|
||||||
|
stars: 1
|
||||||
|
comment: MyText
|
||||||
|
movie: one
|
||||||
|
|
||||||
|
two:
|
||||||
|
name: MyString
|
||||||
|
stars: 1
|
||||||
|
comment: MyText
|
||||||
|
movie: two
|
@ -0,0 +1,7 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class ReviewTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
Loading…
Reference in new issue