Skip to content

Commit 04d5f40

Browse files
committed
Add extra_info to safe_attributes
1 parent 4e2b417 commit 04d5f40

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/models/repository/git_remote.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class Repository::GitRemote < Repository::Git
1111

1212
before_validation :initialize_clone
1313

14+
safe_attributes 'extra_info', :if => lambda {|repository, _user| repository.new_record?}
15+
1416
# TODO: figure out how to do this safely (if at all)
1517
# before_deletion :rm_removed_repo
1618
# def rm_removed_repo

lib/redmine_git_remote/repositories_helper_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def git_remote_field_tags(form, repository)
1212
:label => l(:field_path_to_repository)) +
1313
content_tag('em', l(:text_git_remote_path_note), :class => 'info') +
1414
form.text_field(:extra_clone_url, :size => 60, :required => true,
15-
:disabled => !repository.safe_attribute?('url')) +
15+
:disabled => !repository.safe_attribute?('url'), name: 'repository[extra_info][extra_clone_url]') +
1616
content_tag('em', l(:text_git_remote_url_note), :class => 'info')
1717
)
1818
end

0 commit comments

Comments
 (0)