Is there a historical reason why #transaction is defined as both an instance and class method within ActiveRecord models? I bring this up specifically because it prevents us from using "transaction" as an association name like so: class PaymentTransaction < ActiveRecord::Base end class PaymentAccount < ActiveRecord::Base has_one :transaction, :class_name => ''PaymentTransaction'' end This obviously won''t work because the #transaction instance method is used throughout ActiveRecord::Transactions instead of the class method. Does anyone have any thoughts on solely using the class method to avoid a common name collision like this? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Does anyone have any thoughts on solely using the class method to > avoid a common name collision like this?We can''t remove the instance method as people use that in their code, however I personally can''t see why we couldn''t take a patch so that ActiveRecord only ever calls the class method. This way you''ll be able to ''have one'' transaction, but not break backwards compatibility. Historically you couldn''t have a model called ''Transaction'' anyway because of our old, bundled version of transaction-simple. This was unbundled in 2.0. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---