Goで DataMapperじゃなく、ActiveRecordライクにDB操作したいと思ってつくってみました。 go/parserとgo/astでソースを解析、個々の構造体ごとにARなコードを生成します。 argen ActiveRecord** Gen**eratorでargenです。 クイックスタート テーブルを表す構造体に+ARアノテーションをマークします。
お仕事で今、Railsアプリケーションで複数DATABASEのサービスを開発していて、いろいろと悩むことが増えてきたので、勉強を兼ねてネットにあったドキュメントを収集していくつか読み込んでみました。俺得記事です。あともしよい資料とかあればぜひコメントください! 🎳 クックパッドにおける最近のActive Record運用事情クックパッドにおける最近のActiveRecord運用事情 - クックパッド開発者ブログ マイグレーションは使っていない1,500以上のモデルがあり、複数人が作業しているため、互いの作業をブロックしないためにもマイングレーションでの運用は行っていない。 スキーマ管理ツール: Ridgepolewinebarrel/ridgepole - GitHubスキーマ管理ツール。テーブル定義ファイルにカラムを書き足すと、実際のDBのテーブル定義と比較して、 差分があればそのぶん
はじめに Ruby on Railsの2年半ぶりのメジャーバージョンアップである3.0の正式リリースがいよいよ間近に迫ってきました。 Rails 3は、アプリケーション・レベルではRails 2.3との互換性をなるべく保ちながらも、メジャーバージョンアップだけあってフレームワーク自体は隅々にまで徹底的なリファクタリングが施されて更なる洗練を遂げています。結果として、Rails 3では融通の効かないフルスタック構造を捨ててすっきりとしたモジュール独立性が実現されているのですが、この際に、Merbとの合併の影響もあってか、いくつかの新たな外部ライブラリに依存する形になっているのも興味深いところです。 そこで本稿では、あえてRails 3そのものではなく、このRails 3の大改造の舞台裏を支える裏方さんにスポットライトを当ててみたいと思います。 Arelによってパラダイムが大きく変わったAct
思いのほか前回のRailsプチ・デザインパターンの紹介に反応があったので、こういう小ネタも出していったほうがいいのかな、ということで第二弾。 ソーシャル系アプリだと、ユーザとユーザを関連付ける多対多のモデルがたくさんでてきます。たとえば、一般的なところではフォローとかブロックとか足あととか。さらにデーティングサイトになると、ウィンクだったり、Secret admirer(こっそりlikeするけど両思いだったらおめでとうって通知がくるってやつ)だったり、いろいろなモデルがこのパターンにあてはまります。 この場合、「AがBをフォローしている」「BがAをフォローしている」「AとBがお互いにフォローしている」という3つの状態があるわけですが、相互フォローの状態は「AがBをフォローし、かつBがAをフォローしている」と読み替えてSQLでも記述可能なので、以下ではシンプルに単方向のグラフで全てを扱うもの
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く