Skip to content

Commit

Permalink
Trackable :subdomain option fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tashian committed Jun 11, 2011
1 parent ef73858 commit 64ececd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/trackable.rb
Expand Up @@ -11,7 +11,9 @@ module ClassMethods
def most_viewed(ops = {})
# Accept 'mn.staging' or whatever request.subdomain
# might contain as a subdomain param.
ops[:subdomain] = ops[:subdomain].split('.').try(:first) || ops[:subdomain]
if ops[:subdomain]
ops[:subdomain] = ops[:subdomain].split('.').try(:first) || ops[:subdomain]
end

return self.none unless MongoMapper.connected?

Expand Down

0 comments on commit 64ececd

Please sign in to comment.