Class: Issue

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/issue.rb

Instance Method Summary collapse

Instance Method Details

#send!Object

Instance Methods =====================================================



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

def send!
  UserMailer.new_issue(self).deliver
  
  self.update_attribute(:sent_at, Time.now.utc)
  
  # Create a new issue for the area if there are any new posts left
  if self.area.send_mode?(:batched) && self.area.posts.in_issue(nil).count > 0
    self.area.issues.create
  end
  
  self.area.record_activity_for!(:issues_published)
end

#to_paramsObject



52
53
54
# File 'app/models/issue.rb', line 52

def to_params
  self.number
end