<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>J_ogawa</author_name>
  <author_url>https://blog.hatena.ne.jp/J_ogawa/</author_url>
  <blog_title>エンジニアリングにはほど遠い</blog_title>
  <blog_url>https://j-ogawa.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>Ruby</anon>
  </categories>
  <description>割と汎用的かと思ったので載せてみようかと。 orの引数にnilがきたらそのままなのがミソ。 class ActiveRecord::Base def self.search_with_multi(columns:, keywords:) where(columns_keywords_cond(columns, keywords)) end def self.columns_keywords_cond(columns, keywords) columns .product(keywords) .reduce(nil) do |cond, (column, keyword)| arel_table…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fj-ogawa.hatenadiary.jp%2Fentry%2F2016%2F09%2F07%2F025020&quot; title=&quot;ActiveRecordで複数カラムに対し複数キーワードで探す - エンジニアリングにはほど遠い&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>2016-09-07 02:50:20</published>
  <title>ActiveRecordで複数カラムに対し複数キーワードで探す</title>
  <type>rich</type>
  <url>https://j-ogawa.hatenadiary.jp/entry/2016/09/07/025020</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
