Permalink
Browse files

simplified site's methods a bit

  • Loading branch information...
1 parent f7edb40 commit 5675535ee683f1004ef48f44fc91a1a8d03f5551 @dimko dimko committed May 9, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models/site.rb
View
@@ -23,13 +23,13 @@ def find_by_host(name)
return nil if name.nil?
name.downcase! && name.strip! && name.sub!(/^www\./, '')
sites = where('host = ? or host = ?', name, '')
- sites.reject { |s| s.default? }.first || sites.first
+ sites.reject(&:default?).first || sites.first
end
end
def host=(value)
- write_attribute :host, value.to_s.downcase
+ write_attribute(:host, value.to_s.downcase)
end
# <3 rspec

0 comments on commit 5675535

Please sign in to comment.