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
Post a Comment