Displaying 20 results from an estimated 7000 matches similar to: "existing magic to prevent db redundancy?"
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2006 Jul 10
18
Deleting join association of has_many :through
I''m trying to use has_many :through, since my join model deserves being
more than just an intersection table.
But when I try to break the association, the break only seems
"temporary":
Let''s say my two tables are Users and Colors, and the join model is
Favorites.
user = Users.find(1)
user.colors.length
>> 2
c = user.colors.first
>> #<Color:....>
2004 Dec 29
3
inclusion of figlet source
Why is figlet source included in xen? Wouldn''t it make more sense to alter
xen/Makefile, to have compile.h built from a .in, and the figlet view of the
version info, and have the upstream developers regen the figlet part when the
version changes?
I''m willing to modify the build system to do this. I''m also fixing several
other poor implementation of things.
2013 Sep 12
10
[PATCH] xen/build: Remove hacked up version of figlet
This hacked up version of figlet contributes a supprisingly large proportion
of the Coverity issues found under xen/ (and therefore attributed against Xen)
Figlet can be found in all distros, so make use of it.
We keep xen.flf (being the Xen figlet font) and replace the hacked up octal
transform with a short python script.
The Xen Makefile has been tweaked in such a way that it still prints the
2008 Feb 28
2
change drop down list to radio buttons
In my RoR app I would like to change a drop down list, which dispays a
list of colors selected from the database. Instead I would like to
create a radio button for each color. The user is allowed to check one
color and this will be saved back into the database as the color for
this user.
I don''t know how to do this. Currently it looks like this:
<%= select(:user, :color_id,
2006 Mar 22
3
Parent-Child Tables Help
can someone help me with this
i have a table
cars
(
id int
model_id int
make_id int
color_id int
description text
constraint fk_cars_carmake foreign key(make_id) references
carmakes(id),
constraint fk_cars_carmodel foreign key(model_id) references
carmodels(id),
constraint fk_cars_color foreign key(color_id) references colors(id)
)
carmakes
(
id int
carmake varchar
)
carmodels
(
id
2012 Sep 21
4
Good resource for the history of activerecord association method naming?
Someone asked me about the history of the method naming in activerecord and
I wasn''t sure where to point them. For example, there was early criticism
noted of has_and_belongs_to_many in this old post from 2005:
http://hans.fugal.net/blog/2005/10/03/habtm/
I was mentioning that many_to_many is not used because there are a few
different ways of doing that via has_many :through and
2006 May 05
6
PAE mode mismatch in Xen (xen=no Dom0=yes)
Hi,
I just added 32GB memory in my system and wanted Xen to see that memory, so enabled PAE in xen0 and XenU. I did a make menuconfig in xen0 and xenU, then did a make in xen-unstable and a make install.
Whilebooting this kernel, I get the above error PAE mode mismatch. I looked under xen/include/asm-x86/processor.h has #define X86_CR4_PAE defined and so does cpufeature.h have this defined.
2005 Oct 06
3
Xen unstable/SuSE 9.3 install issue
Hi,
I have successfully installed Xen unstable binary on SuSE 9.3. I am trying
to do a source install and I got the following error. Will be glad for any
help or guidance.
In file included from include/asm-xen/asm/processor.h:18,
from include/asm/thread_info.h:17,
from include/linux/thread_info.h:21,
from include/linux/spinlock.h:12,
from include/linux/capability.h:45,
from
2006 Jun 14
3
Prevent duplicate HABTM associations
Hi,
I am trying to restrict duplicate has_and_belongs_to_many associations.
I tried to find support for a association validation for duplicates but
couldn''t find anything.
I understand I could use :uniq=>true on the model association but this
would only prevent it from displaying duplicates, I want to stop
duplicate associations being inserted in the first place.
I have a vague
2005 Oct 05
3
Shopping Cart: SKU and Product Confusion
Hi there,
I''m at a loss...
I was on the #ROR channel last night and spoke to a really helpful person
(Defiler) who gave me some direction on building a shopping cart.
Unfortunately, I wasn''t able to successfully get to where I need to go. This
is the predicament I am currently finding myself in:
I''m building a shopping cart for a client''s new website. They
2006 Jan 10
5
Noob ActiveRecord Join Question
I''m new to rails and ruby, and after trying to get this to work
correctly for hours, I thought I''d give this forum an try.
I''ve setup a trivial project just to mess around with Rails database
naming conventions and associations.
I''ve got a table called Pets, and a table called Types.
Pets contains a list of pets, Parky the cat, Daisy the dog, etc, And
Types
2006 Dec 02
2
Strict STI?
Is there a way to set the base class to abstract? or otherwise enforce
that no one can create a "Pet"?
Pet < ActiveRecord
Dog < Pet
Pig < Pet
I''ve tried:
class Pet < ActiveRecord::Base
validates_presence_of :type
end
but I get an error about
../vendor/rails/activerecord/lib/active_record/validations.rb:74:
warning: Object#type is deprecated; use Object#class
2008 May 13
0
[LLVMdev] Python bindings available.
On Tue, May 13, 2008 at 1:22 PM, Gordon Henriksen
<gordonhenriksen at mac.com> wrote:
> On 2008-05-13, at 02:12, Mahadevan R wrote:
>
> >>> That's not how the object works...
> >
> > Gordon, I think I can make it work if we have the following additional
> > function in LLVM-C:
> >
> > LLVMModuleRef LLVMGetModule(LLVMModuleProviderRef
2008 May 13
2
[LLVMdev] Python bindings available.
On 2008-05-13, at 02:12, Mahadevan R wrote:
>>> That's not how the object works...
>
> Gordon, I think I can make it work if we have the following additional
> function in LLVM-C:
>
> LLVMModuleRef LLVMGetModule(LLVMModuleProviderRef MP) {
> return wrap(unwrap(MP)->getModule());
> }
Can I ask, how general is your solution? I only intended to use this
2006 Jan 02
5
DB Modelling the Rails way - Opinions??
Hi,
I''m trying to figure the most efficient way to model the following. I
can think of at least two ways to relate the tables but from a
client/server perspective! I''m wondering how to best (and
elegantly)relate them from an AR perspective.
A project has many people,
A person can work on many projects at any time,
A project has many roles,
A role is performed by a person,
A
2006 Jun 19
6
SQL Search Qustion
I am working on writing a search method where a user can type a string
of words and I return all the objects that have fields that match all of
the words in one or a combination of fields.
Person
first_name
last_name
Pet
name
Person has_many :pets
I want to write some SQL so that if I search for "Tony AAAA" I will get
all the people who have Tony and AAA either in their
2006 Jun 26
8
[Semi OT] BlindDown and a floated div
I am using the drop shadow technique described at
http://www.1976design.com/blog/archive/2003/11/14/shadows/ to give
several of my divs drop shadows. That part works fine.
What doesn''t work so well is when I try to BlindDown a div in Firefox
and it ends up ignoring the content below it and just overlapping it.
In IE this problem does not occur. In Firefox the overlapping does
2003 Apr 11
3
summary.formula: method reverse does not use fun argument
hi,
recently i discovered the functionability summary.formula, awesome!
from the help page i understand that method=reverse allows to
summarize all variables on the right hand side of formula
(the help page on line 229 wrongly refers to the left? hand side variables)
in categories which are determined by a single left hand side
variable.
my problem is that the argument fun seems not to be
2008 Dec 18
1
inserting zero instances with zeroes in a matrix
Hi all,
Suppose I had the below example where a survey was carried out recording the number of each type of pet in each house
count<-c(2,1,2,1,2,3,4)
house<-c("house1","house1","house2","house3","house4","house4","house4")