Skip to content

Instantly share code, notes, and snippets.

@frostmark
Created August 16, 2017 20:13
Show Gist options
  • Save frostmark/31fafb5834c9026f06fb7d35f4c89f7c to your computer and use it in GitHub Desktop.
Save frostmark/31fafb5834c9026f06fb7d35f4c89f7c to your computer and use it in GitHub Desktop.

Revisions

  1. frostmark created this gist Aug 16, 2017.
    8 changes: 8 additions & 0 deletions answer.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    class Answer < ApplicationRecord
    include Policy

    belongs_to :question
    belongs_to :user

    validates :body, presence: true
    end