タグ

2014年8月4日のブックマーク (2件)

  • [Rails] STI(Single Table Inheritance)でコントローラも一つに纏める | DevelopersIO

    Rails で STI(Single Table Inheritance)を使った時の、コントローラの実装をどうするか?という事について書いてみたいと思います。 STI(単一テーブル継承)とは オブジェクト指向の基概念として、あるクラスを元にサブクラスを定義する継承があります。 この継承は、プログラミング言語ですとと予め機能が提供されていることが多いですが、 RDB ですとテーブル構成によって表現する場合があります。 *1 今回使う STI は、一つのテーブル内に継承関係にあるクラスのカラムを全て持ってしまう方法です。 例として Player クラスを継承した Footballer クラスと Cricketer クラスがあるとします。 親クラスに共通のプロパティ、子クラスがそれぞれのプロパティを持っていますが、これを STI で表現すると以下になります。 テーブルのレコードがどちらの型に

    [Rails] STI(Single Table Inheritance)でコントローラも一つに纏める | DevelopersIO
  • jq

    jq is a lightweight and flexible command-line JSON processor. jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text. jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, scp it to a far away machine of the same type, and expect

    toshihiko150
    toshihiko150 2014/08/04
    コマンドラインJSON整形ツール