Skip to content

Commit

Permalink
chore: replace eval with Object.const_defined?/const_get
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaak authored and gernotkogler committed Nov 11, 2024
1 parent 3b69716 commit 7ef1ec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xapian_db/document_blueprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def lazy_load_adapter_for(blueprint, klass_name)
end

# Needed to add class helper methods to indexed pure ruby classes
if eval("defined?(#{klass_name}) && #{klass_name}.is_a?(Class)")
if Object.const_defined?(klass_name) && Object.const_get(klass_name).is_a?(Class)
blueprint._adapter.add_class_helper_methods_to XapianDb::Utilities.constantize(klass_name)
end
end
Expand Down

0 comments on commit 7ef1ec0

Please sign in to comment.