* create listing endorsement model and write test to validate it * create the classified_listing_endorsements table * create model associations with seed data and test validations * modify test and create more seed date for endorsement * modify the model naming, changed seed data to become radomized and updated the test file * remove unnecessary function
11 lines
338 B
Ruby
11 lines
338 B
Ruby
class CreateListingEndorsements < ActiveRecord::Migration[6.0]
|
|
def change
|
|
create_table :classified_listing_endorsements do |t|
|
|
t.string :content
|
|
t.boolean :approved, default: false
|
|
t.references :classified_listing, foreign_key: true
|
|
t.references :user, foreign_key: true
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|