updated to rails 3.2, fixed tests

This commit is contained in:
albert
2012-01-27 14:22:47 -05:00
parent 75d977ae80
commit c8bcf5ad7c
16 changed files with 146 additions and 105 deletions

View File

@@ -12,7 +12,7 @@ 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_active, :as => [:member, :privileged, :contributor, :janitor, :moderator, :default, :admin]
attr_accessible :body, :name, :url_string, :other_names, :group_name, :wiki_page_attributes, :notes, :is_active, :as => [:member, :privileged, :contributor, :janitor, :moderator, :default, :admin]
attr_accessible :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)])}

View File

@@ -1,5 +1,5 @@
class UserFeedback < ActiveRecord::Base
set_table_name "user_feedback"
self.table_name = "user_feedback"
belongs_to :user
belongs_to :creator, :class_name => "User"
before_validation :initialize_creator, :on => :create