Displaying 20 results from an estimated 200 matches similar to: "Polymorphic joins work one way, but not the other"
2008 Feb 15
3
Ugly, garbled output from autotest
I am getting this horribly ugly output from autotest when a test fails.
Normal output from ''rake test'':
--
1) Failure:
test_export_format(TaskTest) [./test/unit/task_test.rb:61]:
<"Michael Alvarez"> expected but was
<nil>.
--
Same failure, as seen via autotest:
--
1) Failure:
test_export_format(TaskTest) [./test/unit/task_test.rb:61]:
---
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
Hey Guys,
I''ve got a test class that loads a bunch of fixtures. My understanding
is that fixtures are reloaded between each test... and I even have the
following two method calls at the top of my test class to make doubly
sure...
class TaskTest < Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
When I run my tests
2006 Jul 29
2
Cannot save Date field
Hi,
I have a table which has a column called due_date. Datatype of this
column in
mySQL is "Date". Here is what I extracted from schema.rb
> t.column "due_date", :date
My fixture tasks.yml file has the following line
> due_date: 07/17/2006
My test_task.rb has the following line
> assert_equal "07/17/2006", @task.due_date
When I run
2008 May 28
1
Attachment_fu, polymorphism and customization
Hi,
I got Image model that has_attachment and belongs_to 2 other models
via polymorphic association.
The problem is that I''d like to customize has_attachment options
(resize image) depending on which model the Image is related to - i.e.
if Image belongs to Article it should be resized using different
settings than if it belongs to Header.
Is there a smart way to do it or do I have to
2006 Feb 10
3
[Req] polymorphic associations howto
Hi people,
I''m looking into polymorphic associations as a way to cleanup some
messy parts of my code. I think they will allow me to do exectly what
I need, but since there''s little to none written on this subject, I''d be
delighted if someone could shed some light on this. Especially what
the different options and needed table structures need to be.
Thanks,
-
2008 Oct 29
5
Polymorphic Associations with inheritance
I have two models, Article and Post, that has many Comments. However,
both Article and Post are inherited from a BaseContent class like so:
class Article < BaseContent
has_many :comments, :as => :commentable
end
class Post < BaseContent
has_many :comments, :as => :commentable
end
and here''s my Comment model:
class Comment < ActiveRecord::Base
belongs_to
2007 Sep 18
2
Making attachment_fu polymorphic
I am working on a small model mixin called attachment_kung to make
attachment_fu polymorphic, so you no longer need a different table and
Model class for every associated attachment (Productimage, Ad_doc,
etc). All you really need is one model and table to handel all your
attachments - in some cases, anyway. I have the code working, but have
run into one small hitch that I can''t seem to
2006 Apr 22
9
one to many question
1. A category has parent categories.
2. A product is in many categories and a category has many products.
3. Products and category both have images in the same image table. ie. a
product and / or category could have multiple images.<=== my question is
related to this
So among other things I presume I have to do the following:
class Category < ActiveRecord:Base
#...
2006 Nov 01
6
Java Web Phone
Hello list partners
you know about a softphone made in java attachable in a web page?
GNU!
Thaks in advance!______________________________
Visita http://www.tutopia.com y comienza a navegar m?s r?pido en Internet. Tutopia es Internet para todos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Apr 16
8
Will acts_as_taggable_on_steroids and better_nested_set work together?
I am having this crazy problem where it ONLY shows up in testing.
This is my test code
<code>
def test_should_destroy
task1 = Task.new(:description => "tmp",
:done => false,
:user => User.find_by_login(''admin''))
assert task1.save
assert task1.destroy
end
</code>
This is my task model
2006 Apr 22
2
RE: SPA 3000 - UK Replacement
First off I am totally annoyed and let down by PC World Business (PCWB part
of the Dixons Group). I ordered one of these babies from them over a month
ago. After constantly chasing them up they finally told me they couldn't
deliver, and have now only just returned the money they "stole" from me. I
only bought from them because they showed a 4-day availability stock level!
Now
2020 Jun 23
4
Restrict package to load-only access - prevent attempts to attach it
Hi,
I'm developing a package whose API is only meant to be used in other
packages via imports or pkg::foo(). There should be no need to attach
this package so that its API appears on the search() path. As a
maintainer, I want to avoid having it appear in search() conflicts by
mistake.
This means that, for instance, other packages should declare this
package under 'Imports' or
2008 Sep 29
1
has_one :through with :source. How to alias association?
Hi to everyone,
I have the following models:
class Attachment < ActiveRecord::Base
has_attachment :content_type => [:image, ''application/pdf''],
:max_size => 3.megabytes,
:path_prefix => ''../private/attachments'',
:storage => :file_system,
:processor => :rmagick,
2006 Sep 22
2
possible to create polymorphic relationship with STI models?
I would like to associate a ‘product’ model with 3 models inherited from
‘image’: part, action and accessory.
I have it working with Has_many :through relating products to images
through attachments, I then have to determine the ‘type’ of the STI
extension. This means i have to go product.images. While this is ok, i
can see it getting tricky when i want to go products.images <<
2010 Sep 03
2
seeking current supported crypto co-processors
Howdy,
<this messages is cross posted in freebsd-security and freebsd-net>
I'm seeking current cryptographic coprocessors supported in FreeBSD 8.x. By perusing through the crypto-dev (and subsequently referenced) man page(s) I found this list:
Hifn 7751/7951/7811/7955/7956 crypto accelerator
SafeNet 1141/1741
Bluesteel 5501/5601
Broadcom
2007 Oct 09
5
Backticks wrapping SQL values in polymorphic associations...
Hopefully the subject line didn''t scare you. That said...
I have a simple polymorphic relationship (is that possible?):
class Part
has_many :attachments, :as => :attachable
end
class Attachment
belongs_to :attachable, :polymorphic => true
end
Calling Part.find(:first).attachments yields this SQL error:
ActiveRecord::StatementInvalid:
Mysql::Error: Unknown column
2011 Oct 26
6
Add an index to a form
Hello,
I''m having some trouble with forms, my app allows to enter data by
using a multi-step form that has 7 steps.
There are 3 steps that may let the user to add 1 form, for example
there''s a step called "children"
and that children has the following fields:
* name
* age
* gender
but one father may have more than 1 child and I''m adding another form
with
2011 Apr 15
1
Errors attaching VBDs to dom0 VM
Hi,
I''ve been touring XCP and making my way around it for the last few
days, and am having problems with some reasonably straightforward
actions. I''ve poured a several hours into different ways of resolving
the issue, but am coming up short.
Here''s the main issue. The following command (plugging in a VBD to
the dom0 VM), when, run, hangs for several minutes, and then
2009 Aug 07
1
inner joins and outer joins
can anybody guide me on how to create inner joins and left and right
outer joins in RoR as both the tables has "has and belongs to many
relationships" and there is ajoin table as well
2003 Oct 08
3
Ldap.h missing in samba-3.0.0
I have downloaded samba-3.0.0.tar.bz2 (and samba-latest.tar.gz) and
attempted to run "./configure --with-ldapsam --with-winbind
--with-pam_smbpass --with-smbmount --with-ads --with-ldap"
Only to find that ./configure complains of a missing ldap.h file. Does
anyone else have this issue? I'm trying to do a simple setup to having a
Linux box communicate to my Windows 2000 Server PDC,