{"type":"rich","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fopiyotan.hatenablog.com%2Fentry%2Fmodel_validations\" title=\"\u3010Rails\u3011\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u307e\u3068\u3081\u3066\u307f\u308b - \u304a\u3074\u3088\u306e\u6c17\u307e\u3050\u308c\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","blog_title":"\u304a\u3074\u3088\u306e\u6c17\u307e\u3050\u308c\u65e5\u8a18","blog_url":"https://opiyotan.hatenablog.com/","published":"2019-09-24 21:29:22","categories":["Rails","model","\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3"],"description":"\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3059\u308b\u969b\u306b\u5229\u7528\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3067\u3059\u304c\u3001\u6761\u4ef6\u306b\u5fdc\u3058\u3066\u5fc5\u9808\u3060\u3063\u305f\u308a\u5236\u9650\u3057\u305f\u308a\u3059\u308b\u4ed5\u7d44\u307f\u3092\u300c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u300d\u3068\u3044\u3044\u307e\u3059\u3002 Ruby on Rails\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 class Hoge < ApplicationRecord validates :name, presence: true end # validation\u304c\u306a\u3044\u5834\u5408 > hoge = Hoge.new => #<Hoge:0x00007f803eabca78 id: nil, name: \"\", age: 0, gender: \"man\", birthday: Mon, 01 Jan 1900, \u2026","width":"100%","author_url":"https://blog.hatena.ne.jp/opiyotan/","title":"\u3010Rails\u3011\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u307e\u3068\u3081\u3066\u307f\u308b","provider_name":"Hatena Blog","author_name":"opiyotan","image_url":"https://cdn.user.blog.st-hatena.com/default_entry_og_image/110785513/1514221383750427","url":"https://opiyotan.hatenablog.com/entry/model_validations","version":"1.0"}