<commit_before># == Schema Information
#
# Table name: current_routes
#
#  id                                 :integer          not null, primary key
#  onestop_id                         :string
#  name                               :string
#  tags                               :hstore
#  operator_id                        :integer
#  created_or_updated_in_changeset_id :integer
#  version                            :integer
#  created_at                         :datetime
#  updated_at                         :datetime
#  geometry                           :geography({:srid geometry, 4326
#  identifiers                        :string           default([]), is an Array
#  vehicle_type                       :integer
#  color                              :string
#  wheelchair_accessible              :string
#  bikes_allowed                      :string
#
# Indexes
#
#  c_route_cu_in_changeset                        (created_or_updated_in_changeset_id)
#  index_current_routes_on_bikes_allowed          (bikes_allowed)
#  index_current_routes_on_geometry               (geometry)
#  index_current_routes_on_identifiers            (identifiers)
#  index_current_routes_on_onestop_id             (onestop_id) UNIQUE
#  index_current_routes_on_operator_id            (operator_id)
#  index_current_routes_on_tags                   (tags)
#  index_current_routes_on_updated_at             (updated_at)
#  index_current_routes_on_vehicle_type           (vehicle_type)
#  index_current_routes_on_wheelchair_accessible  (wheelchair_accessible)
#

class RouteSerializer < CurrentEntitySerializer
  attributes :onestop_id,
             :name,
             :vehicle_type,
             :geometry,
             :color,
             :tags,
             :stops_served_by_route,
             :operated_by_onestop_id,
             :operated_by_name,
             :created_at,
             :updated_at,
             :route_stop_patterns_by_onestop_id

  def operated_by_onestop_id
    object.operator.try(:onestop_id)
  end

  def operated_by_name
    object.operator.try(:name)
  end

  def stops_served_by_route
    object.stops.map { |stop| { stop_onestop_id: stop.onestop_id, stop_name: stop.name } }
  end

  def route_stop_patterns_by_onestop_id
    object.route_stop_patterns.map(&:onestop_id)
  end
end<commit_msg>Route: add wheelchair_accessible, bikes_allowed to serializer<commit_after># == Schema Information
#
# Table name: current_routes
#
#  id                                 :integer          not null, primary key
#  onestop_id                         :string
#  name                               :string
#  tags                               :hstore
#  operator_id                        :integer
#  created_or_updated_in_changeset_id :integer
#  version                            :integer
#  created_at                         :datetime
#  updated_at                         :datetime
#  geometry                           :geography({:srid geometry, 4326
#  identifiers                        :string           default([]), is an Array
#  vehicle_type                       :integer
#  color                              :string
#  wheelchair_accessible              :string
#  bikes_allowed                      :string
#
# Indexes
#
#  c_route_cu_in_changeset                        (created_or_updated_in_changeset_id)
#  index_current_routes_on_bikes_allowed          (bikes_allowed)
#  index_current_routes_on_geometry               (geometry)
#  index_current_routes_on_identifiers            (identifiers)
#  index_current_routes_on_onestop_id             (onestop_id) UNIQUE
#  index_current_routes_on_operator_id            (operator_id)
#  index_current_routes_on_tags                   (tags)
#  index_current_routes_on_updated_at             (updated_at)
#  index_current_routes_on_vehicle_type           (vehicle_type)
#  index_current_routes_on_wheelchair_accessible  (wheelchair_accessible)
#

class RouteSerializer < CurrentEntitySerializer
  attributes :onestop_id,
             :name,
             :vehicle_type,
             :geometry,
             :color,
             :tags,
             :stops_served_by_route,
             :operated_by_onestop_id,
             :operated_by_name,
             :wheelchair_accessible,
             :bikes_allowed,
             :created_at,
             :updated_at,
             :route_stop_patterns_by_onestop_id

  def operated_by_onestop_id
    object.operator.try(:onestop_id)
  end

  def operated_by_name
    object.operator.try(:name)
  end

  def stops_served_by_route
    object.stops.map { |stop| { stop_onestop_id: stop.onestop_id, stop_name: stop.name } }
  end

  def route_stop_patterns_by_onestop_id
    object.route_stop_patterns.map(&:onestop_id)
  end
end
{'fraction_non_alphanumeric': 0.05902192242833052, 'fraction_numerical': 0.0016863406408094434, 'mean_word_length': 1.7427745664739884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3727930', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1372, 'n_words': 218}