Displaying 12 results from an estimated 12 matches for "__id__".
2006 Mar 07
3
ActiveRecord allows un-synced aliases?
q1 = Question.find(1)
q2 = Question.find(1)
Now, we find q1.__id__ != q2.__id__.
It appears the two aliases are not kept in sync:
q1.name => ''old name''
q2.name = ''new name''
q2.save!
q1.name => ''old name''
q2.name => ''new name''
q1.reload
q1...
2014 Feb 12
61
P2V: Headless support
This introduces support to run P2V without X server. Runtime parameters
are specified via kernel command line making it hopefully suitable for
automated migration with a little help of PXE boot.
Patchset is not squashed and represents dev. history.
2007 May 06
5
Comparing polymorphic property to same object fails
...sk), I want to
activate the invitation immediately in the model.
The trouble is that this:
if self.assignable == self.created_by
self.activated_at = Time.now
self.activation_code = nil
end
fails to detect equality correctly. I''ve tried ===, eql? etc.
When I look at .__id__ when I know that I set assignable equal to
created_by, the values are different (wildly so; one is like 4 and the
other is a five digit number or something).
I''m guessing Rails handles polymorphic associations via a proxy object
or something. So the question is: how do I do this compariso...
2006 Mar 12
2
Find all the methods on a object in an irb session?
How can I find all the methods on an object from withing irb?
Thanks,
Joe
2006 Nov 13
3
(A bit offtopic): A good starting book for ruby programming?
Hi all
Guess it''s time for me to dig a bit deeper into the ruby language.
Can you recommend some good starting books on ruby programming?
Thanks.
--
Med venlig hilsen
Juri Rischel Jensen
Fab:IT ApS
Vesterbrogade 50
DK-1620 København
Tlf: 70 202 407 / Fax: 33 313 640
www.fab-it.dk / juri@fab-it.dk
2006 Feb 04
2
Associations oddity
Can anyone explain this oddity to me?
Given two classes as follows:
class Question < ActiveRecord::Base
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :questions
end
I get the following:
>> q = Question.find 6789
=> #<Question:0x37e9e70 @attributes={"id"=>"6789",
2006 Feb 28
3
Object#id will be deprecated?
I didn''t get the memo on this :P
members_controller.rb:12: warning: Object#id will be deprecated; use
Object#object_id
Line 12 is:
@member = Member.find(@current_member.id)
How _should_ I be writing that line?
Thanks,
Joe
--
Posted via http://www.ruby-forum.com/.
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
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
2006 Jun 30
6
RSS::Parser Documentation
Hi
I am trying to use the RSS classes from "rss/2.0" and everything works
but I want to know what attributes and properties I can get at from each
of the classes I am getting back.
For example, the class has a "channel" which I can tell has a "title"
attribute (because it works when I query it :) but I would really like a
list of every attribute that is
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that
first sets up the depot application (page 68), there is this bit of code
from a view:
<% for product in @products %>
<tr>
<% for column in Product.content_columns %>
<td><%=h product.send(column.name) %></td>
<% end %>
etc...
I am trying to absorb both Ruby and
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database
and I''m hoping someone can help.
MySQL stores the date/time as this:
2005-03-08 17:00:34.0
and according to my Pickaxe book Ruby stores times as "the number of
seconds and microseconds since [...] January 1, 1970". All well and good.
Unfortunately, RoR is converting my date to this: