It _is_ a core Ruby object, with a contract defined in Object.  The
problem is that Rails overrides that definition, accounting for
ActiveRecord attributes.  (It _should_ override, since it overrides
method_missing.)

All I'm saying is that the override devined in
ActiveRecord::AttributeMethods is inconsistent with the core Ruby
contract.

-Gaius

On Tue, Sep 2, 2008 at 2:13 PM, Jim Lindley <[EMAIL PROTECTED]> wrote:
>
>> class Foo < ActiveRecord::Base
>>
>>  private
>>
>>  # really protect attribute bar
>>  def bar
>>    read_attribute :bar
>>  end
>>  def bar=(val)
>>    write_attribute :bar, val
>>  end
>>
>> end
>>
>> Now Foo.new.respond_to?(:bar) really _should_ return false
>
> respond_to? is a Ruby core object method, it's not implemented by Rails.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to