Gabriel Saravia wrote:
>> The names of the various Wheel tables are not known at design 
>> time.
> 
> well..if this is the case, i don't see how you're really going to keep 
> from some form of dynamic creation/metaprogramming/code generation and 
> also keep the design clean...
> 

I guess the best I can come up with right now is to add a 
fetch_wheel_model method somewhere that looks something like:

def get_wheel_class(table_name)
  @cached_wheel_classes ||= {}
  unless @cached_wheel_classes.has_key? table_name
    @cached_wheel_classes[table_name] = Class.new(AbstractWheel) do
      set_table_name table_name
    end
  end

  @cached_wheel_classes[table_name]
end

but for some reason that doesn't quite feel like a good solution.

-- 
Posted via http://www.ruby-forum.com/.

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