Will do, in a separate PR.

LZ

On Tue, Jan 08, 2013 at 03:54:47AM -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]})
> 
> What Petr said. You can use conditions:
> 
> ```ruby
> @organization = Organization.without_deleting.first(:conditions => {:name => params[:organization_id]})
> ```
> ```ruby
> @organization = Organization.without_deleting.first(:conditions => {:label => params[:organization_id]})
> ```
> ```ruby
> # this would be app/models/user.rb with conditions
> Organization.without_deleting.joins(:permissions => {:role => :users}).all(:conditions => {:users => {:id => self.id}}).uniq
> ```
> 
> But this is a hold over from Rails 2 and it's deprecated in versions of Rails 3. The Rails 3/AREL way of querying the database is to use `where` (which you've used in this commit in app/models/user.rb:308:
> 
> ```ruby
> Organization.without_deleting.joins(:permissions => {:role => :users}).where(:users => {:id => self.id}).uniq
> ```
> 
> Here is this line with `where` instead of `:conditions => `:
> ```ruby
> @organization = Organization.without_deleting.where(:name => params[:organization_id]).first
> ```
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/Katello/katello/pull/1358/files#r2575991

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine