Ruby on Rails
Tuesday, August 31, 2010
Hello there..
what i am trying to do, is to consider a new column in my model, a column that do not exist in the database, and will not be created.
imagine, for instance, this case:
I have a table that store a number and a string, lets call it 'words'
--------------------
words
--------------------
int times(PK)
char name
--------------------
imagine Word as an instance of the model, i will have access to these:
Word.times
Word.name
what if i wanted a new column, some like
Word.complete
imagine that this column would store that 'char' for many times as is defined int the 'times' column...
like this
Word.times = 3
Word.name = a
Word.complete = aaa
got it?
i wont store that data, but generate it based on the data that is stored.
any idea????
did any of you guys see this situation before???
--
Lucas Franceschi
-- Desenvolvedor
SGI Sistemas
(049) 9922-3360
SGI Sistemas
(049) 9922-3360
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment