On Feb 24, 7:44 pm, "Michael Koziarski" <[EMAIL PROTECTED]> wrote:
> > Following up on Koz's suggestion to discuss how plugin developers are
> > monkey patching AR, I'd like to share some of things my coworkers and
> > I have done.
>
> Calling all plugin authors. If you've been frustrated when adding
> functionality to Active Record, speak here, or forever ... yeah :)
>
Things I think I've nicely monkeypatched...
- adding temporary table support
- adding query support for regular expressions, and having better
hash support (adding prefix and suffix based modifies, ie: field_like
or field_contains or matches_field)
- adding efficient mass import functionality for MySQL (PostgreSQL
8.2 support is coming as well) for handling multiple value insert
statements
- adding fulltext index searching support for MySQL
- adding block based foreign key enable/disable support
- adding to_csv support which supports has_one, belongs_to and
has_many relationships
- adding custom query object support using duck typing and to_sql
I'd like to see all SQL generation moved into components which are
registered for one or more adapters. I would like to see
AbstractAdapter be registered for all of the common queries which are
handled by all adapters ( LIKE, BETWEEN, etc ).
I'd like to see query components be handled LIFO style. This will
keep the adapters registered on AbstractAdapter as the last resort, so
a plugin or adapter specific behavior can override the generic support
should it need to, without having to change AbstractAdapter code.
I'd like to see a nice way to handle prefix and suffix modifiers when
using a Hash in #find related queries. This will allow you to support
easier to read queries using suffixes like, "fieldname_matches" or
"fieldname_contains" or "fieldname_is_not", etc.
What I'd like to see I've added to ActiveRecord::Extensions, but it'd
be nice to have ActiveRecord support these things because I believe it
will make it easier for contributors to add functionality for
different databases since they won't have to understand the internals
of ActiveRecord, instead they can focus on their query component, and
simply add one line of code to register it.
My last request is that it is easier and more inviting for people to
contribute.
Zach
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" 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/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---