Added "uploader" and "status" methods for Screenshot class
This commit is contained in:
parent
095ec7813a
commit
9877b25267
1 changed files with 15 additions and 0 deletions
|
|
@ -22,9 +22,24 @@ class Screenshot < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def uploader
|
||||||
|
# TODO: Implement the ownership of images
|
||||||
|
"Anonymous"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def status
|
||||||
|
text = ''
|
||||||
|
# Completes the sentence: "This image…"
|
||||||
|
if self.approved
|
||||||
|
text <<'is public'
|
||||||
|
else
|
||||||
|
text <<'has to be moderated before being publicly visible'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.markedfordelete
|
||||||
|
text <<' (and was requested to be removed)'
|
||||||
|
end
|
||||||
|
|
||||||
|
text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue