search for: generate_read_method

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

Did you mean: generate_read_methods
2006 May 10
13
Issue in ActiveRecord generated reader methods
...or, I began to see undefined behavior from rails. The first request to read an attribute would be denied correctly, however further requests would proceed without fail. After a lot of searching, I think I have traced the problem down to the generated read methods. When ActiveRecord::Base#generate_read_methods is false, all is well. When its true, my migraine returns. More research, reading, and I come to this curiosity... ActiveRecord::Base#define_read_method(symbol, attr_name, column) generates reader code for an attribute after Rails realizes there should be a reader method for it, correct?...
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
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id'' I have a Model class like the following: class Article < ActiveRecord::Base set_primary_key "ARTICLE_ID" end however, using a link_to like the following (modified scaffolding), the link has no id value: <% for article in @articles %> <tr> <% for column in
2006 Apr 10
0
Inheriting data from one model to another
...l variation.price it uses method_missing() and send() to decide which value to return. ProductVariation looks like this: class ProductVariation < Product belongs_to :parent_product, :class_name => "Product", :foreign_key => "parent_id" @@generate_read_methods = false # turn off generating read_methods otherwise method_missing won''t get called more than once # intercept calls to read attributes. If this instance has # a value return it, otherwise escalate the call to the parent_product def method_missing(method_id, *args, &block)...