include GeoRecord
has_many :comments, -> { left_joins(:author).where(:visible => true, :users => { :status => [nil, "active", "confirmed"] }).order(:created_at) }, :class_name => "NoteComment", :foreign_key => :note_id
+ has_many :all_comments, -> { left_joins(:author).order(:created_at) }, :class_name => "NoteComment", :foreign_key => :note_id
validates :id, :uniqueness => true, :presence => { :on => :update },
:numericality => { :on => :update, :only_integer => true }
<%= note_event("opened", @note.created_at, @note.author) %>
<% if @note.status == "closed" %>
<br />
- <%= note_event(@note.status, @note.closed_at, @note_comments.last.author) %>
+ <%= note_event(@note.status, @note.closed_at, @note.all_comments.last.author) %>
<% end %>
</div>