Module: MayNeedReview::InstanceMethods

Defined in:
app/models/may_need_review.rb

Instance Method Summary collapse

Instance Method Details

#needs_reviewObject



37
38
39
# File 'app/models/may_need_review.rb', line 37

def needs_review
  self.needs_review?
end

#needs_review!Object



34
35
36
# File 'app/models/may_need_review.rb', line 34

def needs_review!
  self.needs_review = true
end

#needs_review=(new_needs_review) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'app/models/may_need_review.rb', line 40

def needs_review=(new_needs_review)
  new_needs_review = false if new_needs_review == "false"
  if new_needs_review != self.needs_review
    attribute_will_change!(:needs_review) 
  end
  if new_needs_review
    self.add_flag :needs_review
  else
    self.remove_flag :needs_review
  end
end

#needs_review?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/may_need_review.rb', line 31

def needs_review?
  has_flag? :needs_review
end