Displaying 20 results from an estimated 2000 matches similar to: "Help with Self-Referential HABTM"
2007 Aug 02
2
STI functionality, but then with multiple tables
Hello,
I''m creating my own Tumblr [tumblr.com] like rails app.
It''s like a blog, but in this case a blog post could be of a certain
type, i.e. a regular post, a video, a link, a photo, a song(info).
Well now, it''s clear that they share a lot of similar functionality:
title, created_at/updated_at, commentable, probably has an author_id,
etc..
But besides that they are
2006 Mar 16
9
Help needed on STI syntax
Struggling a little with getting the syntax right for a STI model. Prob
just being a bit dense.
Couple of questions I''m hoping you guys can answer:
Assume here I''ve got:
class Person
class Manager < Person
class Slave < Person
1) How does person[:type] differ from person.type when type is the
column used to specify the subclass. They seem to output the same
2011 Mar 25
2
library(foreign) read.spss warning
I got the following:
> library(foreign)
> swal = read.spss("swallowing.sav", to.data.frame =TRUE)
Warning message:
In read.spss("swallowing.sav", to.data.frame = TRUE) :
swallowing.sav: Unrecognized record type 7, subtype 21 encountered in system file
>
The bulk of the data seems to read in a usable form, but I'm curious about what might be getting lost
2009 Jan 20
1
two-sample test of multinomial proportion
Hi all,
This is perhaps more a statistics question than an R question, but I
hope it's OK anyhow.
I have some data (see below) with the number of tests positive to
subtype H1 of a virus, the number of tests postive to subtype H3, and
the total number of tests. This is for two different groups, and the
two subtypes are mutually exclusive.
What is the best way to test if the proportion of H1
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
I am getting this error when trying to use the remove link explained
in the Railscast:
http://railscasts.com/episodes/197-nested-model-form-part-2
error:
$(link).previous("input[type=hidden]") is undefined
remove_fields()applic...1065175 (line 6)
function onclick(event) { remove_fields(this); return false; }()1
(line 2)
[Break on this error]
2013 Jan 05
1
[LLVMdev] LLVM triple and Apple ld64 behavior
Hello,
I wanted to know about the reasons Apple dropped the support for "arm" target in its ld64. After searching in the sourcecode I found out that ld64 supports armv4 armv5 armv6 armv7 and its subtypes. The code shows that -force_cpusubtype_ALL for ARM targets is no more supported in "src/ld/options.cpp") and static const ARMSubType ARMSubTypes[] doesn't include
2006 Mar 19
1
[LLVMdev] Idioms for retrieving global symbols and inheritance
Hello,
I have a couple of doubts, as listed below:
1. To list all the global variables in the module, I am iterating
using type_iterator and for each Type I get, I am using value_iterator
to iterate over Values . In the second iteration I am getting
unexpected results. For each type obtained from type_iterator->second,
value_iterator->first produces the same list as what
2006 Mar 15
5
acts_as_threaded - help ???
Hi, has anyone successfully used the acts_as_threaded plugin with
postgresql?
I''m using rails 1.0 and ruby 1.8.4 on linux.
Following the screencast on
http://www.railtie.net/articles/2006/02/05/rails-acts_as_threaded-plugin ,
I got to where we''re ready to create our first post, having made the
changes to controllers/posts_controller.rb, views/posts/_form.rhtml,
2013 Mar 24
5
Rails 4.0 has_many_through and fields_for
Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and
nested attributes.
class ControllerAction < ActiveRecord::Base
has_many :interactions, dependent: :destroy
has_many :roles, through: :interactions
scope :controllers, lambda {|name| where("controller_name_id = ?",
name)}
scope :actions, lambda {|name| where("action_name_id =
2018 Mar 07
1
Show all audiance in Icecast directory... cluster ?
Hello,
I installed Icecast 2.4.3 by downloading
http://downloads.xiph.org/releases/icecast/icecast-2.4.3.tar.gz
CentOS 7
Then
./configure
make
make install
Its working.
My only issue : I have 3 streams, I see the name of my station 3 times in
Icecast directory. I tryed to hide 2 streams by using the hidden and public
tags and force showing the total of audiance in the one public stream. i
2018 Jan 16
1
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
Hi Jean-Philippe,
On 17/11/17 19:52, Jean-Philippe Brucker wrote:
> When the device offers the probe feature, send a probe request for each
> device managed by the IOMMU. Extract RESV_MEM information. When we
> encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region.
> This will tell other subsystems that there is no need to map the MSI
> doorbell in the virtio-iommu,
2018 Mar 23
1
[PATCH 2/4] iommu/virtio: Add probe request
On 14/02/18 14:53, Jean-Philippe Brucker wrote:
> When the device offers the probe feature, send a probe request for each
> device managed by the IOMMU. Extract RESV_MEM information. When we
> encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region.
> This will tell other subsystems that there is no need to map the MSI
> doorbell in the virtio-iommu, because MSIs
2017 May 16
2
[IR question] Switching on pointers
Thanks everyone for your answers.
Mats, my goal is do an alternate implementation of the subtyping test
in the Pony compiler. I'll try to keep the explanation short to avoid
cluttering the mail with irrelevant information.
Every object in Pony has a type descriptor, which is used in the
subtyping test to determine the real type of an object. The current
algorithm is suboptimal and
2007 Jul 26
1
Bi-directional self-referential HABTM
Hi,
I''m having a little trouble figuring out how to make a self-
referential HABTM bi-directional.
I have a Employee class. Each employee can have a couple of bosses,
who are also employees. The employee class has the following HABTM:
has_and_belongs_to_many :bosses, :class_name =>
"Employee", :join_table => "bosses_courses", :association_foreign_key
=>
2008 Jan 23
1
Self-referential HABTM SQL mal-formed when updating record
Guys,
Anyone ever had this kind of problem with ActiveScaffold?
Cheers, Sazima
------------------------------------------------------------------------------------------------
What steps will reproduce the problem?
1. Create self-referential HABTM application (like the common "user
has friends" example)
2. Try to add more than 1 friend to a given user using ActiveScaffold.
What is
2006 Feb 25
0
self referential habtm using join tables
All:
I have been working on making a self-referential habtm relationship
that uses a join model because I want to store info about the
relationship. I have been using two sections from Chad Fowler''s "Rails
Recipes" as a guide, "Self-referential Many-to-Many Relationships" and
"Many to Many Relationships Where the Relationship Itself has Data".
So far I have
2004 Aug 27
2
read.spss warning: unrecognized record type??
When using read.spss (library: 'foreign') I get the following warning
message:
Warning message:
E:/R4win/mesamri.sav: Unrecognized record type 7, subtype 13
encountered in system file.
I don't see anything wrong with record #7 in the database I am trying
to read in, but I suspect that the warning message does not refer to a
specific record, but a "variable" type. Is this
2007 Oct 22
1
self-referential habtm: why are my keys null?
I''m trying to set up a directional self-referential HABTM to represent
an arbitrary semi-hierarchical structure; it works for any data
prepopulated into the db, but when I try to create a new relationship,
I just get NULLs in both key columns (or 0''s if I turn on the no-null
constraint).
Here are the migrations:
class CreateNodes < ActiveRecord::Migration
def self.up
2006 Feb 16
1
HABTM -VS- belongs_to/has_many, for self-referential joins
Ok, David says on page 241 that sometimes a many-to-many relation with
attributes are better implemented as an actual model instead of using HABTM.
Well, I''ve got that situation and I can''t figure it out.
All of the examples in the book have HABTM examples between 2 different
tables, but I want to have a HABTM relation on 1 table with itself. (e.g.,
if I have a table Things,
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name =>