aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
authorKevin Deisz <kevin.deisz@gmail.com>2018-05-31 21:15:51 -0400
committerKevin Deisz <kevin.deisz@gmail.com>2018-05-31 21:15:51 -0400
commit6c7e6abfaad149da02dbec4e4f2bd62c5d68805f (patch)
tree35ed52dac9696d7eecb0bdeb63e9dfe69f61e19d /activestorage
parentce337d1757fdd01e5f496f741e33275a7440b9ac (diff)
downloadrails-6c7e6abfaad149da02dbec4e4f2bd62c5d68805f.tar.gz
rails-6c7e6abfaad149da02dbec4e4f2bd62c5d68805f.tar.bz2
rails-6c7e6abfaad149da02dbec4e4f2bd62c5d68805f.zip
Ensure reflection_class_for is private
Diffstat (limited to 'activestorage')
-rw-r--r--activestorage/lib/active_storage/reflection.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/activestorage/lib/active_storage/reflection.rb b/activestorage/lib/active_storage/reflection.rb
index 9074b20126..04a1b20882 100644
--- a/activestorage/lib/active_storage/reflection.rb
+++ b/activestorage/lib/active_storage/reflection.rb
@@ -18,21 +18,22 @@ module ActiveStorage
end
end
- module ReflectionExtension
- def reflection_class_for(macro)
- case macro
- when :has_one_attached
- HasOneAttachedReflection
- when :has_many_attached
- HasManyAttachedReflection
- else
- super
- end
- end
-
+ module ReflectionExtension # :nodoc:
def add_attachment_reflection(ar, name, reflection)
ar.attachment_reflections.merge!(name.to_s => reflection)
end
+
+ private
+ def reflection_class_for(macro)
+ case macro
+ when :has_one_attached
+ HasOneAttachedReflection
+ when :has_many_attached
+ HasManyAttachedReflection
+ else
+ super
+ end
+ end
end
module ActiveRecordExtensions