added asset precompilation to deploy script, style tweaks

This commit is contained in:
albert
2011-10-07 15:21:04 -04:00
parent 87bfa04e65
commit e462342b93
6 changed files with 40 additions and 3 deletions

View File

@@ -21,7 +21,13 @@ class Tag < ActiveRecord::Base
Danbooru.config.tag_category_mapping[string.downcase] || 0
end
end
module CountMethods
def counts_for(tag_names)
select_all_sql("SELECT name, post_count FROM tags WHERE name IN (?)", tag_names)
end
end
module ViewCountMethods
def increment_view_count(name)
Cache.incr("tvc:#{Cache.sanitize(name)}")
@@ -353,6 +359,7 @@ class Tag < ActiveRecord::Base
end
end
extend CountMethods
extend ViewCountMethods
include CategoryMethods
extend StatisticsMethods