Displaying 20 results from an estimated 400 matches similar to: "activerecord table help please"
2006 May 13
1
Rake clone bug?
Hi. I''m having a problem with my testing. The following table in my
development database (MySQL 4.1.12, InnoDB):
+-----------------------+------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+-----------------------+------------------------+------+-----+---------+----------------+
|
2006 Jul 08
1
conditional table association?
I''m using a db to log two types of events, link events and tag
events. At first I had two tables, link_events & tag_events, but this
seemed not very DRY because the only column that was different
between them was link_id and tag_id respectively. So I made these
tables:
events:
id int
user_id int
objtype_id int (holds ''1'' or ''2'' depending
2008 Feb 26
11
Is there way to trace memory in the dtrace ?
N_conreq:entry {
self->x=1;
calledaddr=(struct xaddrf *)arg3;
callingaddr=(struct xaddrf *)arg4;
trace(calledaddr->link_id);
tracemem(calledaddr->DTE_MAC.lsap_add, 80);
trace(callingaddr->link_id);
tracemem(callingaddr->DTE_MAC.lsap_add, 80);
}
0 -> N_conreq 255
2006 May 13
4
undesireable lazy loading
Hi,
My work with Rails has been fairly straightforward, until yesterday...
I''ve encountered rather a peculiar problem that I''m not able to solve
myself as a rails-newbie.
The model code looks like this:
class Link < ActiveRecord::Base
has_one :user_vote
end
class UserVote < ActiveRecord::Base
belongs_to :user
belongs_to :link
end
I have a SQL query that is
2005 Aug 06
1
Cisco 7206 and Sample configs (Newbie)
Newbie to Asterisk
I've been looking around for a little while, can't seem to find some sample
configs for using a Cisco 7206 as a gateway. The below link is an initial
plan of an Asterisk solution that may replace our Cisco Call Manager 3.1/
IPCC / IVR setup. We currently have all of the hardware below. Just take a
peak and see if there is anything that is off base. I don't know
2005 Mar 28
0
Handling return from modal pages on rails
Hi List,
I didn''t like the way store_location worked in rails. It doesn''t know
you''ve pushed the "back" button, and it always returns to the top of a
page. On a large page, the part you were looking at would no longer be
on the screen.
People try to deal with this using an AJAX hack, but it seems to me that
the proper way to fix it is to store the return
2006 Mar 07
7
m:n or multiple 1:n?
I have a Newbee question:
i have three tables and want to connect them. so is it stupid to make a
triple m:n (rails style xs_ys_zs) or do i have to make a new table
(newtable) where i got multiple 1:n?
the habtm (has and belongs to many) do only work proper to join two
tables, or i am wrong?
-jens
--
Posted via http://www.ruby-forum.com/.
2006 Jun 13
11
markaby
What''s the current status of Markaby? I''ve played with it a bit and
love it and am considering using it for a large project I''m starting.
If you''ve used it, I''d love to hear your comments!
Jamie
2005 Dec 31
0
Polymorphic many to many linking
Hi,
I''m trying to create a model where a few objects can all be linked to
each other through a central linking table. Table structure is like
this:
-- model class Computer
create table computers (
id serial,
description varchar
);
-- model Class user
create table users (
id serial,
name varchar
);
-- model class Desk
create table desks (
id serial,
location varchar
);
--
2008 Mar 14
2
Multiple should_receive(:render).with
I''m trying to specify that a particular view must render two different partials.
My spec looks like:
describe AClass do
it do
template.should_receive(:render).with(:partial => ''foo'', :locals => { ... })
...
end
describe ''some conditional case'' do
it do
template.should_receive(:render).with(:partial =>
2004 Jun 02
2
getting started on MacOS X
Hello -
I am attempting to test rsync on a series of 8 MacOS X servers. On my
initial test, I configured one machine as the "sender" and one machine
to "receive."
On the "sending" machine, I created an rsyncd.conf file. On the
"receiving" machine, I issued the command
rsync --daemon
To which I got no error messages.
On the "sending"
2006 May 07
6
Challenging SQL for you...
Gents,
My heads been out of the sql game for too long (or it''s simply too early).
I''m trying to extend the acts_as_taggable plugin (note: not gem) so that
you can specify a list of tags you''re interested in, and the plugin will
return only those items that are tagged with *all* these tags.
The plugin uses primarily two tables: tags, to keep all the various tag
2006 Aug 29
2
Excluding values from search term
I''m trying to do a search that would exclude a value from it and return
whatever results aren''t matched from the term, but it''s not working very
well.
None of these are working, they all return the results including the
ones with tag_id = 701
tag_id:(NOT 701)
tag_id:(! 701)
tag_id:(- 701)
But if I go the other way around it works (which I don''t want since
2007 Sep 05
1
AAF and DRb with highlighting
How would I change this method in order to get highlighting working with
DRb? I''ve given up on searching on Google, I''m getting no results that
are actually helpful.
def self.find_storage_by_contents(query, options = {})
# Get the index that acts_as_ferret created for us
index = self.aaf_index.ferret_index
results = []
default_options = {:limit => 10,
2006 Mar 31
7
problem with habtm conditions in pagination
Hello list,
I''ve had this problem for two days now. Perhaps someone here would
care to comment on it. I''d be REALLY appreciative if that''d be the case.
Basically, it''s outlined at this paste: http://rafb.net/paste/results/
kXQSHZ83.html
But I''ll paste it here, too.
The main problem is in the customers/list action. The problem is with
this line:
2006 Apr 12
1
Any case studies available for RoR implementation?
Hi,
I am doing a research project on application frameworks (specifically the
evaluation and selection of) and Rails is one of the key frameworks I am
evaluating.
Does anyone know of any case studies on RoR out on the Internet?
Is anyone prepared to write up a case study for me on a project that
succeeded thanks to the structure and dynamism of Rails? Only needs to be 1
page. Anyone who
2007 Jun 19
3
another issue with highlighting
Hi,
I''m encountering another highlighting issue.
(about the first one "range search and highlighting", i received no
response. I don''t even know if somebody tried to reproduce and/or if
it''s normal behavior)
about the new issue, an example will be easier for you to reproduce:
I''m filling an index with random data, i try to match for "*1*"
2006 Jul 31
1
How to get result of following SQL Query in Ruby?
Hi,
I have 2 tables as follows:-
_________________ ________________ ____________
taggings | |stores | | tags |
-----------------| |---------------| |------------|
--tag_id | |--store_id | |tag_id |
--store_id | |--store_name | |tag_name |
--user_id | |---------------| |------------|
-----------------|
Now I want to execute
2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but
please, try to read it. I have a simply blog, with posts and their
comments. I''ve two tables in my db, posts, with post id, text and
comments_count to store the number of comments-children of each post (as
recomanded to do in AWDWR); and the table comments, with comment id,
post_id for the post
2010 Feb 14
2
has_many :through eager loading only loading one record
Hello,
I''ve been using Rails for years, including has_many :through and eager
loading, but this one has me stumped.
The problem is that Active Record is only eager-loading the first of
many records. Here are the models (note set_table_name for a legacy
schema):
class Tag < ActiveRecord::Base
set_table_name ''tag''
end
class DishTag < Tag
has_many