<commit_before>require 'active_record'
require 'minitest/autorun'
require 'test/unit'
require 'mocha/setup'
require 'bourne'
require 'database_cleaner'
unless ENV['CI'] || RUBY_PLATFORM =~ /java/
  require 'byebug'
end
require 'postgres_ext/serializers'

require 'dotenv'
Dotenv.load

ActiveRecord::Base.establish_connection

class TestController < ActionController::Base
  def url_options
    {}
  end
end

class Person < ActiveRecord::Base
  def full_name
    "#{first_name} #{last_name}"
  end

  def self.full_name__sql
    "first_name || ' ' || last_name"
  end
end

class PeopleController < TestController; end

class PersonSerializer < ActiveModel::Serializer
  attributes :id, :full_name, :attendance_name

  def attendance_name
    "#{object.last_name}, #{object.first_name}"
  end

  def self.attendance_name__sql(scope)
    if scope && scope[:admin]
      "'ADMIN ' || last_name || ', ' || first_name"
    else
      "last_name || ', ' || first_name"
    end
  end
end

class Note < ActiveRecord::Base
  has_many :tags
end

class NotesController < TestController; end

class NoteSerializer < ActiveModel::Serializer
  attributes :id, :content, :name
  has_many   :tags
  embed      :ids, include: true
end

class Tag < ActiveRecord::Base
  belongs_to :note
end



class TagSerializer < ActiveModel::Serializer
  attributes :id, :name
  embed :ids
  has_one :note
end<commit_msg>Removes the ruby-style methods for computed values<commit_after>require 'active_record'
require 'minitest/autorun'
require 'test/unit'
require 'mocha/setup'
require 'bourne'
require 'database_cleaner'
unless ENV['CI'] || RUBY_PLATFORM =~ /java/
  require 'byebug'
end
require 'postgres_ext/serializers'

require 'dotenv'
Dotenv.load

ActiveRecord::Base.establish_connection

class TestController < ActionController::Base
  def url_options
    {}
  end
end

class Person < ActiveRecord::Base
  def self.full_name__sql
    "first_name || ' ' || last_name"
  end
end

class PeopleController < TestController; end

class PersonSerializer < ActiveModel::Serializer
  attributes :id, :full_name, :attendance_name

  def self.attendance_name__sql(scope)
    if scope &&  scope[:admin]
      "'ADMIN ' || last_name || ', ' || first_name"
    else
      "last_name || ', ' || first_name"
    end
  end
end

class Note < ActiveRecord::Base
  has_many :tags
end

class NotesController < TestController; end

class NoteSerializer < ActiveModel::Serializer
  attributes :id, :content, :name
  has_many   :tags
  embed      :ids, include: true
end

class Tag < ActiveRecord::Base
  belongs_to :note
end



class TagSerializer < ActiveModel::Serializer
  attributes :id, :name
  embed :ids
  has_one :note
end
{'fraction_non_alphanumeric': 0.1013790532985464, 'fraction_numerical': 0.0, 'mean_word_length': 4.4222222222222225, 'pattern_counts': {'":': 0, '<': 21, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7016350', 'n_tokens_mistral': 868, 'n_tokens_neox': 862, 'n_words': 229}