class Foo has_many :bazs has_many :bars, through: :bazs end class Baz belongs_to :foo has_many :bars end class Bar default_scope -> { order('created_at DESC') } belongs_to :baz end # foo.bars.update_all attribute: 'new_value'