記事へのコメント1

    • 注目コメント
    • 新着コメント
    kent-where-the-light-is
    kent-where-the-light-is “You can get the integer values for an enum from the class the enum is on: Model.sale_infos # Pluralized version of the enum attribute name That returns a hash like: { "plan_1" => 1, "plan_2" => 2 ... } You can then use the sale_info value from an instance of the Model class to access the integer

    2016/10/17 リンク

    その他

    注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

    アプリのスクリーンショット
    いまの話題をアプリでチェック!
    • バナー広告なし
    • ミュート機能あり
    • ダークモード搭載
    アプリをダウンロード

    関連記事

    How get integer value from a enum in Rails?

    I have a enum in my Model that corresponds to column in the database. The enum looks like: enum s...

    ブックマークしたユーザー

    • fuyu772019/11/07 fuyu77
    • kent-where-the-light-is2016/10/17 kent-where-the-light-is
    すべてのユーザーの
    詳細を表示します

    同じサイトの新着

    同じサイトの新着をもっと読む

    いま人気の記事

    いま人気の記事をもっと読む

    いま人気の記事 - テクノロジー

    いま人気の記事 - テクノロジーをもっと読む

    新着記事 - テクノロジー

    新着記事 - テクノロジーをもっと読む

    同時期にブックマークされた記事