* Removed Pixa/Tinami sources

* Upgraded to Rails 3.2.3
* Fixed tests
This commit is contained in:
albert
2012-06-01 19:22:58 -04:00
parent 105cba5963
commit 17881068e1
124 changed files with 1063 additions and 1214 deletions

View File

@@ -1,5 +1,5 @@
class TagAlias < ActiveRecord::Base
before_save :clear_all_cache
after_save :clear_all_cache
after_save :update_cache
after_destroy :clear_all_cache
before_validation :initialize_creator, :on => :create
@@ -62,17 +62,14 @@ class TagAlias < ActiveRecord::Base
end
def clear_all_cache
clear_cache
clear_remote_cache
Danbooru.config.all_server_hosts.each do |host|
delay.clear_cache(host)
end
end
def clear_cache
Cache.delete("ta:#{Cache.sanitize(antecedent_name)}")
end
def clear_remote_cache
Danbooru.config.other_server_hosts.each do |server|
Net::HTTP.delete(URI.parse("http://#{server}/tag_aliases/#{id}/cache"))
def clear_cache(host = Socket.gethostname)
if host == Socket.gethostname
Cache.delete("ta:#{Cache.sanitize(antecedent_name)}")
end
end