similar to: STI and through

Displaying 20 results from an estimated 3000 matches similar to: "STI and through"

2006 Apr 09
4
Inheritance via Though Associations?
I posted something about this a week ago wihtout response, but have made some progress since. However, I''m still not getting exactly what I want. OK, three core tables: create_table :reference_items do |t| t.column :title, :string, :limit => 255 t.column :year, :integer, :limit => 4 t.column :type, :string t.column
2005 Dec 10
0
Paginate - Count(*) Broken or Am I Cheating?
I have the following paginator setup: @merch_pages, @merch = paginate :merch_item, :per_page => 15, :select => ''DISTINCT mi.id, mi.merch_image, mi.created_at, mi.artist_id, mi.item_description, art.sort_name'', :join => ''as mi JOIN merch_formats mf ON mi.id = mf.merch_item_id JOIN artists art ON mi.artist_id = art.id'', :order =>
2006 Apr 22
6
STI and type tables?
So by default to get STI, I would have something like: create_table :items do |t| t.column "type", :string t.column "title", :string end But if I want to store those type values in a separate table, such that I have ... create_table :items do |t| t.column "item_type_id", :string t.column "title", :string
2006 Jul 28
0
STI hiding attributes
I''ve written an extension to AR to allow hiding of attributes(aka columns) in AR objects. If there''s interest in it I''ll roll it up into a plugin. Here''s an example: (straight from Agile Web Dev) # The table create table people ( id int not null auto_increment, type varchar(20) not null, /* common attributes */ name varchar(100) not null, email
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 Jan 22
2
suggest for "ambiguous column" when JOIN associated tables
Today I face with incorrect behavior in ActiveRecord. It take place when I try to use :include parameter for .find method. Where are two typical cases: 1. You have record with self-referential joins CREATE TABLE keywords (id, group_id); class Keyword < ActiveRecord::Base belongs_to :group, :class_name => "Keyword", :foreign_key =>
2009 Nov 25
1
Puppet custom functions and user permissions
Puppet custom functions and user permissions I am busy writing a custom function to automatically add OSSEC agents to a OSSEC server after installation. Unfortunately, it seems that puppetmasterd is not respecting the entries in /etc/group in linux. No matter how many other groups the puppet user has been added to in /etc/ group, when puppetmasterd runs the custom function the effective/real user
2007 Jun 20
0
WHAT happened to AgentMonitorOutgoing(c) in Asterisk 1.4.5 ??
Recently installed 1.4.5, and still unfortunate to find out that the 'c' option in AgentMonitorOutgoing() still doesn't work ('c' - change the CDR so that the source of the call is 'Agent/agent_id'). It wont change the source channel column in the CDR to 'Agent/agent_id' like it used to in 1.4.2 and other releases older than that. I hope this gets fixed in the
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
2009 Oct 04
3
Problem using ActiveRecord find with :joins and :select
Hi guys, When I do: temp = User.find(:all, :joins => "INNER JOIN contents ON users.agent_id = contents.id", :select => "contents.id, users.id, users.u_date") temp.first.inspect It seems to work fine, but it only returns: #<User id: 6, u_date: "2009-10-03 19:32:23"> but not the contents.id information. I
2007 Apr 14
0
has_one with reference to the one stored in this object's table?
I''m trying to build a system for generically storing an object graph, on top of AR itself. The idea is to define one base class, and use AR''s automatic single table inheritance to have it create the right class. Here''s what I have so far: table generic_objects: id int(11) not null auto_increment primary key type varchar(255) table generic_fields: id
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
2007 Aug 09
1
usage of each field
Hi all, From the web, I can find a table scheme of sipusers for ARA using. However, I can't find any meaning of each field, especially for the field regserver which is new in the table. Can any tell me more detail about the usage of each field? CREATE TABLE `sip_buddies` ( `id` int(11) NOT NULL auto_increment, `name` varchar(80) NOT NULL default '', `host` varchar(31) NOT NULL
2006 Mar 21
0
SIP Realtime 1.2.5 and Username/auth name mismatch ?
Hello, I installed 1.2.5 and realtime SIP. The connection to the DB is OK because I can get the values from the CLI. Here are my 3 different cases: 1- If I put an unexisting user, I get 404 and I am not able to dial. 2- If I check "Disable registration" within Firefly it does not register but I am able to dial a destination (...) 3- If I leave registration ON, I get the 404 message
2004 Dec 14
2
Asterisk Realtime IAX - Adding fields for database table
Hello, Right now there is not a table build script at: http://www.voip-info.org/wiki-Asterisk+RealTime+IAX Therefore I have taken the SIP build script and added a few fields that I use from my iax.conf (could be more out there, please see the complete build script below): `dbsecret` varchar(100) default '', `notransfer` varchar(100) default '', `inkeys` varchar(100)
2004 Dec 21
3
What is sip-friends.sql??????
maybe a dumb question but what do we have here??? sip-friends.sql # # Table structure for table `sipfriends` # CREATE TABLE `sipfriends` ( `name` varchar(40) NOT NULL default '', `secret` varchar(40) NOT NULL default '', `context` varchar(40) NOT NULL default '', `username` varchar(40) default '', `ipaddr` varchar(20) NOT NULL default '',
2005 Mar 24
1
realtime - unable to find key
ok so my table looks like this... REATE TABLE `sip` ( `id` int(11) NOT NULL auto_increment, `name` varchar(80) NOT NULL default '', `accountcode` varchar(20) default NULL, `amaflags` varchar(7) default NULL, `callgroup` varchar(10) default NULL, `callerid` varchar(80) default NULL, `canreinvite` char(3) default 'yes', `context` varchar(80) default NULL, `defaultip`
2002 Jul 18
2
RODBC and Excel Files
Hello, I am trying to play with RODBC library and Excel Files. In my file (doubs.xls) there are 2 spreadsheets: > library(RODBC) > connection<-odbcConnect("Excel Files") > sqlTables(connection) TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS 1 F:\\Th?se\\R\\Doubs NA Faune$ SYSTEM TABLE NA 2 F:\\Th?se\\R\\Doubs NA Milieu$
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 Dec 14
3
Problems with app_realtime
It seems that when setting qualify = 200 or qualify = yes in the database for a sip friend/peer, RealTime does not update the registration status like it should. I also have several peers which have been offline and Asterisk still reports them as registered, even though the registration seconds are only 200. Asterisk Ver: CVS HEAD 12/1/2004 Layout of sip_buddies: mysql> describe