Undefined method '>' for nil:NilClass

前端 未结 2 1865
迷失自我
迷失自我 2020-12-24 02:48

Ok I do have the following code

 def update_state_actions
    states.each do |state|
      @state_turns[state.id] -= 1 if @state_turns[state.id] > 0 &         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 03:43

    It must be converted to integer variable to perform the opercio:

    • @state_turns [state.id] .to_i > 0
    • state_a = state.auto_removal_timing.to_i + 1

提交回复
热议问题