app/models/run.rb
# check if updating state is changed from states of original run(self).
check if updating state is changed from states of original run(self).
check if updating state is changed from states of original run ( self ) .
def changing_run?(updating_attrs, since, till)
    corresponding_state = history(:assert_time => (since..till)).detect do |s| s.since <= since && s.till >= till end or return true
    original_attrs = corresponding_state.attributes
    (updating_attrs.keys - ["since", "till"]).detect do |key| 
      original_attrs[key] != updating_attrs[key]
    end
  end
def changing_run? ( updating_attrs , since , till ) corresponding_state = history ( :assert_time => ( since .. till ) ) . detect do | s | s . since <= since && s . till >= till end or return true original_attrs = corresponding_state . attributes ( updating_attrs . keys - [ "since" , "till" ] ) . detect do | key | original_attrs [ key ] != updating_attrs [ key ] end end
check if updating state is changed from states of original run(self).
check if updating state is changed from states of original run ( self ) .
updating_attrs
<not_specific>
since
<not_specific>
till
<not_specific>