<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yoshi-13</author_name>
  <author_url>https://blog.hatena.ne.jp/yoshi-13/</author_url>
  <blog_title>なんでや。。</blog_title>
  <blog_url>https://fwl.hateblo.jp/</blog_url>
  <categories>
    <anon>active record</anon>
  </categories>
  <description>max_salaryによってjob_titleのバリデーションを変えたいなあと思った場合、validatesの記述自体を分けて↓こう書けばよい。 class Job &lt; ActiveRecord::Base self.primary_key = :job_id validates :job_title, length: {maximum: 5, if: -&gt;{max_salary &lt;= 1000}} validates :job_title, length: {maximum: 10, if: -&gt;{max_salary &gt; 1000}} end j = Job.new(job_title: …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffwl.hateblo.jp%2Fentry%2F2013%2F06%2F22%2F013933&quot; title=&quot;同一項目に同一バリデータによるバリデーションを複数種書きたいんです - なんでや。。&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-06-22 01:39:33</published>
  <title>同一項目に同一バリデータによるバリデーションを複数種書きたいんです</title>
  <type>rich</type>
  <url>https://fwl.hateblo.jp/entry/2013/06/22/013933</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
