[Rails] Re: Wrong class being returned in association

2010-08-29 Thread José Ignacio
After some research it seems that's not the cause of the problem. I created a blank project, removed all plugins and the error persisted: > User.last.conversations.find(Conversation.last.id).users.last.instance_of?(User) => true > reload! Reloading... => true > User.last.conversations.find(Conver

[Rails] Re: Wrong class being returned in association

2010-08-29 Thread José Ignacio
That makes a lot of sense. I'm using authlogic and acts_as_follower in the user model. Turning them off to check which one is producing the issue is hard, but I'll have to try. Is there a way to force plugin classes to reload? Or, what could be the 'best practice' that is not being followed in

[Rails] Wrong class being returned in association

2010-08-29 Thread José Ignacio
I'm using Rails 3.0.0rc and have the following models: class User  has_many :readings  has_many :conversations, :through=>:readings end class Reading  belongs_to :user  belongs_to :conversation end class Conversation  has_many :readings  has_many :users, :through=>:readings end and this control

[Rails] Geokit - find within fuzzy locations

2009-09-02 Thread José Ignacio
I'm using Geokit gem to query mappable records within some distance to a mappable user. When geocoding an address such as "Madrid", lat&lng represent a point, in this case the center of the city. Suppose I have some records with location "Madrid", which are mapped with lat & lng to the center of

[Rails] Re: STI and subclassing twice

2009-05-11 Thread José Ignacio
Interesting... That makes everything work as expected! Thanks > There's some funky stuff with STI that basically boils down to the > fact that if a class hasn't been loaded yet rails doesn't know it > exists (and so doesn't create the correct query). > One way of doing things is to force these cl

[Rails] Re: STI and subclassing twice

2009-05-11 Thread José Ignacio
Any idea? I think there might be a bug here. I'm using Rails 2.3.2, but I get the same behaviour in Rails 2.2.2. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rai

[Rails] STI and subclassing twice

2009-05-08 Thread José Ignacio
I'm trying using STI to implement a hiearchy similar to this: script/generate scaffold name:string type:string class Person < ActiveRecord::Base; end class Customer < Person; end class Employee < Person; end class Developer < Employee; end I.e., there are two levels of inheritance (Developer <