LoginSignup
0
0

More than 1 year has passed since last update.

RailsのActiveRecordのデータタイプでJSONが便利な件

Last updated at Posted at 2019-08-05

RailsのデータタイプでJSONが便利な件

RailsのActive Recordではstringやintegerと並んでjsonを指定することができます。
DBとしては文字列として保存されるパターンが多いですが、Active Record側ではすでにハッシュとしてパース済みになり、任意のkey valueペアが保存できるため柔軟な構成になります。

パフォーマンスや堅牢性は落ちますが、高速な開発が求められる際には使用してみてはいかがでしょうか。

公式ドキュメントはこちらです。
https://edgeguides.rubyonrails.org/active_record_postgresql.html#json-and-jsonb
この記事が参考になれば幸いです。

終わりに

私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0