deleted posts are now hidden

This commit is contained in:
albert
2011-10-22 13:25:22 -04:00
parent b28817c5e5
commit f07bf9b2cc
10 changed files with 41 additions and 13 deletions

View File

@@ -12,7 +12,8 @@ class Artist < ActiveRecord::Base
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
accepts_nested_attributes_for :wiki_page
attr_accessible :name, :url_string, :other_names, :group_name, :wiki_page_attributes, :notes, :is_banned, :is_active
attr_accessible :name, :url_string, :other_names, :group_name, :wiki_page_attributes, :notes, :is_active
attr_accessible :name, :url_string, :other_names, :group_name, :wiki_page_attributes, :notes, :is_active, :is_banned, :as => :admin
scope :url_match, lambda {|string| where(["id in (?)", Artist.find_all_by_url(string).map(&:id)])}
scope :other_names_match, lambda {|string| where(["other_names_index @@ to_tsquery('danbooru', ?)", Artist.normalize_name(string)])}
scope :name_equals, lambda {|string| where("name = ?", string)}