Results 1 to 4 of 4
Jun 12, 2010, 03:08 #1
- Join Date
- Dec 2004
- 0 Post(s)
- 0 Thread(s)
how to set up true/false attribute for model
I have a project model, it has many users through project_members (id, user_id, project_id, leader)
the project_members table leader column is a tinyint(1) column (true/false). How would I set it up so I could do something like the following:
@project = Project.find(id)
@project.leader (this would give me a User object of the person where the leader column is set to true in the project_members table)
It's not an association, tried that and it's looking to leader as an id column, not true/false.
Do I set methods (getter/setter)? Hope i'm being somewhat clear, thanks for any help.your brain reacts in the same way whether you are
looking at something or thinking about it...