Rails Advent Calendar 2020の3日目です。 時間がないのでとりいそぎ3つだけ。 enum state: {active: 0, inactive: 1}とかした時に、typecast前の0とか1を取りたい ActiveRecord::Enumってstate: {active: 0, inactive: 1}とかした時に、typecast前の0とか1を取る場合、read_attribute_before_type_castを使うしかないのか?— アルフォートおじさん (@joker1007) October 21, 2020 github.com belongs_to :author, class_name: 'User'したときにleft_joins(:author).where("author.id": nil)とか書きたい これすると、joins(:author