> if you decide that abstract classes are better, then I suggest that you
> do something like this to make your life easier:
>
> 1: class Person < ActiveRecord::Base
>
> 2: TypesofPeople = ["Client", "Prospect"]
>
> 3: def self.abstract_find (person_type, *args)
> 4:   if TypesofPeople.include?(person_type)
> 5:     person_type.constantize.find(*args)
> 6:   else
> 7:     nil
> 8:   end
> 9: end

I really wish that I understood your suggestion especially because it
may be what works.  I have taken the liberty of adding line numbers.
Basically, I understand the code except for line 5.  I have no idea
what you are doing there.  I'm not sure what the person_type and *args
are that you are passing to abstract_find.  Part of my confusion may
stem from the fact that there does not seem to be and 'end' for your
class definition.  So, I'm not altogether clear on whether lines 3
through 9 are suggested model code or suggested controller code.
Could you please clarify?  I do appreciate your suggestion and I have
high hopes for it being my salvation. Thanks.

       ... doug
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to