Support #find_by, #find_by!, #where, #order, and #limit #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #19 and makes the following behavior possible:
I still need to update the README and changelog, but wanted to make sure this approach looks okay to you, @sirupsen. I'm happy with it so far, but have some questions:
#where
accept raw Airtable formula components, in addition to the conditions hash it currently accepts? LikeTea.where("Type => "Green").where("{Price} < 30")
?#where
,#order
, and#limit
all return an instance of Airrecord::Relation, an Enumerable that only callsTable#records
after you try do something with it, likeeach
,map
,to_a
, etc. In 2.0, should thehas_many
API also return a Relation instead of an Array, so you could callTea.find(id).brews.where("Temperature" => 90)
?