1 2 3 4 5 6 7
class Alert < ActiveRecord::Base belongs_to :author, class_name: "User" def owned_by?(user) self.author == user end end