LoginSignup
1
0

More than 5 years have passed since last update.

[180728]Gitlab の Merge Request から学ぶ

Last updated at Posted at 2018-07-28

今日のは難しい...

Resolve "Making instance-wide data tools more accessible"

instance statistics っている namespace を作って、統計情報をそっちに移動。
そこに対して権限を付けて見れる人を調整してる。

もともとは Admin の下にあったので、admin only だったんだと思う。

それを instance_statistics_visibility_private っていうのを boolean でもって他のユーザーにも表示するのかをコントロールしてる感じ。

Stop building Route rows on the fly

This MR ensures that all existing projects and namespaces have a route, and removes the code for dynamically generating routes.

存在しているすべての Project と Namespace は route を持っているので、動的に作っていた route を削除してるってことだと思う。

この規模のリポジトリだからだとは思うけど、migration ファイルに class とか定義して up , down してるのは初めて見た。

こんな感じで書いてあるけど、なんでこんな書き方をしているのか...

既存テーブルをいじりたいけど、 Application 内の model とかのコードに影響を与えないようにこの書き方にしてるのか?

今の知識では理解できないので、一応メモだけ!

class GenerateMissingRoutes < ActiveRecord::Migration

  ...

  class User < ActiveRecord::Base
    self.table_name = 'users'
  end
end
1
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
1
0