Skip to content

Commit c361dcc

Browse files
committed
Fixes problem with multiple completed state choices
1 parent 58a06b3 commit c361dcc

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
linear-cli (0.7.3)
4+
linear-cli (0.7.4)
55
base64 (~> 0.2)
66
dry-cli (~> 1.0)
77
dry-cli-completion (~> 1.0)

lib/linear/cli/sub_commands.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def completed_state_for(thingy)
5858
states = thingy.completed_states
5959
return states.first if states.size == 1
6060

61-
prompt.select('Choose a completed state', states.to_h { |s| [s.name, s.id] })
61+
selection = prompt.select('Choose a completed state', states.to_h { |s| [s.name, s.id] })
62+
Rubyists::Linear::WorkflowState.find selection
6263
end
6364

6465
def description_for(description = nil)

lib/linear/commands/issue/create.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def call(**options)
2727
logger.debug('Creating issue', options:)
2828
issue = make_da_issue!(**options)
2929
logger.debug('Issue created', issue:)
30-
prompt.yes?('Do you want to take this issue?') && gimme_da_issue!(issue.id, User.me)
30+
prompt.yes?('Do you want to take this issue?') && gimme_da_issue!(issue.id, me: User.me)
3131
display issue, options
3232
Rubyists::Linear::CLI::Issue::Develop.new.call(issue_id: issue.id, **options) if options[:develop]
3333
end

lib/linear/models/base_model.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ def one_to_one(relation, klass)
4949
end
5050
end
5151

52+
def find(id_val)
53+
camel_name = just_name.camelize :lower
54+
bf = base_fragment
55+
query_data = Api.query(query { __node(camel_name, id: id_val) { ___ bf } })
56+
new query_data[camel_name.to_sym]
57+
end
58+
5259
def const_added(const)
5360
return unless const == :Base
5461

0 commit comments

Comments
 (0)