Faveod / arel-extensions

Extending Arel
MIT License
142 stars 24 forks source link

[] with a range #25

Open akimd opened 4 years ago

akimd commented 4 years ago

The current behavior is misleading, and does not match what Ruby does.

> User[:first_name][3,7].to_sql
SUBSTRING(`users`.`first_name`, 4, 4)
> User[:first_name][3..7].to_sql
SUBSTRING(`users`.`first_name`, 4, 5)