Guest User

Untitled

a guest
Apr 26th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. validates_with_method :check_publisher
  2.  
  3. def check_publisher
  4. return [false, "must be a publisher, or admin. Sorry"] if new_record? && (self.owner.nil? || !(self.owner.publisher? || self.owner.admin?))
  5. end
Add Comment
Please, Sign In to add comment