From b2fb3a9c62862476a7591ecb5ab4a6a3146e0c49 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Thu, 28 Mar 2019 11:31:14 -0300 Subject: Address review comments --- app/models/concerns/issuable_states.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'app/models/concerns') diff --git a/app/models/concerns/issuable_states.rb b/app/models/concerns/issuable_states.rb index 2ebd5013a4c..b722c541580 100644 --- a/app/models/concerns/issuable_states.rb +++ b/app/models/concerns/issuable_states.rb @@ -17,11 +17,9 @@ module IssuableStates # Needed to prevent breaking some migration specs that # rollback database to a point where state_id does not exist. # We can use this guard clause for now since this file will - # be removed on a future the next release. - return unless self.respond_to?(:state_id) + # be removed in the next release. + return unless self.has_attribute?(:state_id) - states_hash = self.class.available_states - - self.state_id = states_hash[state] + self.state_id = self.class.available_states[state] end end -- cgit v1.2.1