diff --git a/app/assets/stylesheets/specific/users.css.scss b/app/assets/stylesheets/specific/users.css.scss
index b6d2e1dfb..d7cca1839 100644
--- a/app/assets/stylesheets/specific/users.css.scss
+++ b/app/assets/stylesheets/specific/users.css.scss
@@ -59,7 +59,7 @@ div#c-users {
}
div#a-new {
- max-width: 40em;
+ max-width: 60em;
p {
font-size: 1.2em;
diff --git a/app/controllers/tag_aliases_controller.rb b/app/controllers/tag_aliases_controller.rb
index 1e9329984..3bde039cd 100644
--- a/app/controllers/tag_aliases_controller.rb
+++ b/app/controllers/tag_aliases_controller.rb
@@ -28,6 +28,8 @@ class TagAliasesController < ApplicationController
def destroy
@tag_alias = TagAlias.find(params[:id])
+ @tag_alias.update_column(:status, "deleted")
+ @tag_alias.clear_all_cache
@tag_alias.destroy
respond_with(@tag_alias, :location => tag_aliases_path)
end
@@ -38,10 +40,4 @@ class TagAliasesController < ApplicationController
@tag_alias.delay(:queue => "default").process!
respond_with(@tag_alias, :location => tag_alias_path(@tag_alias))
end
-
- def cache
- @tag_alias = TagAlias.find(params[:id])
- @tag_alias.clear_cache
- render :nothing => true
- end
end
diff --git a/app/logical/tag_alias_correction.rb b/app/logical/tag_alias_correction.rb
index 094067f8f..f33b6b403 100644
--- a/app/logical/tag_alias_correction.rb
+++ b/app/logical/tag_alias_correction.rb
@@ -51,7 +51,6 @@ class TagAliasCorrection
def fix!
clear_cache
- tag_alias.update_cache
tag_alias.delay(:queue => "default").update_posts
end
end
diff --git a/app/models/tag_alias.rb b/app/models/tag_alias.rb
index 09cdccbdc..edd99cb42 100644
--- a/app/models/tag_alias.rb
+++ b/app/models/tag_alias.rb
@@ -1,6 +1,5 @@
class TagAlias < ActiveRecord::Base
after_save :clear_all_cache
- after_save :update_cache
after_save :ensure_category_consistency
after_destroy :clear_all_cache
before_validation :initialize_creator, :on => :create
@@ -35,7 +34,25 @@ class TagAlias < ActiveRecord::Base
end
end
+ module CacheMethods
+ extend ActiveSupport::Concern
+
+ module ClassMethods
+ def clear_cache_for(name)
+ Cache.delete("ta:#{Cache.sanitize(name)}")
+ end
+ end
+
+ def clear_all_cache
+ Danbooru.config.all_server_hosts.each do |host|
+ TagAlias.delay(:queue => host).clear_cache_for(antecedent_name)
+ TagAlias.delay(:queue => host).clear_cache_for(consequent_name)
+ end
+ end
+ end
+
extend SearchMethods
+ include CacheMethods
def self.to_aliased(names)
alias_hash = Cache.get_multi(names.flatten, "ta") do |name|
@@ -96,22 +113,6 @@ class TagAlias < ActiveRecord::Base
true
end
- def clear_all_cache
- Danbooru.config.all_server_hosts.each do |host|
- delay(:queue => host).clear_cache
- end
- end
-
- def clear_cache
- Cache.delete("ta:#{Cache.sanitize(antecedent_name)}")
- Cache.delete("ta:#{Cache.sanitize(consequent_name)}")
- end
-
- def update_cache
- Cache.put("ta:#{Cache.sanitize(antecedent_name)}", consequent_name)
- Cache.delete("ta:#{Cache.sanitize(consequent_name)}")
- end
-
def update_posts
Post.raw_tag_match(antecedent_name).find_each do |post|
escaped_antecedent_name = Regexp.escape(antecedent_name)
diff --git a/app/views/static/name_change.html.erb b/app/views/static/name_change.html.erb
new file mode 100644
index 000000000..f09c5aea8
--- /dev/null
+++ b/app/views/static/name_change.html.erb
@@ -0,0 +1,9 @@
+
+
Name Change
+
+
I want to change my name. Why can't I?
+
+
Moderators rely on user names to track identities. For example, if Bob has a history of leaving nasty comments, the mods will know that Bob has a bad reputation. But if Bob decides to change his name to Carl, and Carl starts leaving nasty comments again, the mods won't realize that Bob and Carl are the same person. They might be lenient with Carl instead of banning him.
+
+
For this reason user name changes are not supported.