You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Railsでの区分値の扱いについて考える の続きです。 区分値情報をDBに保存しておくか、アプリにのみ保存しておくのか、悩ましい所です。 DBに区分値を保存しておくと、ActiveRecordなオブジェクトになって扱いやすいという利点があります。 しかし、DBにもアプリにも区分値の情報(ProductTypeの1はLADIESであるといった情報)を持つ事になり、二重管理の状態となる可能性があります。 一カ所変えたら対になるもう一方の修正もしないといけない、という状態は、システム保守の観点からはよろしくありません。 私は過去にアプリ側に区分値情報を更新したのに、DB側に区分値情報を入れ忘れていた! という失敗を体験しました。 区分値情報をアプリ、DB両方に持ってるのはやめたい。でもActiveRecordライクなオブジェクトで区分値を扱いたい。 ActiveRecordのデータソースがcla
Activerecord-Import is a library for bulk inserting data using ActiveRecord. One of its major features is following activerecord associations and generating the minimal number of SQL insert statements required, avoiding the N+1 insert problem. An example probably explains it best. Say you had a schema like this: Publishers have Books Books have Reviews and you wanted to bulk insert 100 new publish
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く