Skip to content

Commit

Permalink
Merge pull request #16008 from yrudman/use-string-instead-of-class-in…
Browse files Browse the repository at this point in the history
…-active-record-query

Passing a class as a value in an Active Record query is deprecated
  • Loading branch information
chrisarcand authored Sep 21, 2017
2 parents 4a7c7bd + d86efd1 commit c0fac64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/mixins/custom_attribute_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module CustomAttributeMixin
end

def self.custom_keys
custom_attr_scope = CustomAttribute.where(:resource_type => base_class).where.not(:name => nil).distinct.pluck(:name, :section)
custom_attr_scope = CustomAttribute.where(:resource_type => base_class.name).where.not(:name => nil).distinct.pluck(:name, :section)
custom_attr_scope.map do |x|
"#{x[0]}#{x[1] ? SECTION_SEPARATOR + x[1] : ''}"
end
Expand Down

0 comments on commit c0fac64

Please sign in to comment.