search for: class_name_of_active_record_descend

Displaying 4 results from an estimated 4 matches for "class_name_of_active_record_descend".

2006 Mar 28
12
cached-model broken with Rails 1.1
It looks like cached-model is broken again under rails 1.1. Can anyone confirm? Note that the exception below indicates it''s trying to treat CachedModel as the class name of the model, rather than using the proper class name (which is Entry in this case, and the table called entries). This is a model using Single Table Inheritance and acts_as_tree, and worked just fine under 1.0 and
2006 Feb 07
4
Ruby, Rails & Inheritance
...res, so I created a class "RecordWithFeatures": ----------------------------------------------------------------- class RecordWithFeatures < ActiveRecord::Base # @Override def self.descends_from_active_record? superclass == RecordWithFeatures end # @Override def self.class_name_of_active_record_descendant(klass) ... end ... end class SomeModel < RecordWithFeatures ... end ----------------------------------------------------------------- Ok, everything works fine, but I would also like to pass some class-methods to my models as soon as the inherit RecordWithFeatures. Example: All mod...
2006 Feb 27
4
2 belongs_to to the same parent table
Hello! I have 2 table: users and buddies User: id, name, ... Buddy: id, user_id, user_buddy_id, ... So if you have 2 users 1,jack and 2,fred and fred is a buddy of jack, there is a Buddy object: id=1, user_id=1, user_buddy_id=2 I can declare only one belongs_to in Buddy and one has_many in User. And there is conflict if I had the second one (the first one is discarded) class User has_many
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