LoginSignup
0
0

More than 1 year has passed since last update.

インターン中、不採用になった書き方集

Posted at

不採用になった書き方を追記していきます。

ruby

複数テーブルの値を一気に引っ張ってくる

不採用
status_count = Event.joins(possible_dates: :schedule_answers).select("events.*, possible_dates.*, schedule_answers.*").where(id: @set_event.id).group(:status).size
採用
render json: @set_event.adjust_show_json

別記事で紹介してる小技のやつを使って、メソッドをモデルに実装した。
不採用になったやつは可読性も低いし、めっちゃメソッド使ってるから処理速度的にもきついかも(わからんけど)。

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