Skip to content

Commit

Permalink
Include the namespace of the associated class
Browse files Browse the repository at this point in the history
If the associated class is `System::Build`, the previous code would
tell us that the name was `Build`. This code gets the right name.

Example taken from
thoughtbot#1978 (comment),
which I reproduced locally.
  • Loading branch information
pablobm committed Aug 4, 2022
1 parent 9a47a0e commit 4abe20b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/administrate/field/associative.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def self.associated_class(resource_class, attr)
end

def self.associated_class_name(resource_class, attr)
reflection(resource_class, attr).class_name
associated_class(resource_class, attr).name
end

def self.reflection(resource_class, attr)
Expand Down

0 comments on commit 4abe20b

Please sign in to comment.