changed named_scope to scope
changed all of the deprecated calls to ActiveRecord (named_scope, :conditions etc) to the Rails 3 way