Displaying 20 results from an estimated 4000 matches similar to: "listing parents from child conditon"
2006 Jul 31
2
ambiguous column name in has_many :through
In my application model I have three classes: Accounts, Projects, and Items
class Accounts < ActiveRecord::Base
has_many :items, :through => :projects, :source => :items
has_many :late_items, :class_name => ''Item'', :through => :projects,
:conditions => [''due_on < ?'', Time.now], :source => :items
end
class Projects <
2006 Apr 11
5
multiple select_tag
Hello again,
I have a table called line_items, with the following fields:
id int
item_name varchar()
qty int
conditions text
I''ve made my LineItem model, and everything works as such (with simple
text_fields)..
Now I''d like for the conditions field to be a select_tag() with multiple
choice possibility.
I''m guessing I need some code to expand/restract the array for
2018 Mar 28
0
[PATCH] drm/nouveau/bios/init: fix spelling mistake: "CONDITON" -> "CONDITION"
From: Colin Ian King <colin.king at canonical.com>
Trivial fix to spelling mistake in warning message text
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
2019 May 14
2
[PATCH] drm/nouveau/bios/init: fix spelling mistake "CONDITON" -> "CONDITION"
From: Colin Ian King <colin.king at canonical.com>
There is a spelling mistake in a warning message. Fix it.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
2012 Nov 21
1
Listing elements of a 4D array
Dear list,
I'm having trouble to see how my elements on a 4 dimensional array are
listed.
For example, I generated the following array:
junk.melt=melt(occ.data,id.var=c("Especie", "Site", "Rep", "Año"),
measure.var="Pres")
y=cast(junk.melt, Site ~ Rep ~ Especie ~ Año)
Now, I want to be able to look at how my species (Especie) are listed, in
2006 Jul 17
2
count and result
What is the equivelant of the following SQL in rails:
SELECT person, count(person) as occurance FROM invoice GROUP BY person;
This would give something like:
Person | Occurance
--------------------
Bill 1
Joe 15
Carlos 7
etc etc..
It seems the fx. Person.count(..) will only yield the actual occurance,
but not listed with the actual person - and Person.find(..) will not
2006 Jun 23
2
Foreign key - relations
Hello,
I''ve got DB like this:
(roughly)
create table projects (
id int auto blabla,
name varchar(200),
user_id int,
sales_id int);
create table users (
id int auto..,
name varchar(50));
So project.user_id has a foreign key to user.id - all is good.
Everything works fine.
Now my question..
How can set a relationship from two different fields to the users table
??
Fx.
2013 Jan 04
3
help "reshaping" dataframe
List,
I want to reshape my data, but I'm not sure how to do it... it might be a
simple task, but don't know which package does this.
"occ.data" (see below) is how my original data are arranged, and I know
that with melt() I can reshape it like "y" (see below). However, I just
want to build a matrix like the "y" matrix, but with only 2 dimensions.
Something
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 Mar 13
7
Wilcard search
Hello,
I''m writing a search function for my application, but I am unsure on how
to search for all results that contain my search string; here''s what
I''ve got:
def search
@products = Product.find(:all,
:conditions => "date_available < now()",
:conditions => [ "title ilike ?",
2006 Apr 05
7
select_tag - populating options
Hello,
I want to a select tag, where you can choose a number between 1 and 100.
My inital code is based on the examples from Agile Web Development with
Rails, and looks like this:
view:
<%= options = [["Select number of lines", ""]] + RfqLines::LINE_QTY
select("rfq_line", "line_qty", options) %>
model:
LINE_QTY = select_fill
def
2006 Mar 07
6
Flickr - Tutorial
So I''ve pretty much followed the steps in the video tutorial on RoR.com
for creating a small app, to search for photos on flickr.com - all is
good, and works as intended to..
How would I go about adding validation, so if no tags are specified it
will fail. I know I have to use validates_presence_of :tags - but not
in the controller.. so I tried to generate a model called
2003 Jul 09
7
Asterisk basic how-to on O'Reilly's site
This was published on O'Reilly's site last week, but they didn't tell
me until now. :) The article is pretty minimal, because I had a
limited number of words to work with, so many features are not
implemented. However, it's a good start.
http://www.onlamp.com/pub/a/onlamp/2003/07/03/asterisk.html
I had a few people review it beforehand, but I'd also welcome changes
or
2005 Jul 25
2
acts_as_tree and traversing parent/child relationships
I am working on an Rails application that uses a pretty complex
category structure through out the site. I have defined a table to
house all the info and a FK to reference parents within the table
CREATE TABLE categories (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL,
parent_id int(11) default NULL,
constraint fk_category_id foreign key (category_id) references
2017 Oct 18
3
Status of OpenSSL 1.1 support - Thoughts
As far as I can see, here is a summary of the situation, and there's a
point to this, but I only make it in step (4), needing the first three
steps to set up a background to keep my own thoughts clear:
1) Fedora (via Jakub) shows it's possible to patch OpenSSH.
2) OpenVPN (via gert) shows it's possible to build a 'shim' of sorts
that allows code to work with libreSSL and
2006 May 31
3
textfield_with_auto_complete - filling two fields
I am going nuts here..
I have a form where users can write a city name (used with
auto_complete) - and once they click on the desired city in the dropdown
menu - I would like to have the Country field filled automatically as
well...
Is this possible at all ?
If so, can somebody please tell me where I can find some documentation
on the subject, or preferrably an example ?
Many thanks in
2008 Jan 02
1
wants to get all parents with no children, etc
To all:
hi,
i have implemented the associations in my models
so i have a Parent model that has many Children model
but i need to get a list of Parents that do not have children
or
Parents that have just 2 children
or Parents that have children whose name is ''James'', or ''Sarah'', or
''Betty''
or Parents whose children do not have names like
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated.
Which is a bit of a shame, given the stuff I''ve been writing recently.
I have a CMS with multiple clients. A ''client'' is essentially a
company, with multiple users. Content on the site belongs to a client
- content could be messages, images, schedules, etc etc. People
belonging to one client should not be able
2007 Mar 06
2
New eudora problem - "mswmsg" not supported
I just upgraded from v0.9.9 to v0.9.32 (on Ubuntu 6.06) and Eudora Pro v4.2
stopped working. It no longer opens a mailbox when the icon is clicked. The
log shows "fixme:rpc:alloc_serverprotoseq protseq "mswmsg" not supported"
each time I click to open a mailbox.
This was working on v0.9.9 so I am looking for ideas as to how to work
around this problem. There is a bug
2006 Apr 06
3
Inserting parent_id
I have two tables:
- projects
- lines
lines has a foreign key constraint to projects.id
When I''m creating a new line object, the database fails on insert with
the following error:
"PGError: ERROR: null value in column "project_id" violates not-null
constraint"
My code looks like this:
def create_lines
@project = params[:id]
@line =