I second this opinion, my argument being it will be more difficult to
maintain the second approach, because you'd have to ensure there is only 1
of these per diagram at any one point. If starting points can change around
(they probably will in the future if it ain't so yet), then you can get
yourself into extremely hard to diagnose bugs. While with the first option
you at worse will have an incorrect starting node, which you can fix with
either DB or Rails console even.

2012/8/23 Charles A. Lopez <[email protected]>

> Without thinking about it too much I recommend your first suggestion.
>
> It just seems cleaner to me.
>
>
>
> On Wed, Aug 22, 2012 at 2:37 PM, Jason Walsh <[email protected]> wrote:
>
>> Hi
>>
>> Just interested in anybody's opinion on the following:
>>
>> I have one model class called Diagram, that contains a number of Node
>> classes (ie 1-many relationship).  One of the Node classes must be the
>> start node.
>>
>> Which would be better:
>>
>> 1.  Attribute in Diagram class called StartNode containing id of the
>> start Node.
>>
>> 2. Boolean attribute in Node class called StartNode? and set to true if
>> its the start node.
>>
>> Would be interested in knowing the 'Rails' way of doing this :)
>>
>> Cheers
>>
>> Jason
>>
>> --
>> 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 https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> 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 https://groups.google.com/groups/opt_out.
>
>
>



-- 
Pagarbiai,
Gintautas

-- 
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 https://groups.google.com/groups/opt_out.


Reply via email to