David,

sorry I am not following. This is gonna be errata, I am not going to
refactor any code I do not need to.

I also do not understand what is wrong with my without_deleting.first
statement. Please elaborate. Thanks.

LZ

On Mon, Jan 07, 2013 at 05:04:55PM -0800, David Davis wrote:
> > @@ -100,8 +100,10 @@ def find_organization
> >  
> >    def find_optional_organization
> >      if params[:organization_id]
> > -      @organization = Organization.first(:conditions => {:name => params[:organization_id]})
> > -      @organization = Organization.first(:conditions => {:label => params[:organization_id]}) if @organization.nil?
> > +      @organization = Organization.without_deleting.first(:conditions => {:name => params[:organization_id]})
> 
> I guess I should be thankful you at least used `where` in user.rb when you could have used a conditions hash:
> 
> ```ruby
> Organization.without_deleting.joins(:permissions => {:role => :users}).all(:conditions => {:users => {:id => self.id}}).uniq
> ```
> 
> :-)
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/Katello/katello/pull/1358/files#r2572365

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine