similar to: how to get these records in has_and_belongs_to_many relation

Displaying 20 results from an estimated 300 matches similar to: "how to get these records in has_and_belongs_to_many relation"

2005 Dec 15
3
How to delete a record
hey, i my database i have users and groups, each user can get in different groups my db structure: table groups: id, name, basegroup, firm_id table users: id, firstname, lastname, email table groups_users: group_id, user_id my relation is a many to many: class Group < ActiveRecord::Base has_and_belongs_to_many :users end class User < ActiveRecord::Base has_and_belongs_to_many
2006 Jan 03
0
has_and_belongs_to_many include problem
hey, i have users who are in groups, and i have a search form, where i can search on group, user lastname, and user firstname. All this is also with pagination. these are my models class User < ActiveRecord::Base has_and_belongs_to_many :groups end class Group < ActiveRecord::Base has_and_belongs_to_many :users end in my controller i do this THIS works (but in need pagination) @users2
2006 Feb 18
4
verifying best practice
i have a Project model, which belongs_to :user when i add a project, the users_id is based on the session[:users_id]. to get the users_id into the projects table, i''m doing this: @project = Project.new(params[:project]) @project.users_id = session[:users_id] this is working, i''m just verifying this is the best way to do it.
2015 Nov 03
1
POSIX ACLs on Domain Controller.
Hello samba team ! On my network, I mainly manage my AD users and computers from Unix using shell scripts. So I would like to set the shares' ACLs directly from the DC with the POSIX setfacl command. When exporting with NFSv4, the POSIX ACLs are conserved. I can set the permissions the same manner as for my local users. But on DC, the "rwx" right is mapped to "full
2007 Dec 12
0
Understanding ResourcesAndRelationships
Hello, we are quite happily using puppet but our setup needs a bit of cleanup. Forgive me minor errors I''m writing this from scratch now: The following layout: --- File site.pp: import "groups/*" import "users/*" node default{ # I''d like to avoid the following line to be uncommented # include "group_users" include "user_james" }
2012 Mar 24
3
How to compute within-group mean and sd?
Hi, I want to run something like SELECT firm_id, count(*), mean(value), sd(value) FROM table GROUP BY firm_id; But I have to write a for loop like for ( id in unique(table$firm_id ) { print(paste( id, mean(table[firm_id == id, "value"]) )) } Is there any way to do it easier? Thanks :) Best, Reeyarn Lee [[alternative HTML version deleted]]
2005 Sep 28
0
search engine, select the selected option
hey, i have a search engine that let u search on the an employee how can i make that if the user select "employee1" , on the next page "employee1" is selected this is my code (rhtml) <tr> <td><label for="employee_id">Employee</label></td> <td colspan="3"><%= select "employee", "id",
2005 Dec 23
1
pagination problem
hey, i have this problem in the database i have 32 records and the sql filtered 4 records #getting the callerid records depending on the given paramaters and paginate it @callerid_pages = Paginator.new self, CallerId.count, 10, @params[''page''] @caller_ids = CallerId.find(:all, :conditions =>["geotags.firm_id = ? ", @firm_id], :order => " geotags.address1
2006 Feb 12
6
habtm doesn''t save old IDs
I''m sure I''m not getting something. I have Users, and I have Groups. Each User has_and_belongs_to_many :groups and each Group has_and_belongs_to_many :users. When I add a user, I want to apply a bunch of groups (like tags) to the user (manually, without acts_as_taggable). Here''s User#create: @user = User.new(params[:user]) @user.groups =
2008 May 07
1
Assigning to the foreign key on a belongs_to association
I''ve encountered what seems like an odd omission in the behaviour of belongs_to associations: if you assign to the foreign key attribute, it doesn''t update the associated object (or mark a previously loaded one as stale) until you explicitly save or reload it. Let''s say we have a Company model, which belongs_to :city : >> torchbox =
2005 Dec 22
0
conditions on model
hey, this is the situation, an user may only access x clients (ex , 1, 5 ,6 ,7), so i make a string with those ids and paste it to the sql statement, the user is from the session #creating a list of all the client record ids the user may access and paste it in the sql statement if user.has_permission(''admin'') || user.view_all == 1 text = "" else text =
2005 Dec 01
0
problem with options_from_collection_for_select() need id not name
hey, i need a select list with a id property and not name, cuz i just ajax with this list and it checks on id not name if @request.post? #called by ajax if @request.xml_http_request? #called by ajax @geotag_id=params[:geotag_id].nil? ? -2 : params[:geotag_id] else @geotag_id=params[:geotag][:id].blank? ? -1:params[:geotag][:id] end else @geotag_id = -1 end i use this @geotags =
2006 Jan 31
4
has_one without inverse belongs_to
I have two models called entity and user. The entities table has a column called users_id that contains the user id of the user that created the entity. In entity I have... has_one :user ... as I want to be able to show the user who created the entity from the entity object. But this produces the following error... Mysql::Error: #42S22Unknown column ''users.entity_id'' in
2007 May 10
2
Problem with translator
Hi, Just installed 0.9.4 (from 0.8 series) and ran the spec translator. It messed up specs that had the should include() where the argument to include is a string (using no parens for the arg) IOW, given: context "OldSchool" do class OldSchool attr_accessor collection def initialize @collection = [] end def add_new(item)
2015 Apr 25
2
vs_fruit - can't write to share
Hi, i'm running Samba 4.2.1 compiled from source on an Ubuntu 10.04.4 LTS Server. ACL/XATTR is active and working. I tried to activate the vfs_fruite module and added the sample code: vfs objects = catia fruit streams_xattr fruit:resource = file fruit:metadata = netatalk fruit:locking = netatalk fruit:encoding = native to the share. In addition i tried the following share definition: vfs
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone, For one of our projects we have a need to deploy and maintain a demo. As a result I''ve attempted to setup a set of rake tasks for the job. My goal is have one rake task called "deploy_demo" which purges the database, migrates to the current schema, and loads the db from a set of fixture files in a specified location. I''ve written two new tasks the perform
2015 Apr 25
0
vs_fruit - can't write to share
I must reply to my own post. Changing the fruit:locking to "none" results in a working share. Netatalk 3.1.6 is installed and from the information of the changelog Netatalk 3.1.7 doesn't change anything to the file locking (except if you're using Solaris). Am 25. April 2015 bei 12:16:20, Christian Kovacic, MA (chris.k at gmx.at) schrieb: Hi, i'm running Samba 4.2.1
2005 Sep 01
0
2 issues with Sortable control [Version 1.5-pre3]
Thank u Thomas...U just made my day ! Here the result www.claudehussenet.com Drag and drop of portlets ! See http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo -- uses SVN trunk code, and the new dropOnEmpty option. Thomas Claude Hussenet Independent J2EE Architect Consultant http://claudehussenet.com ____________________________________________________ Start your day
2007 Oct 23
0
drag'n'drop or sortable
Hi, I''m a newbie and have a little problem getting into scriptalicious: I''d like to convert the items of a drop down list into draggable objects - they should be only draggable but not sortable. They should be draggable onto another box but in there the items should be automatically sorted by the numerical id''s and not sortable by the user. I looked through all the
2006 Jun 29
1
search action/ in different groups
Hi all, thanks in advance for those who''ll take the time to help out... i have a list of users who are connected with a habtam relashinship to a set of groups (joint table of groups_users) and now am trying to implement a search operation that will go through all of the records of the users and output user results according to what group was chosen at the searchbar, and the text