Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR::Relation#where_values_hash doesn't include date ranges #4388

Closed
melvinram opened this issue Jan 9, 2012 · 3 comments
Closed

AR::Relation#where_values_hash doesn't include date ranges #4388

melvinram opened this issue Jan 9, 2012 · 3 comments

Comments

@melvinram
Copy link

Here's how to replicate problem:

$ rails new Cars
$ rails g scaffold Car manufacture_date:date make:string model:string
$ rake db:migrate
$ rails c
> Car.where(:manufacture_date => Date.today).where_values_hash  
=> {:manufacture_date=>Sun, 08 Jan 2012}
> Car.where(:manufacture_date => (Date.yesterday..Date.today)).where_values_hash
=> {}
@josevalim
Copy link
Contributor

where_values_hash is internal API, you shouldn't be using with it.

@melvinram
Copy link
Author

It's in the documentation. There is no indication that it's an internal API. Where do I go to see what should and shouldn't be using? And why shouldn't I be using this method when it does exactly what I need except for one bug?

@chewi
Copy link
Contributor

chewi commented Jun 20, 2016

Just ran into this myself. It's a public documented method so yeah. It's not like it returns Arel nodes or something else that's arguably internal.

chewi added a commit to yakara-ltd/rails that referenced this issue Aug 28, 2018
chewi added a commit to yakara-ltd/rails that referenced this issue Aug 28, 2018
chewi added a commit to yakara-ltd/rails that referenced this issue Aug 29, 2018
chewi added a commit to yakara-ltd/rails that referenced this issue Sep 4, 2018
neilh23 pushed a commit to yakara-ltd/rails that referenced this issue Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants