-
Notifications
You must be signed in to change notification settings - Fork 39
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
More configurations for get #8
Comments
Phactory is always accepting pull requests :) Nevertheless, I agree, this sounds like a good idea in general. I'd be interested to hear the case where it's necessary. |
How many records are you testing at once to need that type of ordering/limiting? Usually on a unit test level, you wont have too many records to pull up and you should be truncating records and resetting Phactory per test. Not that I disagree with the idea of adding conditions. |
I have a table that is kind of a log. It contains information that a customer service rep can see to know what the system has done on behalf of the customer. In my unit testing I've had code inserting multiple comments. What I would like to be able to do is pull the last comment. We have the ability to pull the first one but not the last. That is why having the ability to set the order and limit for the Phactory::get() would be useful. |
are you using Phactory to insert the comments? If so you can specify an id and reference that in your get();
|
When I use Phactory to create records, I do this. But this case is when the code creates those records. I have no way of knowing the id. |
Understood. Maybe a patch would be in order. |
It would be nice to pass conditions to the get.
Like if I wanted to get the latest created user:
The text was updated successfully, but these errors were encountered: