Skip to content

各モデルへバリデーションの追加 #185

@Kunado

Description

@Kunado

追加機能

  • 各モデルにバリデーションを追加しておきたい
    • Railsバリデーションまとめ - Qiita
    • 機能 名前
      値の存在確認 presence
      値の非存在確認 absence
      値の一意性 uniqueness
      数値検証 numericality
      文字列長検証 length
      正規表現フォーマット format
  • なお値を空にしたくない場合はmodelでのpresence指定とDBでのNOT NULL指定のどちらもつけておいたほうが良いらしい。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions