Re: [Rails] Newbie Model Question
On 2 Aug 2011, at 08:32, Michael Pavling wrote: > On 1 August 2011 22:20, OES wrote: >> On the Profile I would like to store basic data ie Gender > > Sex. Gender is a term about language being masculine/feminine/neutral. > Sex is male/female. Except that you're not really interested in finding out whether the user has dangly bits or not (their physical sex); you're interested in finding out their social gender identity is, and 'gender' has been an accepted term for that concept for decades now. On gender and forms: http://meloukhia.net/2009/12/beyond_the_binary_forms.html Chris -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Newbie Model Question
On 1 August 2011 22:20, OES wrote: > On the Profile I would like to store basic data ie Gender Sex. Gender is a term about language being masculine/feminine/neutral. Sex is male/female. On 2 August 2011 07:31, Colin Law wrote: > Then I get to data like yearly income or marital status. > > I shall be interested on input from others on the best way to handle > the marital status. This is a good analysis of modelling martial status in DB's (with all the complication it can cause): http://qntm.org/gay -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Newbie Model Question
On 1 August 2011 22:20, OES wrote: > Hey Folks, Sorry for this newbie question but I am interested on how > you would do the following. > > Lets say I have a User model and a User has_one Profile > > On the Profile I would like to store basic data ie Gender, Date of > Birth etc.. Then I get to data like yearly income or marital status. > > In the past I may have used ENUM's for marital status but would have > used yearly income as a integer for a related table ie, income_id > and then created a Income model to hold possible changing values. For income, where you have a separate table, you want user belongs_to income and income has_many users. See the Rails Guide on Associations to see what this does for you. If you have not already done so then look (in depth) at the other guides also. I shall be interested on input from others on the best way to handle the marital status. I strongly recommend working right through a good tutorial such as the railstutorial.org (free to use online). Make sure that the guide matches the version of rails you have (which should probably be version 3.0). It may appear that the tutorial has little relevance to your application but you will learn a huge amount about the principles of Rails even if the sample app itself is not relevant to your needs. Colin > > With rails not supporting ENUM's (from what I can work out with > migrations) I was wondering do most of you have allot of related > tables for this sort of thing? > > There will be allot of lookups on the user profile so I'm looking for > the best approach. > > Hope you can advise!! > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Newbie Model Question
Hi! See if this article can help you: - http://gregmoreno.ca/preventing-model-explosion-via-rails-serialization/ Best Regards, Everaldo P.S: I'm a newbie too, so I can't find the "better words" to describe the solution. =) On Mon, Aug 1, 2011 at 6:20 PM, OES wrote: > Hey Folks, Sorry for this newbie question but I am interested on how > you would do the following. > > Lets say I have a User model and a User has_one Profile > > On the Profile I would like to store basic data ie Gender, Date of > Birth etc.. Then I get to data like yearly income or marital status. > > In the past I may have used ENUM's for marital status but would have > used yearly income as a integer for a related table ie, income_id > and then created a Income model to hold possible changing values. > > With rails not supporting ENUM's (from what I can work out with > migrations) I was wondering do most of you have allot of related > tables for this sort of thing? > > There will be allot of lookups on the user profile so I'm looking for > the best approach. > > Hope you can advise!! > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Newbie Model Question
Hey Folks, Sorry for this newbie question but I am interested on how you would do the following. Lets say I have a User model and a User has_one Profile On the Profile I would like to store basic data ie Gender, Date of Birth etc.. Then I get to data like yearly income or marital status. In the past I may have used ENUM's for marital status but would have used yearly income as a integer for a related table ie, income_id and then created a Income model to hold possible changing values. With rails not supporting ENUM's (from what I can work out with migrations) I was wondering do most of you have allot of related tables for this sort of thing? There will be allot of lookups on the user profile so I'm looking for the best approach. Hope you can advise!! -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Newbie Model Question
I'm building a shop in rails as a learning excercise. I've got to the last part when I'm sending out e-mail order confirmations. The e-mails contain a list of each line item the customer ordered, I also want to display the catgory name the customer ordered from. The database is setup: Category > Product > Line_item. So I want to navigate back from line_item > product > category so i can display the category name in the email however im not sure how I tell it to find the category name from the item. Be greatful for anyhelp. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---