diff --git a/.rubocop.yml b/.rubocop.yml index 88f09e33..d8c10641 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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 @@ -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 diff --git a/db/migrate/04_dmsf_0_9_0.rb b/db/migrate/04_dmsf_0_9_0.rb index 49c1fbb5..4ded4a44 100644 --- a/db/migrate/04_dmsf_0_9_0.rb +++ b/db/migrate/04_dmsf_0_9_0.rb @@ -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 diff --git a/db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb b/db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb index c9c8a5cd..5a3ecf24 100644 --- a/db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb +++ b/db/migrate/20170217141601_add_dmsf_not_inheritable_to_custom_fields.rb @@ -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 diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb index c7ca14d3..17f9dc26 100644 --- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb @@ -36,7 +36,7 @@ module RedmineDmsf description = defined?(EasyExtensions) && EasySetting.value('attachment_description') # Radio buttons if allowed_to_attach_documents(container) && allowed_to_attach_attachments(container) - html << description ? '

' : '

' + html << (description ? '

' : '

') classes = +'inline' html << "