<commit_before>module WulinMaster
  module GridStates
    extend ActiveSupport::Concern
    
    # ----------------------------- Instance Methods ------------------------------------
    def states_for_user(user)
      return "false" unless user
      current_state = GridState.current(user.id, self.name)
      return "false" unless current_state
      current_state.state_value.presence || {}.to_json
    rescue Exception => e
      Rails.logger.info "Exception thrown while trying to get user states: #{e.inspect}"
      "false"
    end

  end
end
<commit_msg>MISC - fixed a grid state getter bug<commit_after>module WulinMaster
  module GridStates
    extend ActiveSupport::Concern
    
    # ----------------------------- Instance Methods ------------------------------------
    def states_for_user(user)
      return "false" unless user
      current_state = GridState.current(user.id, self.name)
      current_state.try(:state_value).presence || {}.to_json
    rescue Exception => e
      Rails.logger.info "Exception thrown while trying to get user states: #{e.inspect}"
      "false"
    end

  end
end

{'fraction_non_alphanumeric': 0.18867924528301888, 'fraction_numerical': 0.0, 'mean_word_length': 2.0026954177897576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1554125', 'n_tokens_mistral': 297, 'n_tokens_neox': 293, 'n_words': 82}