ruby on rails - Simple word - synonym model, serialized attribute or association? -



ruby on rails - Simple word - synonym model, serialized attribute or association? -

i working on simple dictionary have words , synonyms words.

i not sure model improve solution, working serialized attribute or association.

with association:

class reservedword < activerecord::base has_many :synonyms end class synonym < activerecord::base belongs_to :reserved_word end

with serialization:

class reservedword < activerecord::base serialize :synonyms end

in terms of info redundancy there isn't such big problem because synonyms aren't supposed repeat other reserved words.

i appreciate suggestions.

what sql query pattern expected like?

using serialize mechanism, won't able easily query based on synonyms. based on beingness able reverse lookup reservedword's based on synonyms, recommend belongs_to/has_many standard rails approach.

ruby-on-rails ruby-on-rails-3 serialization activerecord model

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -