OSDN Git Service

t#30143:au and ar change
[pettanr/pettanr.git] / app / models / artist.rb
index 419e965..bfd9b76 100644 (file)
@@ -17,8 +17,13 @@ class Artist < ActiveRecord::Base
   end
   
   def own? au
-    return false unless au.is_a?(Author)
-    self.author_id == au.id
+    if au.is_a?(Author)
+      self.author_id == au.id
+    elsif au.is_a?(Artist)
+      self.id == au.id
+    else
+      false
+    end
   end
   
   def visible? au