Just tried to upgrade to Rails 4.2. When I'm calling build on a has_many assoziation, all the assoziated records are going to be unrestricted. Think this is potentially dangerous as I'm expecting associations of a protected model are protected.
f = Film.restrict!(User.first).first
f.images.first.protector_subject?
# => true
f.images.build
f.images.first.protector_subject?
# => false <<== should be true
f.images.protector_subject?
# => true
Just tried to upgrade to
Rails 4.2
. When I'm callingbuild
on ahas_many
assoziation, all the assoziated records are going to be unrestricted. Think this is potentially dangerous as I'm expecting associations of a protected model are protected.This is not hapening with
Rails 4.1
.