On Wed, Aug 19, 2009 at 11:54 AM, Nathan de Vries<[email protected]> wrote:
>
> On 19/08/2009, at 11:39 AM, Gabe Hollombe wrote:
>> What about ActiveRecord::Base.sanitize_sql_for_conditions ?
>
> That's a protected class method on ActiveRecord::Base, which I did say
> he could use but would need to work around (e.g.
> ActiveRecord::Base.send(:sanitize_sql_for_conditions, [])). Obviously
> I don't know what style reports he's after, but in my experience with
> ActiveRecord-based reporting systems isn't too positive. Personally, I
> prefer to use Sequel in the context of reporting because I find myself
> fighting the system a lot less.

There *are* a lot of ways

You could also
include ActiveRecord::ConnectionAdapters::Quoting
into your class to get some measure of quotingy goodness.

Or make your report class an "abstract" subclass of AR::Base simply to
get at the handy protecteds.

However I do agree with Nathan that AR isn't a great solution for
getting at raw SQL stuffs.

However^2, if you're already using AR for models in a rails app and
want the reports in the same app, I'd stick with it simply for the
convenience of not having to have two ORMs in the one app.

:lachie
http://smartbomb.com.au
http://www.flickr.com/photos/lachie/


>
>
> Cheers,
>
> Nathan
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to