Skip to content

Rails4で1件だけのデータを探す場合 #72

Description

@ohta-rh
#非推奨
hoge = Hoge.where(hoge: "hoge").first
=> nil  or obj
#推奨
hoge = Hoge.finb_by(hoge: "hoge")
=> nil or obj

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions