similar to: Associations oddity

Displaying 20 results from an estimated 1000 matches similar to: "Associations oddity"

2005 Dec 28
9
Idiom question - assertions which aren''t in tests
All, Although I''ve been keeping an eye on Ruby for several years now, I don''t have a huge amount of experience with it. So please forgive me if I''m missing something obvious. I''m in the process of writing my first really "serious" Rails app and would appreciate your advice. I am wondering if there is a standard idiom for including assertions in
2006 Sep 20
15
Why Rails + mongrel_cluster + load balancing doesn''t work for us and the beginning of a solution
We have been searching for a Rails deployment architecture which works for us for some time. We''ve recently moved from Apache 1.3 + FastCGI to Apache 2.2 + mod_proxy_balancer + mongrel_cluster, and it''s a significant improvement. But it still exhibits serious performance problems. We have the beginnings of a fix that we would like to share. To illustrate the problem, imagine a
2006 Feb 07
4
ruby-forum.com problems?
Anybody else experiencing problems accessing ruby-forum.com ? For the past week or so I''ve mostly not been able to access it. It either never loads, or displays a 500 error message. I prefer it though to direct email, or the Mailman archives. csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around
2006 Sep 01
2
Configuring Mongrel logging
Is there any way to configure Mongrel''s logging? Specifically, I''d like to get it to output to syslog. Our Rails apps already do this (via SyslogLogger) - is there any way to persuade Mongrel to do the same? Thanks! -- paul.butcher->msgCount++ Snetterton, Castle Combe, Cadwell Park... Who says I have a one track mind? MSN: paul at paulbutcher.com AIM: paulrabutcher Skype:
2006 Jan 21
2
Documentation for mocks?
Is there any documentation about how mock objects work in RoR, specifically exactly how one should use the test/mocks directory. Is it just me being incompetent searching for it, or hasn''t this been documented yet? Thanks in advance for your help! paul.butcher->msgCount++ Snetterton, Castle Combe, Cadwell Park... Who says I have a one track mind? -- Posted via
2006 Sep 18
11
Finally! Mongrel 0.3.13.4 Official (for Unix)
Hello! Today I''m announcing a "soft but official" release of Mongrel 0.3.13.4 for the Unix fans in the crowd. It''s been running stable for quite some time now for many people, and should be great for nearly everyone. You can read the announce at: http://mongrel.rubyforge.org/ This release includes new versions of mongrel_upload_progress and mongrel_cluster.
2006 Feb 05
2
working with rails and unicode
I''m trying to get basic unicode support working using the "Iteration A1" sample application from the "Agile Web Development With Rails" book. Following the "HowToUseUnicodeStrings" wiki document, I have made the following changes: config/environment.rb: # Include your application configuration below $KCODE = ''u'' require
2007 Oct 15
24
Design flaw? - num_processors, accept/close
Rails instances themselves are almost always single-threaded, whereas Mongrel, and it''s acceptor, are multithreaded. In a situation with long-running Rails pages this presents a problem for mod_proxy_balancer. If num_processors is greater than 1 ( default: 950 ), then Mongrel will gladly accept incoming requests and queue them if its rails instance is currently busy. So even
2008 Feb 22
2
marshaling ActiveRecord objects: how to unload associations?
I''m marshaling ActiveRecord objects, and I want them to be as small as possible. How can I unload everything that can be reloaded from the database? If they''re marshaled before any of the associations are referenced then the referenced objects aren''t dumped. But if the association has been loaded, how can I unload it? AssociationProxy.reset doesn''t seem to do
2006 May 31
13
What are controller modules *for*?
I am aware that controllers can be placed in modules: ruby script/generate controller modulename/controllername But what does this buy me? Is it just a way of ensuring that my source code is nicely arranged, or can I use the fact that a set of controllers are all within a particular model to implement functionality common to all of those controllers? Why am I asking? The app
2006 Aug 14
14
A mock which extends rather than replaces a class?
While running tests, we would like to instrument some of the classes under test. We still want the classes to do exactly what they currently do, but we would like them to do more when running in the test environment. Clearly we can (and currently do) just extend the objects "on the fly" where necessary, but this is a bit messy - we''d like some centralised way to always
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2006 Sep 03
18
Recommentation: Sessions and PStore
Morning Folks, As most of you know there were a few people who had the following three bugs: * CLOSE_WAIT: Lots of sockets in CLOSE_WAIT state. * 99% CPU: Mongrel''s getting "stuck" pegged at 99% CPU. * LEAK: Memory leak. I''ve successfully fixed these bugs or attributed them to one main cause: pstore. First, the memory leak was because of a bug in how the GC in Ruby
2007 Jul 24
9
will_paginate plugin doesn't work with Association Extensions?
I have: class Post < ActiveRecord::Base has_many :comments do def published find( :all, :conditions => {:published => true} ) end end end When in my controller I do Post.find(:first).comments.published.paginate :page => params[:page] I get an error undefined method `paginate'' for []:Array Is will_paginate supposed to
2006 Jan 31
2
How can I overwrite the parent.children.push(child) Method?
Hi all I want to overwrite the push method (which is an alias of <<, the same as concat) of collections, and there I want to test if :uniq is set to true in the relationship. If so, the method should check if the passed object is already related to the parent, or not (only then it will be added). But I just can''t find the original code of this method, so I could overwrite
2007 Aug 12
3
Scope and specing models
Hello all, I''m currently having an issue with some specs, specifically scope issues (probably more of a scope issue than a spec issue at this point)... Here''s the error: ActiveRecord::AssociationTypeMismatch in ''A new User should know what role it has'' Role expected, got NilClass D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in
2006 Aug 09
6
gem install rails
Hi All, I installed ruby184-20 and rubygems-0.9.0 on my computer. When I tried to run C:\ruby>gem install rails --include-dependencies, it showed the following message: Bulk updating Gem source index for: http://gems.rubyforge.org ERROR: While executing gem ... (Gem::GemNotFoundException) Could not find actionpack (= 1.12.4) in the repository Could any one help to solve the above
2007 Mar 16
1
Polymorphic find_or_create bug
Today I just spent 3 hours (and before a demo!) trying to figure out why my polymorphic association fields were breaking. Turns out someone else put in a patch for this 6 months ago. I''m not sure if its the same solution I''d use... I''d rather find_or_create attempt to use AssociationProxy#build if its available and only Base#new if we''re not on a proxy.
2007 Feb 24
3
Spec failing [Possible Bug with kind_of? and instance_of?]
I have a spec which is failing, but I just can''t say why. Maybe I''m missing something painfully obvious? Here is the pastie of the results & the spec: http://pastie.caboo.se/42626 The spec to look for is "should have an array of users" I''ve printed out ("puts''ed") to the terminal the fact that the values are *opposite* to what
2013 Nov 25
4
Problem Connecting to RBD images using Sys::Guestfs Perl Module
Hello, I'm having trouble connecting to rbd images. It seems like somewhere the name is getting chewed up. I wonder if this is related to my previous troubles [1] [2] with rbd images. I'm trying to add an rbd image, but when I launch the guestfs object I get an error: >> libguestfs: trace: launch = -1 (error) I'm adding a single RBD >> libguestfs: trace: add_drive