fixed unit tests, tweaked attr_accessible rules

This commit is contained in:
albert
2010-02-19 17:54:44 -05:00
parent 703eb6a1b6
commit 2f907c67b5
7 changed files with 53 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
class Artist < ActiveRecord::Base
attr_accessor :updater_id, :updater_ip_addr
before_create :initialize_creator
before_save :normalize_name
after_save :create_version
after_save :commit_url_string
@@ -11,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
attr_accessible :name, :url_string, :other_names, :group_name, :wiki_page_attributes, :updater_id, :updater_ip_addr
module UrlMethods
module ClassMethods
@@ -152,5 +153,11 @@ class Artist < ActiveRecord::Base
include UpdaterMethods
extend SearchMethods
include VersionMethods
def initialize_creator
if creator.nil?
self.creator_id = updater_id
end
end
end