Skip to content

Commit 15eec0e

Browse files
committed
Fix failing tests
1 parent 473653c commit 15eec0e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/models/dragnet/unique_name.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(record: nil, scope: nil, record_class: nil, root_name: nil, name:
77
@scope_attribute = scope
88
@record_class = record_class || record.class
99
@root_name = root_name || "New #{@record_class.model_name.human}"
10-
@name = name || record.name
10+
@name = name.presence || record.name
1111
end
1212

1313
def as_slug
@@ -50,7 +50,7 @@ def scope_attribute_will_change?
5050
end
5151

5252
def auto_named?
53-
@name.start_with?(@root_name)
53+
@name && @name.start_with?(@root_name)
5454
end
5555

5656
def duplicated_root?

0 commit comments

Comments
 (0)