Ok, my patches are quite limited to get the InterBase driver going.

At the moment, the InterBase driver is a patch on ActiveRecord, I clearly
(after my discussions with you) have to turn this into a plugin. I do need
one thing:

InterBase uses UPPER for case insignifcance, it doesn't have LOWER built in
(not ANSI-SQL compliant) so I added in a property to abstract_adapter.rb:

+
+      # Some databases use UPPER to determine case insignificance rather
than LOWER
+      # This is particularly used in Validations. This addition leaves
behaviour at what it is now.
+      def case_insignificant_uses_lower
+        true
+      end

and in validations.rb

           if value.nil? || (configuration[:case_sensitive] ||
!columns_hash[attr_name.to_s].text?)
             condition_sql = "#{record.class.table_name}.#{attr_name}
#{attribute_condition(value)}"
             condition_params = [value]
+          elsif !record.connection.case_insignificant_uses_lower
+            condition_sql = "UPPER(#{record.class.table_name}.#{attr_name})
#{attribute_condition(value)}"
+            condition_params = [value.upcase]
           else
             condition_sql = "LOWER(#{record.class.table_name}.#{attr_name})
#{attribute_condition(value)}"
             condition_params = [value.downcase]

All my other changes were fixing Tests and "= NULL" and "IS NULL".

Richard

On 2/25/07, 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 :)
>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to