You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: discount_rules_view_model.rb
    path of file: ./repos/workarea/admin/app/view_models/workarea/admin
    
    the code of the file until where you have to start completion: module Workarea
  module Admin
    class DiscountRulesViewModel < ApplicationViewModel
      def to_h
        displayed_fields.reduce({}) do |memo, field|
          value = if respond_to?(field)
                    send(fie
    
      def to_h
        displayed_fields.reduce({}) do |memo, field|
          value = if respond_to?(field)
                    send(field)
                  else
                    model.send(field)
                  end

          memo[clean_field_name(field)] = value if value.present?
          memo
        end