タケユー・ウェブ日報

Ruby on Rails や Flutter といったWeb・モバイルアプリ技術を武器にお客様のビジネス立ち上げを支援する、タケユー・ウェブ株式会社の技術ブログです。

2020-03-27から1日間の記事一覧

Rais.env.development? みたいな文字列がその値か?真偽値をとれるやつを使いたい

こういうのです。 Rails.env.production? # Rails.env == "production" と同じ ActiveSupport::StringInquirer クラスを使います。 role = ActiveSupport::StringInquirer.new("admin") role.admin? #=> true ActiveSupport::StringInquirer activesupport/l…