OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: heroku
[pettanr/pettanr.git]
/
lib
/
operator.rb
diff --git
a/lib/operator.rb
b/lib/operator.rb
index
316bcbb
..
a0104fb
100644
(file)
--- a/
lib/operator.rb
+++ b/
lib/operator.rb
@@
-7,6
+7,15
@@
class Operator
end
#InstanceMethods
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)
def find_author
@operators.each do |operator|
return operator if operator.is_a?(Author)
@@
-32,6
+41,11
@@
class Operator
nil
end
nil
end
+ def user
+ return @user if @user
+ @user = find_user
+ end
+
def author
return @author if @author
@author = find_author
def author
return @author if @author
@author = find_author