Added #where to base.rb #24

Merged
merged 1 commit into from Jun 13, 2013

Conversation

Projects
None yet
4 participants
Contributor

dhruvasagar commented Apr 19, 2013

Added a basic implementation of #where to base.rb, filters by all the given keys doing an effective sql 'AND' for all. Each key can have a single or multiple (Array) values, in case it's single it's simple, in case it's multiple, it will look for all values.

Simplified example of how it should work :

Model.where(:id => [1,2]) #=> [#<Model ID=1...>, #<Model ID=2...>]
Model.where(:id => 1, :name => 'test') #=> [#<Model ID=1 NAME='test'...>]

jpwynn commented Apr 23, 2013

+1

+1

@maccman maccman added a commit that referenced this pull request Jun 13, 2013

@maccman maccman Merge pull request #24 from dhruvasagar/master
Added #where to base.rb
6d8a927

@maccman maccman merged commit 6d8a927 into maccman:master Jun 13, 2013

Contributor

dhruvasagar commented Jun 13, 2013

Awesome

Contributor

dhruvasagar commented Feb 4, 2014

Hi, I don't believe these changes have been published to rubygems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment