similar to: active record: is this possible?

Displaying 20 results from an estimated 5000 matches similar to: "active record: is this possible?"

2006 Jul 13
1
How to create a child from a parent
Hi i am trying to figure out what is the best way to do this very basic thing: lets say i have two tables: one with parents and one with children. there is a one to many relation between them. I scaffolded the parents tabel and i can open each parent. Now i want to add a link to the ''show'' view which will create a new child record. In the model i defined the has_many and
2006 Jul 26
3
Polymorphic Association with Single Table Inheritance?
Hello, is it possible to setup a model/table schema like this: Groupable --> Membership <-- Group ^ ^ | | User UserGroup I tried the following but failed: Groupable (table with ''type'' column) has_many :memberships, :as => :groupable has_many :groups, :through => :memberships
2006 Aug 07
3
simple if - then question
hi, could somebody tell me the difference between: if not params[:id] flash[:notice] = blabla'' redirect_to(:controller =>"calendar", :action => ''index'') end and: if params[:id] == nil flash[:notice] = blabla'' redirect_to(:controller =>"calendar", :action => ''index'') end the first one
2012 Nov 09
2
Passing an array of user groups to a define
As I try to get some flexibility in the creation of users, I switched to a define. problem is, I can''t pass an array of user groups anymore. This either results in - wrong group creation: group1,group1group2,group2 (see that group1 and group2 are concatenated in the middle, undefined group) - error: Group names must be provided as an array, not a comma-separated list. I use the
2006 Oct 25
4
need help on special HABTM relation
hey all, I have three tables like this: forum (id,title) usergroup(id,title) forum_perms(usergroup_id,forum_id,read,write,post) is there a way to deal with that kind of relation with rails such as by using has_and_belongs_to_many kind of stuff? thanx in advance Pat --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2023 Feb 14
1
idmap ad question
On 14/02/2023 11:41, Vaughan, Robert J via samba wrote: > I am the UNIX admin and don't have a use for all domain users group since all domain users won't be UNIX (or SAMBA) users Your decision. > > What do you mean by "It isn't as if you can have a user group with the same name as the user"? We currently do have group names in UNIX (local and in LDAP) that are
2006 May 28
7
Join table not being populated
Hello, I have the usual Categories and Products table scenario, mediated by a Categories_Products join table. When I create a new Product and into a given Category, I notice that my join table is not being populated. Shouldn''t the join Categories_Products table be populated? Thanks, gk -- Posted via http://www.ruby-forum.com/.
2006 Apr 24
9
Confusion with expressing many to many relationship
Hi folks, I am in the process of converting an existing non-rails application to rails, and am not sure what the best approach would be for specifying the relationship between the two sets of data. I''ll describe the existing table structures first. Table 1: Urls Each url has a unique id and two lists of Phrases, these are currently setup as varchars with "," delimitation -
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2006 May 21
3
has_many :through with a polymorphic join
Hi, Four tables: users, user_counties, uk_counties and us_counties. Each user has many counties, and each county has many users, so I decided to make user_counties a polymorph, so it can have counties from different countries (each country requires a completely different set of tables with a completely different set of properties, that''s why there''s one table for uk_counties and
2006 May 10
7
has_many :through scope on join attribute
Hi I have a has_many :through. It''s a basic mapping of Project id .... User id .... TeamMembers project_id user_id role What I would like to do is have different roles so I can have in the project model has_many :core_members, :through => :team_members, :source => :user but I would like to limit this to only those with the "core" role in the team members table for
2004 Aug 06
5
m3u - file definition
Hello Remco, I found these decumentations before but they say nothing about setting the start time and end time of each mp3 file entry in the .m3u file Best Regards - Johann "Remco B. Brink" schrieb: > <quote who="Johann Soukup"> > > > is there any documentation on the .m3u file definition ? > > Google is your friend (tm): > >
2006 Jul 10
10
has_many :through and foreign key parameters
I just took my HABTM and turned it into a :through since my join table has another "non-joiny" attribute. I went from this: has_many_and_belongs_to :jobs, :join_table => ''tablename'', :foreign_key => ''x'', :association_foreign_key => ''y'' to this: has_many :jobs, :through =>
2007 Jan 16
1
Active directory usergroups to use with samba
Hi, I have a Samba 3 server which authenticate in AD. Is it possible to map windows usergroups against UNIX ones? In the logs, I see several SIDs whenever an user authenticate itself, but I don't know how to use them. For example, here is my [global] [global] dos charset = iso-8859-1 unix charset = iso-8859-1 workgroup = INFELEC realm = REALM.LOCAL
2006 Apr 20
3
has_many :through with has_many/has_many join models
It seems that using a join model that joins with two has_many''s will fail to generate proper SQL class StudentSemesterRecord < ActiveRecord::Base belongs_to :semester has_many :discipline_records, :through => :semester end class Semester < ActiveRecord::Base has_many :student_semester_records has_many :discipline_records end class DisciplineRecord <
2007 Apr 24
1
dundi problem * 1.4.2
Hi All, I've been banging my head on a small dundi problem... I have two * servers setup, both have almost identical dundi.conf files: root@tsjonge:/opt/asterisk/etc# cat dundi.conf [general] department=thuis organization=pipsworld locality=Amsterdam stateprov=NH country=NL email=remco@pipsworld.nl phone=+31207508308 ;bindaddr=0.0.0.0 ;port=4520 entity=00:02:b3:49:69:5e ttl=16
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
I have a problem declaring a relationship through a join_table ; the SQL generated by ActiveRecord is correct, but there are two columns called ''id'', and the final object gets the ''wrong'' column ... Here''s a more detailed description of the data, code, and problem :- There''s a People table, with id, name, and a few things. Also a
2006 May 06
3
Storing additional data on join tables with Rails
Hi there I need to store additional attributes on join table. Searching the Wiki [1] revealed two possible methods: 1) push_with_attributes, as described by Justin Palmer [2]. Unfortunately, "this method is now deprecated" [3]. Even if it wasn''t, there seem to be inherent problems with that approach, for example with updating those additional attributes, though Joshua Muheim
2006 Jul 15
2
find() with id array - can i preserve the ordering?
Sort of a newbie question - sorry if it''s been asked before and I missed it in my search. I have an id_array of Author ids, and I want to retrieve the associated Author models as quickly as possible, but also preserve the ordering of the id_array. Using Author.find(id_array) returns the records, but not in the same order. Is there some flag I can pass to find() to preserve the order? I
2006 Jun 27
3
Trunk or 1.1?
If you were launching a site in late September, would you be developing with Rails 1.1 or on edge rails? Joe