On Fri, Oct 14, 2011 at 15:20, Norbert Melzer <[email protected]> wrote:

> t.boolean :may_see_hidden_forum_number1, :default => false
> t.boolean :and_so_on, :default => false
>
> This is what I not wanted to do...

Correct.  Any time you have a _number1 and_so_on, that's a smell that
indicates a need to break out the association into a separate class
(or at least table).

In this case, maybe something like having a set of user roles, whereby
a given forum may require one or more (or perhaps *any of* several?)
roles in order to administer it, or see it, or whatever, and users
have zero or more roles.

For instance, let's say your project is a gathering place with forums
for assorted aspects of various religions.  (For instance, you may
have Hebrew Lessons and Daily Torah Reading for the Jews; Arabic
Lessons and Daily Quran Reading for the Muslims; Talking with your
Mouth Full and Daily Sauce Recipe for the Pastafarians; and so on.)
To prevent holy flame wars, you don't want the members each of them to
even see the existence of the other religions' forums.  Each forum
could have an optional role required in order to see it, and each user
could have zero or more roles.  (More than one, in case you trust
someone to see the forums of multiple religions.)  Or, you could have
multiple roles per forum, which raises the question of whether you
want to require *any* of them, *all* of them, or something more
complex.

-Dave

-- 
LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages.
Where: Northern Virginia, Washington DC (near Orange Line), and remote work.
davearonson.com (main) * codosaur.us (programing) * dare2xl.com (excellence)
Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)

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