<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>woshidan</author_name>
  <author_url>https://blog.hatena.ne.jp/woshidan/</author_url>
  <blog_title>woshidan's loose leaf</blog_title>
  <blog_url>https://woshidan.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>リファクタリング</anon>
  </categories>
  <description>Railsで開発していると if Rails.env.production? # production環境用の処理 elsif Rails.env.staging? # staging環境用の処理 else # それ以外の環境用の処理 end という風に環境ごとの処理を書いたり、config/environments以下のproduction.rbやstaging.rb, development.rbに config.xxx と各環境用の値を設定して、Rails. configuration.xxxと呼び出すことができます。 しかし、環境ごとに変わる部分が単なる定数値であれば環境変数にして E…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwoshidan.hatenadiary.jp%2Fentry%2F2021%2F02%2F07%2F170504&quot; title=&quot;定数値を環境ごとに分岐したいだけならRails.env.xxx? やconfig/environments以下のファイルに値を書くより環境変数にくくり出した方がよさそう - woshidan&amp;#39;s loose leaf&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>2021-02-07 17:05:04</published>
  <title>定数値を環境ごとに分岐したいだけならRails.env.xxx? やconfig/environments以下のファイルに値を書くより環境変数にくくり出した方がよさそう</title>
  <type>rich</type>
  <url>https://woshidan.hatenadiary.jp/entry/2021/02/07/170504</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
