Skip to content

Commit

Permalink
fix edit structure
Browse files Browse the repository at this point in the history
  • Loading branch information
xithan committed Jan 5, 2017
1 parent 196d061 commit 1bdc6be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion card/lib/card/subcards.rb
Expand Up @@ -251,7 +251,7 @@ def new_by_attributes name, attributes={}
(absolute_name.parts.size - @context_card.cardname.parts.size) > 2
left_card = new_by_attributes absolute_name.left
new_by_card left_card, transact_in_stage: attributes[:transact_in_stage]
left_card.new_by_attributes absolute_name, attributes
left_card.subcards.new_by_attributes absolute_name, attributes
else
subcard_args = extract_subcard_args! attributes
t_i_s = attributes.delete(:transact_in_stage)
Expand Down
7 changes: 4 additions & 3 deletions card/mod/core/set/all/collection.rb
Expand Up @@ -228,10 +228,11 @@ def edit_fields
end

def normalized_edit_fields
edit_fields.map do |name, options|
options ||= Card.quick_fetch(name).name
edit_fields.map do |name_or_card, options|
next [name_or_card, options || {}] if name_or_card.is_a?(Card)
options ||= Card.fetch_name name_or_card
options = { title: options } if options.is_a?(String)
[card.cardname.field(name), options]
[card.cardname.field(name_or_card), options]
end
end

Expand Down

0 comments on commit 1bdc6be

Please sign in to comment.