[Ruby] refactoring/drying help

Mike Emery philodoxx at gmail.com
Thu Oct 11 16:18:21 PDT 2007


There's a slight problem there.  If a person is both an artist and a writer,
the fact that they are an artist will clobber the fact that they are also a
writer (unless there's some kind of inheritance).  It looks like you need
separate "person_roles" table.

people:
1, mike

roles:
1: writer
2: artist

person_roles:
1,1
1,2

On 10/11/07, Harry Dean Hudson Jr. <dean at ero.com> wrote:
>
> On 10/11/07, shane becker <veganstraightedge at gmail.com> wrote:
>
> > >   elsif artist.artist then
>
> Oops! No, just if and not elsif if a Person can be both things.
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
>



-- 
-Mike


More information about the Ruby mailing list