-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added Conditions to activerecord #30
base: master
Are you sure you want to change the base?
Conversation
…t all test pass. Next to actually test the conditions
Test cover conditions in form of: 1. Array 2. Hash 3. String
Hi Daniel, Looks good. This functionality will also need to be added to the DataMapper and Sequel adapters as well. Any interest in looking into that? I'm busy right now with some other projects, so it may take me a while to make that change. John |
That is odd... i see the change on my FS but git shows nothing that's changed.. On Fri, Aug 19, 2011 at 2:55 PM, jwood
|
My mistake, i was looking at the master branch. I might have some time to do that.. Daniel On Fri, Aug 19, 2011 at 4:59 PM, Daniel Granatshtain
|
Correct. Ideally this setting would be used by any of the SQL based libraries. |
Make sense. i wasn't aware of any other SQL based extensions. On Fri, Aug 19, 2011 at 5:10 PM, jwood
|
The implementation will need to be slightly different for the other library extensions. The ActiveRecord implementation uses sanitize_sql to build the conditions, but that is implemented in ActiveRecord::Base. We'll need to find a way of doing this specific to each library, since ActiveRecord may not be loaded if somebody is using DataMapper and Mongoid, for example. |
Oh...one other thing Daniel. I noticed a spelling error in the code. It's "seat" instead of "seet". If you're in the code adding support for the other libraries, would you mind correcting this? |
oops... will do On Fri, Aug 19, 2011 at 6:59 PM, jwood
|
Hi john, As for the other class, i don't think i will have time to handle that Daniel. On Sat, Aug 20, 2011 at 10:34 AM, Daniel Granatshtain
|
Ok, thanks Daniel. I'll merge your commit into a topic branch, and continue to work on adding support for the :conditions to the other SQL based libraries when I'm free. |
Thanks John. This is a project i was working on for a company Pixfizz. Daniel On Mon, Aug 22, 2011 at 3:52 PM, jwood <
|
I followed your advice on how to add it, and its done.
You can see a test that adds 4 Seets to the Car.
2 are front seets,
2 back seets,
1 seet from the front is the drivers seet. This one is only added in code to the front seet, but pulled form the DB as driver (using conditions)
LMK what you think, and if there is anything else that needs to be added/removed
Daniel