<commit_before># encoding: utf-8
class Venue < ActiveRecord::Base
  attr_accessible :url, :city, :country, :latitude, :location, :longitude, :street, :zipcode
  validates_presence_of :location, :city, :country, :street, :zipcode, :region_id

  has_many :events
  has_many :single_events

  belongs_to :region

  after_validation :geocode

  geocoded_by :address

  default_scope order(:location)

  def address
    [self.street, "#{self.zipcode} #{self.city}"].delete_if {|d| d.blank?}.collect{|d|d.strip}.join(", ")
  end

  def to_s
    location
  end

  def to_opengraph
    {
      "og:latitude"=>latitude,
      "og:longitude"=>longitude,
      "og:locality"=>location,
      "og:postal-code"=>zipcode,
      "og:street-address"=>street,<commit_msg>made region accessible, fixes #275<commit_after># encoding: utf-8
class Venue < ActiveRecord::Base
  attr_accessible :url, :city, :country, :latitude, :location, :longitude, :street, :zipcode, :region_id
  validates_presence_of :location, :city, :country, :street, :zipcode, :region_id

  has_many :events
  has_many :single_events

  belongs_to :region

  after_validation :geocode

  geocoded_by :address

  default_scope order(:location)

  def address
    [self.street, "#{self.zipcode} #{self.city}"].delete_if {|d| d.blank?}.collect{|d|d.strip}.join(", ")
  end

  def to_s
    location
  end

  def to_opengraph
    {
      "og:latitude"=>latitude,
      "og:longitude"=>longitude,
      "og:locality"=>location,
      "og:postal-code"=>zipcode,
      "og:street-address"=>street,
{'fraction_non_alphanumeric': 0.14406229720960415, 'fraction_numerical': 0.003244646333549643, 'mean_word_length': 4.317241379310345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6050441', 'n_tokens_mistral': 577, 'n_tokens_neox': 549, 'n_words': 110}