Querying improvements #49

Merged
merged 3 commits into from Feb 22, 2013

Conversation

Projects
None yet
2 participants
Contributor

denzel-morris commented Feb 7, 2013

Minimal update (with tests) to provide ActiveRecord-like convenience methods, such as:

Resource.where(:field=>"value").first_or_create
Resource.where(:field=>"value").first_or_initialize
Resource.where(:field=>"value").first_or_create :another_field=>"another_value"
Resource.where(:field=>"value").first_or_initialize :another_field=>"another_value"

Please feel free to comment, question, or suggest improvements.

@guilleiguaran guilleiguaran added a commit that referenced this pull request Feb 22, 2013

@guilleiguaran guilleiguaran Merge pull request #49 from signpost/query_improvement
Querying improvements
5d8cb4e

@guilleiguaran guilleiguaran merged commit 5d8cb4e into rails:master Feb 22, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment