<commit_before>class PhoneSerializer < ActiveModel::Serializer
  attributes :id, :unique_identifier, :token, :status, :wifiSSID, :wifiPassword, :created_at, :updated_at, :buttons
  belongs_to :venue
  has_many :stories

  def created_at
    object.created_at.strftime('%A, %D')
  end

  def updated_at
    object.updated_at.strftime('%A, %D')
  end

  def buttons
    phone_stories = Story.connection.select_all("SELECT buttons.assignment, buttons.id, stories.id, stories.title, stories.created_at, stories.url FROM stories INNER JOIN buttons ON (buttons.story_id = stories.id) WHERE buttons.phone_id = #{object.id} ORDER BY buttons.assignment;").rows
    stories = phone_stories.each_with_object({}) { |i,o|
      o[i[0]] = { button_id: i[1], story_id: i[2], title: i[3], created_at: Date.parse(i[4]).strftime('%A, %D') , url: i[5] }
    }
    array = []
    array[0] = { '1' => stories['1'] }
    array[1] = { '2' => stories['2'] }
    array[2] = { '3' => stories['3'] }
    array[3] = { '4' => stories['4'] }
    array[4] = { '5' => stories['5'] }
    array[5] = { '6' => stories['6'] }
    array[6] = { '7' => stories['7'] }
    array[7] = { '8' => stories['8'] }
    array[8] = { '9' => stories['9'] }<commit_msg>autopushing CMI API and skipping travis build [ci skip]<commit_after>class PhoneSerializer < ActiveModel::Serializer
  attributes :id, :unique_identifier, :token, :status, :wifiSSID, :wifiPassword, :created_at, :updated_at, :buttons
  belongs_to :venue
  has_many :stories

  def created_at
    object.created_at.strftime('%A, %D')
  end

  def updated_at
    object.updated_at.strftime('%A, %D')
  end

  def buttons
    phone_stories = Story.connection.select_all("SELECT buttons.assignment, buttons.id, stories.id, stories.title, stories.created_at, stories.url, stories.listens FROM stories INNER JOIN buttons ON (buttons.story_id = stories.id) WHERE buttons.phone_id = #{object.id} ORDER BY buttons.assignment;").rows
    stories = phone_stories.each_with_object({}) { |i,o|
      o[i[0]] = { button_id: i[1], story_id: i[2], title: i[3], created_at: Date.parse(i[4]).strftime('%A, %D') , url: i[5], listens: i[6] }
    }
    array = []
    array[0] = { '1' => stories['1'] }
    array[1] = { '2' => stories['2'] }
    array[2] = { '3' => stories['3'] }
    array[3] = { '4' => stories['4'] }
    array[4] = { '5' => stories['5'] }
    array[5] = { '6' => stories['6'] }
    array[6] = { '7' => stories['7'] }
    array[7] = { '8' => stories['8'] }
    array[8] = { '9' => stories['9'] }
{'fraction_non_alphanumeric': 0.19681274900398407, 'fraction_numerical': 0.026693227091633465, 'mean_word_length': 3.9332023575638506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651686', 'n_tokens_mistral': 947, 'n_tokens_neox': 933, 'n_words': 199}