> That test will pass with the old implementation of
> AssociationProxy#method_missing, but not the new.
>
> I do realize that that implementation of full? can lead to confusion
> and there is a good argument for it not to behave that way, but dang
> it, it makes for some pretty code sometimes...

The breakage is caused by the use of instance_eval in your full?
method.  The simplest fix for your code is to make it yield the object
rather than relying on self being transformed:


class Object
 def full?
   is_full = !blank?
   if is_full and block_given?
        yield self
   else
     is_full
   end
 end
end

params[:page].full? {|i| i.to_i} || 0

Alternatively you can monkeypatch the association proxy as well to
avoid that method missing behaviour.

I realise this isn't ideal but to me relying on that instance_eval
changing self is just too much of a corner case to be worth reverting
the performance patch.


-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
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