Skip to content

Commit

Permalink
Easy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Jun 12, 2024
1 parent 1a63b4c commit 9272264
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Style/ZeroLengthPredicate:
Exclude:
- lib/redmine_dmsf/webdav/dmsf_resource.rb

Rails/BulkChangeTable:
Exclude:
- db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb # Easy tests

Rails/DangerousColumnNames:
Exclude:
- db/migrate/20170330131901_create_dmsf_folder_permissions.rb
Expand All @@ -109,6 +113,11 @@ Rails/SkipsModelValidations:
- db/migrate/20140519133201_trash_bin.rb
- db/migrate/07_dmsf_1_4_4.rb

Rails/ThreeStateBooleanColumn:
Exclude:
- db/migrate/04_dmsf_0_9_0.rb # Easy tests
- db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb # Easy tests

Rails/UniqueValidationWithoutIndex:
Exclude:
- app/models/dmsf_folder.rb # TODO: Create a case insensitive index in DB migrations
Expand Down
7 changes: 6 additions & 1 deletion db/migrate/04_dmsf_0_9_0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
# Add column
class Dmsf090 < ActiveRecord::Migration[4.2]
def up
add_column :members, :dmsf_mail_notification, :boolean, null: false, default: false
if defined?(EasyExtensions)
add_column :members, :dmsf_mail_notification, :boolean, default: false
else
add_column :members, :dmsf_mail_notification, :boolean,
null: false, default: false
end
drop_table :dmsf_user_prefs
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
# Add column
class AddDmsfNotInheritableToCustomFields < ActiveRecord::Migration[4.2]
def change
add_column :custom_fields, :dmsf_not_inheritable, :boolean,
null: false, default: false
if defined?(EasyExtensions)
add_column :custom_fields, :dmsf_not_inheritable, :boolean, default: false
else
add_column :custom_fields, :dmsf_not_inheritable, :boolean,
null: false, default: false
end
end
end
2 changes: 1 addition & 1 deletion lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def view_attachments_form_top(context = {})
description = defined?(EasyExtensions) && EasySetting.value('attachment_description')
# Radio buttons
if allowed_to_attach_documents(container) && allowed_to_attach_attachments(container)
html << description ? '<p>' : '<div>'
html << (description ? '<p>' : '<div>')
classes = +'inline'
html << "<label class=\"#{classes}\">"
onchange = %($(".attachments-container:not(.dmsf-uploader)").show();
Expand Down
1 change: 1 addition & 0 deletions lib/redmine_dmsf/patches/role_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def self.included(base)
def remove_dmsf_references
return unless id

substitute = User.anonymous
DmsfFolderPermission.where(object_id: id, object_type: 'Role').update_all object_id: substitute.id
end
end
Expand Down

0 comments on commit 9272264

Please sign in to comment.