Scopeが便利 カスタム用のクエリを作成する時にはscopeが便利 Class hoge < Application:Record . . . belongs_to :user scope :recent, -> {order(created_at: :desc)} . . . ①hoge = Hoge.recent ②hoge = Hoge.recent.first ③hoge = Hoge.recent.last ①全…
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。