fractaledmind / activeset

A toolkit for working with enumerable sets.
MIT License
2 stars 1 forks source link

Use the `arel_table` method on the ActiveRecord model, which helps wi… #32

Closed fractaledmind closed 5 years ago

fractaledmind commented 5 years ago

…th typecasting

codecov[bot] commented 5 years ago

Codecov Report

Merging #32 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage      99%   99.01%   +<.01%     
==========================================
  Files          17       17              
  Lines         404      407       +3     
==========================================
+ Hits          400      403       +3     
  Misses          4        4
Impacted Files Coverage Δ
lib/active_set/filtering/active_record_strategy.rb 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b134671...41f5f9f. Read the comment docs.

fractaledmind commented 5 years ago

This has a problem with the BINARY datatype.

Try this in a console:

value = matching_item.binary
Thing.where(Thing.arel_table[:binary].public_send(:eq, value)).to_sql
Thing.where(Thing.arel_table[:binary].public_send(:eq, value)).pluck(:id)
Thing.where(binary: value).to_sql
Thing.where(binary: value).pluck(:id)