Displaying 3 results from an estimated 3 matches for "hsomob1".
Did you mean:
homo1
2009 Sep 23
5
Overriding AR read/write_attribute - Overridden write_attribute Is Never Called
Could someone explain this?
#config/initializers/ar_attributes.rb
module ActiveRecord
module AttributeMethods
alias_method :ar_read_attribute, :read_attribute
def read_attribute(attr_name)
p "read_override"
ar_read_attribute(attr_name)
end
alias_method :ar_write_attribute, :write_attribute
def write_attribute(attr_name, value)
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails.
This relationship is giving me trouble:
class Show < AR::Base
has_many :segments
end
class Segment < AR::Base
belongs_to :show
has_one :media #this has no PK/FK relation
end
A Segment is "linked" to Media by Media.name, which is the result of
concatenating Segment.name and Segment.part. As I said there are is no
2009 Feb 02
9
ActiveRecord Unexplainable SystemStackError - Only in WEBrick
This SystemStackError is driving me crazy. It only takes place when
testing with WEBrick - I can''t reproduce it with any tests. It is
caused by calling the "missing" id method (base.rb:2435) on my
ActiveRecord class.
WEBrick and my tests are running as the same user, with a `ulimit -s`
of 10240. Plus the query works sometimes so I don''t think this
matters.