Displaying 20 results from an estimated 659 matches for "group_id".
2010 Sep 06
1
nlme Output
Everyone -
What do the NaN's mean here? Is this analysis a problem?
Linear mixed-effects model fit by maximum likelihood
Data: tmp.dat
AIC BIC logLik
1611.251 1638.363 -797.6253
Random effects:
Formula: ~1 | group_id
(Intercept) Residual
StdDev: 0.0003077668 9.236715
Fixed effects: AvgTrials ~ time + factor(group_id) + time *
factor(group_id)
Value Std.Error DF t-value p-value
(Intercept) 18.159722 3.576664 213 5.077279 0.0000
time 4.19270...
2006 Jun 29
7
sql question for rails
Hi,
i was hoping someone could help me out with a small yet quite
time-boggling task...i have a two tables users, groups joined in as a
habtam relashinship (has and belongs to many) and i need to select from
the mydb (mysql if it matters) users out of the User model, in
accordance with TWO groups in one rails opperation to improve
performance...basicly, say i have ten groups and ten users,
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 :groups
end
i want this http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo
with ajax, first column the us...
2006 Sep 25
2
@article.article_groups.delete_if... Dosn't work!
If I try:
@article.article_groups.delete_if {|x|
x.group_id == x.group_id
}
It does nothing.
If I try:
articletmp.article_groups.each{ |x|
@article.article_groups.delete(y)
}
It deletes some of the groups.
@article.article_groups.clear
works.
Why dosn''t the to first examples work as expected??
Do I have to put group...
2006 Feb 14
0
rubyforge-0.1.1
...in()
sends username and password from config.yml (or --username/--password
options) and stores login cookie in cookie.dat. this is required for
subsquent operations work.
example :
rubyforge login
rubyforge login --username zaphod --password 42
create_package(group_id, package_name)
creates the named package under the specified group.
example :
rubyforge create_package 1024 traits
rubyforge login && rubyforge create_package codeforpeople.com traits
notes :
in order to use group_ids by name, rather than number, you mu...
2006 Jan 22
2
suggest for "ambiguous column" when JOIN associated tables
Today I face with incorrect behavior in ActiveRecord.
It take place when I try to use :include parameter for .find method.
Where are two typical cases:
1. You have record with self-referential joins
CREATE TABLE keywords (id, group_id);
class Keyword < ActiveRecord::Base
belongs_to :group,
:class_name => "Keyword",
:foreign_key => "group_id"
end
2. Your record has two associations with the same table
CREATE TABLE artworks (id, author_id, agent_id);
class Artwork <...
2006 Feb 21
6
Select articles from group with id ''1'' and id ''2''
...y (id)
);
CREATE TABLE groups (
id int auto_increment,
name varchar(16) NOT NULL,
description varchar(32) NOT NULL,
constraint fk_items_users foreign key (user_id) references users(id),
primary key (id)
);
CREATE TABLE article_groups (
id int auto_increment,
expires_date datetime,
suspend datetime,
group_id int NOT NULL, # FOREIGN KEY groups.id,
article_id int NOT NULL, # FOREIGN KEY articles.id
constraint fk_items_groups foreign key (group_id) references
groups(id),
constraint fk_items_articles foreign key (article_id) references
article(id),
primary key (id)
);
- Henrik
2006 Jan 25
1
Rails day 2: where is my association?
...get data" and what
part is "here we format data"
anyway...
Here?s the setup:
CREATE DATABASE `rpms_development` ;
use rpms_development;
CREATE TABLE `packages` (
`id` INT( 255 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 255 ) NOT NULL ,
`version` VARCHAR( 255 ) NOT NULL ,
`group_id` INT( 255 ) NOT NULL ,
`notes` TEXT NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = innodb;
CREATE TABLE `groups` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = innodb;
INSERT INTO groups (name) values ("Development");
INSERT INTO grou...
2006 Mar 29
3
Self-referential many-many joins with :through
...*******************************************************
class Topic < ActiveRecord::Base
has_many :item_collection, :class_name => "Grouping", :foreign_key
=> "item_id"
has_many :group_collection, :class_name => "Grouping",
:foreign_key => "group_id"
has_many :groups, :through => :group_colletion
has_many :items, :through => :item_collection
end
**********************************************************************************
***********************************************************************************
class Grouping...
2006 Aug 01
2
has_many :through a belongs_to relationship
...o
a group. I want to use a has_many through association to link the room
and the users as such:
class Room < ActiveRecord::Base
belongs_to :group
has_many :users, :through => :group
end
The SQL generated for the search is incorrect:
SELECT users.* FROM users INNER JOIN group ON users.group_id =
groups.id WHERE (groups.group_id = 2)
The WHERE clause looks for group_id within the groups table when it
should be looking for just id. It uses groups.id in the inner join, so
I don''t understand why it is wrong in the WHERE clause. Do I need to
specify something?
Thanks in ad...
2006 Apr 17
1
database design Q
I am in the middle of setting up mysql database for my RoR application.
and here is some questions in my mind hope you can help.
1. this is a photoblog story telling like system, where people can creat
their own groups
the database tables are: people, groups, articls, pictures
People to Groups are many-to-many relationships
People to Articles are one-to-many
Group to Articles are one-to-many
2006 Mar 26
9
validate_uniqueness_of {combination of fields} ???
I''ve looked at the validates documentation and it appears that validates_uniqueness_of works on only one field at a time. So I can, for example, validate that "sam" is unique to the record set, and that "smith" is unique to the record set.
My problem is that each record includes two fields, the _combination_ of which must be unique to the record set, but each of
2007 Sep 13
5
refreshing indexes?
...n these from the list.
A bit of a background. My app will have 10,000 - 50,000 documents.
These are ''owned'' by users and the groups they belong to (like a file
system). So the queries will have to be restricted to those documents
owned by the groups the user belongs to. I have a group_id in each
record and the session has the group_id''s of the groups the user
belongs to in an array.
Question 1:
If I add acts_as_ferret :fields => [:group_id, :document_text] can I
do an activerecord search like...
Document.find(:all, :conditions => [''group_id in (?)''...
2010 Nov 18
1
lme Random Effects and Covariates
...a on
subject (grid) but want to use lme to build the model without subject as a
RE then add it and do anova between the 2 models. This is the result I get
and it appears it's adding Random Effects.
tmp.dat4 <- groupedData(Trials ~ 1 | grid, data = tmp.dat4)
mod2a <- lme(Trials ~ factor(group_id) + reversal, data = tmp.dat4,
na.action = na.omit, method = "REML")
> summary(mod2a)
Linear mixed-effects model fit by REML
Data: tmp.dat4
AIC BIC logLik
4544.054 4587.718 -2262.027
Random effects:
Formula: ~factor(group_id) + reversal | grid
Structure: General p...
2008 Jun 06
2
joining tables
Hi
I have 3 tables as
1) user_groups
id | contact_id | group_id | group_user_type_id
2) contact
id | name_first | name_last |
3)contact_email_addresses
contact_id | contact_email_address_type_id | emailaddress
Now I have group_id sa for example 68
What I want is from contact_email_addresses table get all the
emailaddress with contact_email_addre...
2008 Oct 15
1
dbAppy questions/clarifications
...39;. What is it?
Suppose the function I want to apply is "fitdistr(x,"exponential")". Would
I just replace "quantile(x$DATA, names=FALSE)" by
"fitdistr(x,"exponential")"?
Finally, suppose the query I need to run is more complex, such as:
SELECT group_id,YEAR(my_date),WEEK(my_date),ndays FROM myTable ORDER BY
group_id,YEAR(my_date),WEEK(my_date);
Can dbApply handle applying "fitdistr(x,"exponential")" to each group of
values defined by "group_id,YEAR(my_date),WEEK(my_date)"? If so, how would
I change the call to dbse...
2006 Aug 08
3
problem inserting parameters in link_to_remote
...to the group, or drop an existing name from the group.
But.
If I add a person to the group, and try to remove
without refresh, it doesn''t work. My link is formed
by <%= link_to_remote ''add'', :url => { :action =>
"remove_member", :id => person.id, :group_id =>
group.id"} %> For a member who''s in the group when I
reach the page, that generates a call to
/controller/remove_member/person.id?group_id=group.id
as it should. But if I add a member ''foo'' to the
group and then try to remove the same person, the call
is c...
2009 Feb 04
2
delete_if does not work on associations
...ent => :destroy
has_many :users, :through => :memberships
...
end
This is the controller method, trying to use delete_if. Although some
elements are removed (s2 < s1), the save method does not update the
association.
def intersect_or_remove_group
other_group = Group.find(params[:group_id])
s1 = @group.users.size
case params[:submit]
when "Intersect"
@group.users.delete_if { |u| !other_group.users.include?(u) }
when "Remove"
@group.users.delete_if { |u| other_group.users.include?(u) }
end
s2 = @group.users.size
if...
2010 May 31
5
ActiveRecord model relationship with YAML file
Hi,
I have an ActiveRecord model Group and a YAML table stored in
config/users.yaml just like:
- {login: titi, password: 123456, group_id: 2}
- {login: toto, password: 987654, group_id: 7}
And I would like to link them by a sexy way. Can you help me?
I would be happy if I can do this (as example): User.first.group.id # =>
2
Many thanks for any help!
--
Posted via http://www.ruby-forum.com/.
--
You received this message...
2007 Aug 24
2
SURVEY: wxRuby API style
Hi
As we''re getting closer to a stable release of wxRuby, I''d like to get
your views on the API style. There''s a survey here:
http://rubyforge.org/survey/survey.php?group_id=35&survey_id=66
I''d like to know if you''d like to see two wxSugar syntax features become
part of core, standard wxRuby version 2.0. These are:
1) Allow ruby-style accessors as well as C++ style getters/setters. This
means you can write
frame.title = ''my frame'...