Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
order of rules when using includes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brad Langhorst  
View profile  
 More options Apr 30 2012, 5:26 pm
From: Brad Langhorst <langho...@neb.com>
Date: Mon, 30 Apr 2012 14:26:20 -0700 (PDT)
Local: Mon, Apr 30 2012 5:26 pm
Subject: order of rules when using includes

Take the example of an admin user vs. a guest user.

for the guest i have the rule:

    has_permission_on :conditions, :to => [:new,
:create,:update,:read,:show,:index] do
      if_permitted_to :read, :experimental_conditions
    end

    has_permission_on :experimental_conditions, :to => [:new,
:create,:update,:read, :show, :index] do
      if_attribute :well_id => is { nil }
    end

but for the admin user i have the rule

    has_permission_on :conditions, :to => [:new,
:create,:update,:read,:show,:index]

(much less expensive)

the admin user also
 includes [:guest]

so when i say
Conditions.with_permissions_to(:read) i always get the expensive left outer
join performed.
I have tried to change the position of the the includes hoping that the
cheap rules will be evaluated first, but it does not seem to be the case.

What's the best way to handle this?

Brad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »