Displaying 20 results from an estimated 9000 matches similar to: "STI hiding attributes"
2008 Jul 20
10
STI and fixtures
Hi all !
Loading fixtures doens''t seems to associate my 2 objects, do know what''s
wrong ?
In app/
class Manager < Employee
has_many :employees,
:foreign_key => :reports_to
end
class Employee < Person
belongs_to :manager,
:foreign_key => ''reports_to''
end
class Person < ActiveRecord::Base
belongs_to :address
end
fixtures for
2006 Mar 19
1
some strange behavior for has_many with STI
Hi all,
I''m having some trouble with a has_many association on a table using
the single table inheritance model that I''m hoping someone can help me
with. The schema for the table is:
CREATE TABLE `comments` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) default NULL,
`type` varchar(20) NOT NULL default '''',
`type_id` int(11) NOT NULL default
2006 Apr 02
1
One to Many Relationship Issues
Hi,
I am having issues with a one to many relationship(it never works :-)).
Jokes aside, I am getting an error:
Mysql::Error: #23000Cannot add or update a child row: a foreign key
constraint fails: INSERT INTO adverts (`image_url`, `price`, `title`,
`website_url`, `description`, `user_id`) VALUES(''bb'', 22.0, ''aa'',
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my
models to try and get my head round it but I''m still struggling. I''m using
STI and trying to write tests for the extended models (code below). I''ve
written test cases for the extended models which themselves extend the test
case for the parent model, so BarTest extends
2006 May 19
2
Problems with belongs_to table joins
I am looking for a little assistance with a problem I have with a simple
table join using Rails. I am a relative newbie to both Ruby and Rails so
any help would be greatly appreciated . I have two tables products and
product_formats.
create table products (
id int not null auto_increment,
title varchar(100) not null,
product_format_id integer
2006 Jan 13
0
Form element that is not an AR object attribute
Fellow Railers,
I don''t know how to handle this kind of situation the Rails way, please help.
DB
----
create table products (id int not null auto_increment, name
varchar(255), primary key (id));
create table batches (id int not null auto_increment, product_id int
not null, quantity int not null, price decimal(10,2) not null, primary
key (id), foreign key (product_id) references
2006 Jun 18
2
Table Relationship for Select option list
I''m pretty new to developing web apps and need help with my database
table design. I''m working on an inventory application to manage WLAN
hardware. I''ve created a table to hold information on each device with
the following (model refers to the manufacturer''s model number):
create table devices (
id int not null auto_increment,
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now
trying my first little app to get into the swing of things. Its a task
tracking app where people can create tasks and assign them to others,
and also log time against the tasks.
I''m having trouble working out the model relationships. This is what
I''ve got so far, but its not right as
2006 Apr 26
1
rake db_schema_dump make syntax error
rake migrate bug with datetime:
> rake db_schema_dump
produced a bad schema.rb that isn''t valid ruby, it has an invalid default, unless ruby
takes bare words:
t.column "date_available", :datetime, :default => Sun Jan 01 00:00:00 Arabic Standard
Time 2006, :null => false
I don''t think the Baghdad time zone should matter.
ruby 1.8.4, rails 1.1.2,
2006 May 30
3
Help about CMS - newbie in RoR
Hi team, I''m a very newbie RoR user from Spain and I''m developing a
blog''s CMS. Why RoR?, coz I think it''s an amazing framework with many
posibilities, portable and really powerful, with a young and optimist
community, and taking my project I''ve prefered his structure in front of
LAMP. Another thing is that I''ve liked to surprise my masters
2010 May 01
1
I need some help joining data from 3 MySQL tables, please
Hi all,
I am trying to display collective data from 3 MySQL tables:
The query I have, so far, is
SELECT c . * , COUNT( m.id ) AS `members`
FROM `jos_mls_teams` AS `c`
LEFT JOIN `jos_mls_teams_members` AS `m` ON m.teamid = c.id
RIGHT JOIN ( SELECT u.name, u.lastvisitDate FROM `jos_users` AS `u` )
ON u.id = m.userid
GROUP BY c.id
LIMIT 0 , 30
But get the following error:
#1248 - Every derived
2007 Jan 20
3
Making tables with SQLight
Hi, Im using locomotive and running SQLight. Im confused about making
tables with sqlight.
Im following the depot example from ''agile web development with rails''.
When trying to make the table ''products'' is there a difference when
using SQLight rather than MySQL?
Here is the DDL for MySQL, how do I make this table with SQLight?
-
drop table if exists
2006 Apr 02
0
STI and through
I''m trying to understand how to do the following, but am finding myself stuck.
I have three main tables; here are the first two:
CREATE TABLE reference_items (
"id" integer primary key,
"type" varchar(20),
"title" varchar(255),
"year" year(4)
);
CREATE TABLE "agents" (
"id" integer primary key,
"type"
2015 Feb 11
0
Invalid password in passdb: Not a valid MD5-CRYPT or PLAIN-MD5 password
Hi friends,
I am migrating imap-courier to dovecot, I use openbsd+postfix+imap-courier,
and now I'm trying to run openbsd+opensmtpd+dovecot.
In the beginning it was a little traumante but it works OpenSMTPD correctly.
Now I have configured dovecot, and I hope that your backend
authorization is the
same database that was used imap-courier.
In /var/log/maillog receipt the following error
2007 Aug 05
0
Newbie - Question on Parent child updating
All,
I''ve just started Rails and Ruby a week or so ago. Please forgive me
for my ignorance. I started writing a small test application to test
some of my new knowledge and have hit a wall. Would like some best
practices.
I have 3 tables, as below...
CREATE TABLE `carts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY
2006 Aug 13
1
Using ENUM column in table
Hi,
When I create a table with one column of type ENUM and then generate
scaffolding for the model and controller the ENUM column isn''t shown as
a drop down in the edit view. It just shows the column name and that''s
it. Am I missing something?
Here''s the SQL for the table:
drop table if exists products;
CREATE TABLE products (
id INTEGER UNSIGNED NOT NULL
2006 Jun 27
1
Help me, I stuck ..
I have three tables and is not allowed to change data scheme:
CREATE TABLE `applicants` (
`id` int(10) unsigned NOT NULL auto_increment,
`fullname` varchar(60) NOT NULL default '''',
`address` varchar(60) NOT NULL default '''',
PRIMARY KEY (`id`)
) ;
CREATE TABLE `positions` (
`id` int(10) unsigned NOT NULL auto_increment,
`position_name` varchar(30)
2004 Dec 14
3
sip_buddies mysql table
Not being an asterisk expert, but having been around
the block once or twice when it comes to data and the
like, I have made some observations based on the examples
given on voip-info.org Sip configs.
it appears there is an adjustment to be made in
the sip_buddies example table:
>>> name
Although set to 30 characters, I don't see where it is
limited in the text file. In theory,
2004 Jan 12
2
LCR / Trollphone Rate Engine
Hi. Thank you to Olle, the Wiki, and Trollphone. I found the Trollphone Rate Engine listed on the Wiki at:
http://www.voip-info.org/wiki-Asterisk+addon+rate-engine
I'm not familiar with LCR yet, but this is something that I need to do. I have it all installed but am not familiar with the terminology. Can someone help me maybe figure out what some of these fields are for?
mysql>
2005 Dec 11
1
how to use MySQL-backend !?
Hi,
i want to run a standalone-samba-PDC with a mysql-passdb backend and i
configured the mysql-database as required.
but how should i add/remove users ?
when i try
smbpasswd -a username
most columns in database have [NULL] values
i also tried pdbedit but it exits with "No user SID retrieved from database!"
is there another tool to add/remove users ?
is my smb.conf ok, or do i need to