diff options
author | George Claghorn <george@basecamp.com> | 2018-07-07 17:04:47 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-07 17:09:31 -0400 |
commit | 03afddd2eb0fb56716a8a9caa4456807706ce791 (patch) | |
tree | 8382eba357d69f6d2acf776582c2113ed60c71c9 /activestorage/lib/active_storage/attached/changes/create_many.rb | |
parent | 13c66d4626707fcc6c67ec6b197bb1e0be317b84 (diff) | |
download | rails-03afddd2eb0fb56716a8a9caa4456807706ce791.tar.gz rails-03afddd2eb0fb56716a8a9caa4456807706ce791.tar.bz2 rails-03afddd2eb0fb56716a8a9caa4456807706ce791.zip |
Fix that models can clobber each others' attachment reflections
Consider the following model definitions:
class User < ApplicationRecord
has_one_attached :avatar
end
class Group < ApplicationRecord
has_one_attached :avatar
end
If you attempt to reflect on the User model's avatar attachment via User.reflect_on_attachment, you could receive a reflection for the Group model's avatar attachment. Fix this by ensuring that each model class uses its own Hash object to track attachment reflections.
Diffstat (limited to 'activestorage/lib/active_storage/attached/changes/create_many.rb')
0 files changed, 0 insertions, 0 deletions