> class User < ActiveRecord::Base
>   def accessible_property_find(*args)
>     Property.with_scope(:find => accessible_property_options) do
>       Property.find(*args)
>     end
>   end
> end

NFI what accessible_property_options is, but I'm guessing it has to do
with the current user?  This is closer to how I'd approach the
problem:

class Property < AR::Base
  def find_with_user(user, *args)
    with_user(user) { find *args }
  end

  protected
  def with_user(user, &block)
    with_scope :find => user.accessible_property_options, &block
  end
end

class User < AR::Base
  def accessible_property_find(*args)
    Property.with_user(*args)
  end
end

-- 
Rick Olson
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

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