def field_by_name(name)
      field = fields[name.to_sym] unless name.blank?
      if field.nil?
        dotted = name.to_s.split('.')[0]
        field = fields[dotted.to_sym] unless dotted.blank?
        if field && field.key_relation.nil?
          return nil
        end
      end
      field
    end
def field_by_name(name)
      field = fields[name.to_sym] unless name.blank?
      if field.nil?
        dotted = name.to_s.split('.')[0]
        field = fields[dotted.to_sym] unless dotted.blank?
        if field && field.key_relation.nil?
          return nil
        end
      end
      field
    end
this method return definitions::field object from string