Displaying 20 results from an estimated 5000 matches similar to: "Wrong class being returned in association"
2012 Jan 21
4
why doesn't an instance of Object get Class's new instance method?
"Object is the root of Ruby''s class hierarchy. Its methods are
available to all classes unless explicitly overridden."
Wouldn''t Class class be at the root of the class hierarchy?
After all, look at this:
1.9.2p290 :006 > Object.instance_of? Class
=> true
Object is an instance of class, after all we can use one of Class''
instance methods on Object:
2006 Nov 19
2
underscores, sugar, and more and more bugs
I sent this earlier under with the subject "artificial sugar causes
cancer" and I think some spam filters ate it. Here it is again:
======================================
All,
If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
you''ll see that Chad (the submitter) found the source of the bug.
Unfortunately, the source
2006 Nov 19
6
artificial sugar causes cancer
All,
If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
you''ll see that Chad (the submitter) found the source of the bug.
Unfortunately, the source of *this* bug is the *solution* to a
*previous bug* in which Rails was replacing RSpec''s method missing
with its own.
When we settled on underscores, my one reservation was
2006 Sep 26
0
ActiveRecord, has_many association and object graphs
I am still using Rails 1.0...
I have a simple has_many association:
class Round < ActiveRecord::Base
has_many :scores
end
class Score < ActiveRecord::Base
belongs_to: round
end
When I do something like this (contrived for the sake of clarity):
rr = Round.find(params[:id])
rr.scores.each { |s|
logger.debug("object_id=#{s.round.object_id}")
}
I see a database query on
2007 Mar 06
15
mocking missing methods
Hi folks.
So I''m using mocha on a ruby project, and I really like it. One thing
I''ve noticed is that it can be a bit "surprising" when I''m mocking
methods that don''t exist on an object, and I think there''s an easyish fix.
At the moment, you use sheep = mock() to create a mock sheep. What I''d
like to do is something like sheep =
2006 Sep 05
2
Mongrel and umask for uploaded files
So any files that are uploaded through my form are getting the following mode:
-rw-------
I need them to have:
-rw-r--r--
I''ve tried setting the umask in a script file called set_umask.rb as follows:
File.umask(022)
and then starting mongrel using:
mongrel_rails start -m config/mime.types -S set_umask.rb
but it doesn''t seem to change the mode that the files are created
2009 Nov 04
4
[PATCH server] Update daemons to use new QMF.
This patch updates dbomatic, taskomatic and host-register to use the
new C++ wrapped ruby QMF bindings. It also fixes a couple of bugs
along the way including the 0 cpu bug for host-register. This is a
compilation of work done by myself and Arjun Roy.
Signed-off-by: Ian Main <imain at redhat.com>
---
src/db-omatic/db_omatic.rb | 111 ++++++-------
2011 Sep 21
0
hooking into `to_prepare` in a Railtie *after* the files have been reloaded (in dev)
I''m working on a gem <https://github.com/bradrobertson/apartment> that sets
properties on ActiveRecord models (such as table_name) dynamically based on
a user config option.
I have an initializer that achieves this. My problem however is that in dev
mode, these classes are reloaded, so they don''t maintain these values set.
So I thought I''d use a railtie to
2009 Nov 13
1
[PATCH server] Replace the occurence of the type @qmfc.object(Qmf::Query.new(:class => "xxx", 'key' => search_key)) for @qmfc.object(Qmf::Query.new(:class => "xxx"), 'key' => search_key) else the search on the key is not functionnal.
This fix db-omatic that cannot recover the node on wich the vm run for example.
We have not investigate far away but that can be due to a change on the ruby-qmf API.
Signed-off-by: Michel Loiseleur <mloiseleur at linagora.com>
---
src/db-omatic/db_omatic.rb | 10 ++++++----
src/libvirt-list.rb | 6 +++---
src/matahari-list.rb | 4 ++--
3 files changed, 11
2009 Jul 21
1
[PATCH server] Fixed db-omatic so it doesn't segfault because of newer qmf api.
---
src/db-omatic/db_omatic.rb | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb
index 155ff5e..b5b7b81 100755
--- a/src/db-omatic/db_omatic.rb
+++ b/src/db-omatic/db_omatic.rb
@@ -270,10 +270,10 @@ class DbOmatic < Qpid::Qmf::Console
end
def object_props(broker, obj)
- target =
2009 Aug 12
5
Challenge for object_id, Garbage Value
I am facing strange problem.
I have an object @part=MainPart.find(:all)
1. @part.each_with_index do |mainpart,index|
2. <p><%= mainpart.object_id%></p>
3. end
Here problem is that object_id is reserved for rails. Here
object_id field in my table . Now i want to get value <%=
mainpart.object_id%> is giving GARBAGE VALUE. Is there any solution
apart from
2009 May 15
0
[PATCH server] Starting of new ovirt QMF API.
This is the new ovirt agent that implements the QMF API. This is just
its humble beginnings. The goal was to implement the create VM method on
VMs but it turns out we need to specify the VM pool in order to do that.
This is currently hardcoded to '5' and works locally but would likely not
work elsewhere. What does work well is listing/querying of existing VMs.
There is still lots of
2011 Mar 15
8
Problems with Object#id deprecation
Hello everyone, in a test helper in my app I call category.id that gets the
id of category in the database. However, when running RSpec I get the
following error:
As a parla customer
/Users/saulolopes/code/parla/spec/acceptance/support/paths.rb:13: warning:
Object#id will be deprecated; use Object#object_id
/Users/saulolopes/code/parla/spec/acceptance/support/paths.rb:13: warning:
Object#id
2009 Jul 15
1
[PATCH] Rename qmf-libvirt-example to libvirt-list.rb
This patch renames qmf-libvirt-example to libvirt-list and makes it
not repeat. Useful for debugging. File mode is also now 755.
Signed-off-by: Ian Main <imain at redhat.com>
---
src/libvirt-list.rb | 65 +++++++++++++++++++++++++++++++++++++++
src/qmf-libvirt-example.rb | 72 --------------------------------------------
2 files changed, 65 insertions(+), 72 deletions(-)
2007 May 01
0
Joining tables and query design advice
Hi everyone,
My problem involves two tables, Objects and Attributes:
Objects
-------------
|ID
|Name
-------------
Attributes
-------------
|ID
|Object_ID (foreign key references Objects.id)
|Value
-------------
I want to be able to search for Objects by (potentially many)
combinations of Attribute values. To show all of the unique Objects
that have Attributes ''green'' AND
2009 Jul 23
0
[PATCH server] Add network QMF apis.
From: Scott Seago <sseago at redhat.com>
This adds some of the network API stuff to ovirt-agent. It's still not
complete but what is there is functional.
Signed-off-by: Ian Main <imain at redhat.com>
---
src/ovirt-agent/lib/ovirt.rb | 3 +
.../ovirt/controllers/hardwarepool_controller.rb | 2 +-
.../lib/ovirt/controllers/network_controller.rb |
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2013 Aug 27
11
Why NaN.class throws NameError ?
Here is my sample code:
class Foo
Bar = 10
end
Foo::Bar # => 10
Foo::Bar.class # => Fixnum
10.class # => Fixnum
Float::NAN # => NaN
Float::NAN.class # => Float
NaN.class
# uninitialized constant NaN (NameError)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2005 Dec 20
2
Null Text Fields
I tend to allow nulls in cases where the value is unknown, even if
it''s a text/varchar field. RoR seems to push empty strings into these
fields. Is there any way to get RoR to use NULL vice '''' if the input
box is empty?
Thanks!
- Ian
2006 Jul 15
2
FieldQuery not returning anything
Hey ..
The QueryParser RDoc page explains to me on how to search for a specific
value in a specific field. This is not working the way i thought it
should be, what am i doing wrong? Here''s an example ..
I''m storing model data in the index like this:
doc << Field.new( "object_id", object.id, Field::Store::YES)
doc << Field.new( "type",