Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further updates for rails 7.2 #3184

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/avo/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def related_resource

return field.use_resource if field&.use_resource.present?

reflection = @model._reflections[params[:related_name]]
reflection = @model.class.reflections[params[:related_name]]

reflected_model = reflection.klass

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/avo/associations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def order
private

def set_reflection
@reflection = @model._reflections[params[:related_name].to_s]
@reflection = @model.class.reflections[params[:related_name].to_s]
end

def set_attachment_class
Expand All @@ -127,7 +127,7 @@ def attachment_id
end

def reflection_class
reflection = @model._reflections[params[:related_name]]
reflection = @model.class.reflections[params[:related_name]]

klass = reflection.class.name.demodulize.to_s
klass = reflection.through_reflection.class.name.demodulize.to_s if klass == "ThroughReflection"
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/avo/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def create

# This means that the record has been created through another parent record and we need to attach it somehow.
if params[:via_resource_id].present? && params[:via_belongs_to_resource_class].nil?
@reflection = @model._reflections[params[:via_relation]]
@reflection = @model.class.reflections[params[:via_relation]]
# Figure out what kind of association does the record have with the parent record

# Fills in the required infor for belongs_to and has_many
Expand Down
Loading