Skip to content

Commit

Permalink
Switched to columns_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed May 5, 2024
1 parent caf8798 commit fb76a12
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/neighbor/vector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def self.cast(value, dimensions:, normalize:, column_info:)
end

def self.column_info(model, attribute_name)
attribute_name = attribute_name.to_s
column = model.columns.detect { |c| c.name == attribute_name }
column = model.columns_hash[attribute_name.to_s]
{
type: column.try(:type),
dimensions: column.try(:limit)
Expand Down

0 comments on commit fb76a12

Please sign in to comment.