<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tapira</author_name>
  <author_url>https://blog.hatena.ne.jp/tapira/</author_url>
  <blog_title>カメニッキ</blog_title>
  <blog_url>https://tapira.hatenablog.com/</blog_url>
  <categories>
    <anon>old</anon>
  </categories>
  <description>Railsで普段しようしているHoge.find(id)みたいな要領で、コネクションとかあまり意識することなくデータベースを使用出来たら便利ですよね。 それに後悔しているWebアプリと連携したバッチ処理などを作成する際もやりやすいです。やり方は簡単で、railsプロジェクトのscriptフォルダ以下に普段通りhoge.rbとファイルを作成します。あとは好きにコントローラへ書く時と同じ用に処理書いていくだけ。ActiveRecord好きに使えます。 共有定数や関数も。実行時は rails runner script/hoge.rb となります。注意が必要なのが、デフォルトだとdevelopmen…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftapira.hatenablog.com%2Fentry%2F20120419%2F1334809611&quot; title=&quot;railsの機能を使えるスクリプトを実行する方法 - カメニッキ&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>2012-04-19 13:26:51</published>
  <title>railsの機能を使えるスクリプトを実行する方法</title>
  <type>rich</type>
  <url>https://tapira.hatenablog.com/entry/20120419/1334809611</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
