search for: user_type_id

Displaying 3 results from an estimated 3 matches for "user_type_id".

2006 Apr 19
2
Beginner problem with foreign keys
...;ve been trying to get this to work all night. I''ve made some progress by reading other posts, but I''m stuck now and can''t figure out what I am doing wrong. I have two tables: application_users and user_types. In my application_users table I have a field named "user_type_id". At first, I thought if I set up the foreign key with the correct names, it would automatically appear in my "new" form, but I got past that issue. My application_user model looks like this: class ApplicationUser < ActiveRecord::Base belongs_to :user_type val...
2008 Jan 27
2
conditional validation
Hi, How can I validate user info under certain conditions? For example, I just downloaded a plug-in that allows me to validate phone numbers, but what I would like is to only validate the phone number if it is not blank and if the user_type_id field is equal to one. How can I achieve such a validation in my user model? Thanks, - Dave --~--~---------~--~----~------------~-------~--~----~ 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 r...
2005 Mar 09
10
Confused about extending the login generator ''user''
...onController < ActionController::Base include LoginSystem model :user end 2) My user_model.rb is a little different because I have defined the relationship to the type table, ie class MybmsUser < ActiveRecord::Base belongs_to: user_type 3) I''ve added the ''user_type_id'' to my ''users'' table and created the ''user_types'' table and user_types model. If I comment out the ''belongs_to: user_type'' then the app runs. If I leave it in then I get the failure above. I was hoping to be able to do something like...