class SalaryValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors[attribute] << (options[:message] || "cannot be less than starting salary") unless valid_salary_fields?(record)
  end

  def valid_salary_fields?(record)
    unless record.to_salary.blank?
      record.to_salary > record.from_salary
    end
  end
end

class SalaryValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors[attribute] << (options[:message] || "cannot be less than starting salary") if valid_salary_fields?(record)
  end

  def valid_salary_fields?(record)
    unless record.to_salary.blank?
      record.to_salary > record.from_salary
    end
  end
end

Fix another typo with validating salary range
Fix another typo with validating salary range
