Re: [Rails] problem with Associations idea
W dniu 2011-03-19 20:32, Frederick Cheung pisze:
>
> On 19 Mar 2011, at 17:23, "rails.rookie"<bartek.iwaszkiewicz@gmail.com> wrote:
>
>> Hi, i have two models:
>>
>> User<...
>> has_many :photos, :dependent => :destroy
>> ...
>>
>> Photo<...
>> belongs_to :user
>> ...
>>
>> and I need Attribute model such as each photo has many attributes.
>> And here I'm not sure whether Attribute should be has_many: photos or
>> belongs_to :photo.
> Can you give some examples of what your attributes are? You probably want to avoid calling the association attributes - that will collide with an internal activerecord method.
>
> Fred
App has to work in this way, user add photo and then add attributes to
photo on example (Baltic Sea.jpg; sea, water, sand ).
Then usning Formal concept analysis (not relevant) special paris are
created {(photo,...,photo n),(attribute,...,attribute n)}
and it should be remember in some way (i suppose best will be another
table), because it will be modefied when photo table or
attribute table will change.
I can't find out the best way how associations between models should
look like and how many models i need.
Bartek.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home