<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hachinobu</author_name>
  <author_url>https://blog.hatena.ne.jp/hachinobu/</author_url>
  <blog_title>hachinoBlog</blog_title>
  <blog_url>https://hachinobu.hateblo.jp/</blog_url>
  <categories>
    <anon>Ruby on Rails</anon>
  </categories>
  <description>Rubyでバッチ処理を書いているのだがDBへの接続で苦戦した。 RailsのActiveRecordのように簡単に出来るものだと思っていたのだがそうもいかず.. しかしrails runnerを使えばRails同様のアクセス方法でいけるという事を知りました。 まずは準備としてconfig/application.rbに config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += Dir[&quot;#{config.root}/lib/**/&quot;]次にrailsプロジェクトのlib/tasks配下にバッチファイル(sam…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhachinobu.hateblo.jp%2Fentry%2F20130703%2F1372851847&quot; title=&quot;Rubyのバッチ処理でActiveRecordを使ってモデルクラス経由でのDB接続方法 - hachinoBlog&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-07-03 20:44:07</published>
  <title>Rubyのバッチ処理でActiveRecordを使ってモデルクラス経由でのDB接続方法</title>
  <type>rich</type>
  <url>https://hachinobu.hateblo.jp/entry/20130703/1372851847</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
