kbrock / activerecord-hash_options Goto Github PK
View Code? Open in Web Editor NEWArel options for active record hashes
License: MIT License
Arel options for active record hashes
License: MIT License
In many cases, the operations in sql work the same as in ruby.
Numbers comparison is very predictable, and for the most part regular expression matching is predictable as well.
Unfortunately string comparison is another matter (e.g. "cat" > "bat"
). The one that looks the easiest is potentially the most complicated. Some of these aspects may come into play with regular expressions, but locally those only use equality, granted in a fuzzy way.
Case sensitivity is complicated. The actual concept may be simple or complicated, I'm undecided on that one, but determining if case sensitivity is relevant is another matter. Platforms have different defaults based upon their locale and other configuration variables. And even on a case sensitive platform, a query can be case insensitive.
I'm still a little confused whether it is locale or collation that affects the case sensitivity in string comparison. It is nice that mysql ships with a standard set of locales which makes debugging that much easier. Postgres not shipping with a locale and relying upon the operating system makes that a confusing mess.
Don't want to get into per column collation, let alone per query collation. Or the non-string data types that are focused on case sensitivity. This could really take a simple concept and make it worse than a database implementation.
It may be as simple as requiring that the ruby code run with a LC_LOCALE
that is the same as the database and we use the c comparison methods that respect the locale. Not sure how that would affect readability, but I have a feeling that chasing this last 20% will make this very complicated.
Let's focus on case sensitivity first.
From here we can expand this to handle the edge cases around nuances with the database. Still not sure if those are locale based or are just different implementation based.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.