OSDN Git Service

fix: heroku
[pettanr/pettanr.git] / lib / operator.rb
index 316bcbb..a0104fb 100644 (file)
@@ -7,6 +7,15 @@ class Operator
   end
   
   #InstanceMethods
+  def find_user
+    @operators.each do |operator|
+      return operator if operator.is_a?(User)
+      return operator.user if operator.is_a?(Author)
+      return operator.user if operator.is_a?(Artist)
+    end
+    nil
+  end
+  
   def find_author
     @operators.each do |operator|
       return operator if operator.is_a?(Author)
@@ -32,6 +41,11 @@ class Operator
     nil
   end
   
+  def user
+    return @user if @user
+    @user = find_user
+  end
+  
   def author
     return @author if @author
     @author = find_author