Displaying 20 results from an estimated 3000 matches similar to: "foreign_key setting ignored"
2006 Jan 13
4
Single Table Inheritance (this is my 3rd post :( )
Hi Everyone,
I hope I get some feedback on my question. Here it goes.
I have a situation here, I have a company table and then using Single
Table inheritance it is of 3 types:
class Company < ActiveRecord::Base
end
class Vendor < Company
end
class Customer < Company
end
class Agent < Company
end
Now I have a active record Association
class QuoteSheet < ActiveRecord::Base
2005 Aug 19
2
data validation
I''m trying validate date before they''re stored into the DB, but it seems,
validation doesn''t work..
my model looks like this:
class Company < ActiveRecord::Base
has_many :contacts,
:foreign_key =>''company_id''
has_and_belongs_to_many :categories, :join_table => ''company_to_category'',
:foreign_key =>
2006 Apr 07
6
Foreign Key naming convention override
I am working with an existing database and have to keep all table and
field names as they are. ''tblcustomers'' and ''tblitems'' are linked by the
''tblcustomers'' id field ''tblcustomersid''. In ''tblitems'', the foreign key
is called ''txtcustomerid''.
I have already set the customers model to
2006 Mar 07
6
fcgi dispatcher crashing
I''m trying to set deploy an app on apache2 with the fcgid module, but can''t
seem to get anywhere.
Things work fine with cgi, but when i switch to fcgi, i''m stuck with a ''503:
Service Temporarily Unavailable''. There''s no error being logged anywhere,
afaik.
Trying to run dispatch.fcgi from the shell doesn''t work either. It bombs
out,
2006 Aug 02
2
Self-Referential has_many :through
Hello all.
I am trying to create a self-referential has_many :through. I used the
following site as a guide
http://blog.hasmanythrough.com/articles/2006/04/21/self-referential-through
but it still doesn''t appear to be working. I have two models. Person and
Relationship. A person has many contacts (Which is another person)
through relationships
class Person < ActiveRecord::Base
2011 Feb 09
3
Loop in variable names
Hello!
I would like to do some tables for several variables and I would like to write a loop that does the table for each variable. I should also point out that my data set has several missing observations and sometimes the observations that are missing are not the same for all my variables.
What I would like to do:
table(StoreData$CompanyID,
!is.na(StoreData$P2))
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a
terrible time getting the models set up correctly. I have an order
table that has a primary field named order_number. I have a name table
with a primary of item_number. These two tables are liked by the
item_number and the order_number, but not as you might think. If the
order_number is 2500, then each entry in
2005 Nov 16
1
HABTM: deleting records based on attributes
Hello All,
I am new to ROR, and can''t seem to get HABTM to cooperate entirely...
however I might be abusing it! Before I try a different strategy I
thought I''d ask here and see if I''m missing something simple.
So say Projects and Companies are related. Projects can have multiple
Companies, and Companies can be on multiple Projects. But, the same
Company can also
2009 Sep 28
5
Multi-databases support
Hi,
While I was hacking ovirt-server, I have found that it's currently
restricted to Postgres DB. Even if I like postgres for serious work on a
server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
I have googled on rails in order to find a good answer for the "foreign
key problem" which forces OVirt to stay on pg. I have found a plugin on
this particular
2010 Aug 19
1
Composite primary keys and :joins=>
I have a legacy db with the following simplified structure:
Table-A:
type_key, code_key, name, ... # PKs are type_key and code_key,
there is no id col and I cannot alter this db
Table-B: # each row has only the code as a foreign_key, the type_key
is hard-coded to "FOOKEY"
an_id, code, ...
Models:
class TableB < AR::Base
set_table_name ''table_b''
2017 Oct 19
1
looping using 'diverse' package measures
Hi everyone,
I'm new at R (although I'm a Stata user for some time and somehow
proficient in it) and I'm trying to use the 'diverse' R package to compute
a few diversity measures on a sample of firms for a period of about 10
years. I was wondering if you can give me some hints on how to best proceed
on using the 'diverse' package.
My sample has the following setup.
2007 Dec 18
2
Active Resource and non default model names
I have a model (accessed restfully) named TranscoderQueue, it''s name
is overridden to ''TransocderQueue'' so it is accessed as ''/
transocder_queue'' as opposed to ''/transocder_qeueus''.
class TranscoderQueue < ActiveRecord::Base
belongs_to :campaign, :class_name => "Campaign", :foreign_key =>
"campaign_id"
2012 Jun 08
7
filter children with acts_as_tree
Hello Experts,
I have a tree of categories in this category object there is a property
called type.
the root categories have no type but the children have. so how I can get
all the roots with filled in children that have category type = ''B'' for
instance.
I tried to run Category.roots then delete children With a category not
equal to ''B'' but this causes a major
2010 Apr 07
3
match function or "=="
Hi all,
I have a huge dataset(5000k observations), which contains the daily sales
for each company.
If I want to find out the a company with unique company id number, which
function I should use that is more efficient, match or "=="? For example,
use<-dataset[!is.na(match(dataset$companyID, 12345)),]
or
use<-dataset[dataset$companyID==12345,]
Thank you very much.
--
View this
2008 Jan 23
1
Making Parents object attributes available
Hello,
I have a class Person
class Persoon < ActiveRecord::Base
set_table_name "Persoon"
set_primary_key "p_persoon"
has_many :adres, :class_name => "Adres"
composed_of :name, :class_name => Name, :mapping => [ [:naam,:naam],
[:voornaam,:voornaam], [:voornaam2,:voornaam2],
[:persnickname,:persnickname], [:perssortname,:perssortname] ]
def
2006 Aug 01
1
Legacy Pluralized Table Names
I am connecting to a legacy DB that has some names plural and some not.
I have configured:
ActiveRecord::Base.pluralize_table_names = false
now when i make a table that has an s on the end, it truncates the s.
example:
Table name: foo_bars
Rails command: ruby script/generate FooBars
Response (localhost:3000/FooBars): uninitialized constant FooBar
It works fine with non-pluralized
2011 Jul 14
10
Devise confusing routes
I had a similar problem yesterday.
I would go to the root of my site and I would get a Too Many Redirects
message. It seems like there was an infinite loop. After struggling for
over an hour yesterday late at night, it seemed like I fixed it.
But now, when I want to create a New User, it''s redirecting me to the
Sign In screen. Seems like I didn''t fix the problem completely.
I
2006 Jul 25
2
join in legacy DB?
I''ve got a problem with some tables that don''t follow any RAILS
standards. how do I define the join in the model when all three tables
have wacky names?
class Machine < ActiveRecord::Base
set_table_name "tbl_CodeMgmt_Host"
set_primary_key "Id"
end
class Pool < ActiveRecord::Base
set_table_name "tbl_CodeMgmt_Pool"
set_primary_key
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2017 Oct 19
1
looping using 'diverse' package measures
Hi everyone,
I'm new at R (although I'm a Stata user for some time and somehow
proficient in it) and I'm trying to use the 'diverse' R package to compute
a few diversity measures on a sample of firms for a period of about 10
years. I was wondering if you can give me some hints on how to best proceed
on using the 'diverse' package.
My sample has the following setup.