Commit 3b9cbc6e authored by Doug Barrett's avatar Doug Barrett 🔴
Browse files

refactor(fields): Remove unused standard_fields method

Remove the standard_fields class method and its associated test.
parent 2b89af62
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -50,14 +50,6 @@ module Labkit
    # field is and should be replicated across the labkit
    # variations.

    # Get all standard field constants
    def self.standard_fields
      constants(false)
        .reject { |c| c == :Deprecated }
        .map { |c| const_get(c) }
        .select { |v| v.is_a?(String) }
    end

    # Get the constant name for a field value
    # @param field_value [String] The field value (e.g., "gl_user_id")
    # @return [String, nil] The constant name (e.g., "GL_USER_ID") or nil if not found
@@ -75,7 +67,7 @@ module Labkit
      # to identify and track usage of deprecated fields in the codebase.

      MAPPINGS = {
        Fields::GL_USER_ID => ["user_id", "userid"],
        Fields::GL_USER_ID => %w[user_id userid],
      }.freeze

      class << self
+0 −8
Original line number Diff line number Diff line
@@ -3,13 +3,6 @@
require 'spec_helper'

RSpec.describe Labkit::Fields do
  describe '.standard_fields' do
    it 'returns an array of strings' do
      expect(described_class.standard_fields).to be_an(Array)
      expect(described_class.standard_fields).to all(be_a(String))
    end
  end

  describe Labkit::Fields::Deprecated do
    describe '.all' do
      it 'returns a hash mapping deprecated field names to standard field names' do
@@ -41,6 +34,5 @@ RSpec.describe Labkit::Fields do
        expect(result).to be(Labkit::Fields::GL_USER_ID)
      end
    end

  end
end