search for: user_group_ids

Displaying 4 results from an estimated 4 matches for "user_group_ids".

Did you mean: user_group_id
2006 Apr 20
5
Using Migrations to convert join table to join model
Greetings, I''m trying to convert a HABTM w/attributes join table in my database into a join model table in order to utilize the new has_many :through functionality introduced in Rails 1.1. Here''s the current table definition: licenses_user_groups: license_id, user_group_id, usage_notes Perhaps it was a mistake, but I made (license_id, user_group_id) the primary key. Now,
2007 Dec 28
1
validation of acts_as_list in the model of the base class?
Lets say I have 3 models, user, user_group and user_group_nodes. A normal user has one user_group_id as a foreign key and a special user has multiple user_groups which are defined in the user_group_nodes. The user_group_nodes is a "acts_as_list" for user and contains a list of group_ids. When I build a form to get user input and I want to save it, is there a way to validate the
2010 Jun 11
0
nested form & habtm
...model (user.rb) class User < ActiveRecord::Base has_and_belongs_to_many :user_groups accepts_nested_attributes_for :user_groups end UserGroups model (user_groups.rb) class UserGroup < ActiveRecord::Base has_and_belongs_to_many :users end users_controller.rb def new @user = User.new(:user_group_ids => params[:group]) end in the new user view, i have access to the User.user_groups object, however when i submit the form, not only does it not save into my join table (user_groups_users), but the object is no longer there. all the other objects & attributes of my User object are persisten...
2007 Sep 20
1
Relationship Proxies?
I''m trying to understand these results in irb, which implies that there''s some kind of proxy at play: >> aaron = User.find_by_login ''aaron'' => #<User:0xb7109cdc @attributes={"salt"=>"7e3041ebc2fc05a40c60028e2c4901a81035d3cd", "updated_at"=>nil, "contact_info_id"=>nil,