app/interactors/problem_updater_cache.rb
##
# Update problem statistique from some notice information
#
Update problem statistique from some notice information
Update problem statistique from some notice information
def update_notices_cache
    first_notice = notices.first
    last_notice = notices.last
    notice ||= @notice || first_notice
    attrs = {}
    attrs[:first_notice_at] = first_notice.created_at if first_notice
    attrs[:last_notice_at] = last_notice.created_at if last_notice
    attrs.merge!(
      :message     => notice.message,
      :where       => notice.where,
      :messages    => attribute_count(:message, messages),
      :hosts       => attribute_count(:host, hosts),
      :user_agents => attribute_count(:user_agent_string, user_agents)
    ) if notice
    problem.update_attributes!(attrs)
  end
def update_notices_cache first_notice = notices . first last_notice = notices . last notice ||= @notice || first_notice attrs = { } attrs [ :first_notice_at ] = first_notice . created_at if first_notice attrs [ :last_notice_at ] = last_notice . created_at if last_notice attrs . merge! ( :message => notice . message , :where => notice . where , :messages => attribute_count ( :message , messages ) , :hosts => attribute_count ( :host , hosts ) , :user_agents => attribute_count ( :user_agent_string , user_agents ) ) if notice problem . update_attributes! ( attrs ) end
Update problem statistique from some notice information
Update problem statistique from some notice information