123456789_123456789_123456789_123456789_123456789_

Module: ActiveStorage::Reflection::ReflectionExtension

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activestorage/lib/active_storage/reflection.rb

Instance Method Summary

Instance Method Details

#add_attachment_reflection(model, name, reflection)

[ GitHub ]

  
# File 'activestorage/lib/active_storage/reflection.rb', line 32

def add_attachment_reflection(model, name, reflection)
  model.attachment_reflections = model.attachment_reflections.merge(name.to_s => reflection)
end

#reflection_class_for(macro) (private)

[ GitHub ]

  
# File 'activestorage/lib/active_storage/reflection.rb', line 37

def reflection_class_for(macro)
  case macro
  when :has_one_attached
    HasOneAttachedReflection
  when :has_many_attached
    HasManyAttachedReflection
  else
    super
  end
end