Fixed rubocop complains by restoring the deactivation of Rails/InverseOf.
This commit is contained in:
parent
04055f7095
commit
ddd7cb315a
8 changed files with 23 additions and 0 deletions
|
@ -4,9 +4,12 @@ class History < ApplicationModel
|
||||||
include History::Assets
|
include History::Assets
|
||||||
|
|
||||||
self.table_name = 'histories'
|
self.table_name = 'histories'
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :history_type, class_name: 'History::Type'
|
belongs_to :history_type, class_name: 'History::Type'
|
||||||
belongs_to :history_object, class_name: 'History::Object'
|
belongs_to :history_object, class_name: 'History::Object'
|
||||||
belongs_to :history_attribute, class_name: 'History::Attribute'
|
belongs_to :history_attribute, class_name: 'History::Attribute'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
# the noop is needed since Layout/EmptyLines detects
|
# the noop is needed since Layout/EmptyLines detects
|
||||||
# the block commend below wrongly as the measurement of
|
# the block commend below wrongly as the measurement of
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Link < ApplicationModel
|
class Link < ApplicationModel
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :link_type, class_name: 'Link::Type'
|
belongs_to :link_type, class_name: 'Link::Type'
|
||||||
belongs_to :link_object, class_name: 'Link::Object'
|
belongs_to :link_object, class_name: 'Link::Object'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
after_destroy :touch_link_references
|
after_destroy :touch_link_references
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,10 @@ class Organization < ApplicationModel
|
||||||
include Organization::Assets
|
include Organization::Assets
|
||||||
include Organization::Search
|
include Organization::Search
|
||||||
include Organization::SearchIndex
|
include Organization::SearchIndex
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
has_many :members, class_name: 'User'
|
has_many :members, class_name: 'User'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
before_create :domain_cleanup
|
before_create :domain_cleanup
|
||||||
before_update :domain_cleanup
|
before_update :domain_cleanup
|
||||||
|
|
|
@ -4,8 +4,11 @@ require_dependency 'store/object'
|
||||||
require_dependency 'store/file'
|
require_dependency 'store/file'
|
||||||
|
|
||||||
class Store < ApplicationModel
|
class Store < ApplicationModel
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :store_object, class_name: 'Store::Object'
|
belongs_to :store_object, class_name: 'Store::Object'
|
||||||
belongs_to :store_file, class_name: 'Store::File'
|
belongs_to :store_file, class_name: 'Store::File'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
validates :filename, presence: true
|
validates :filename, presence: true
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Tag < ApplicationModel
|
class Tag < ApplicationModel
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :tag_object, class_name: 'Tag::Object'
|
belongs_to :tag_object, class_name: 'Tag::Object'
|
||||||
belongs_to :tag_item, class_name: 'Tag::Item'
|
belongs_to :tag_item, class_name: 'Tag::Item'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
# the noop is needed since Layout/EmptyLines detects
|
# the noop is needed since Layout/EmptyLines detects
|
||||||
# the block commend below wrongly as the measurement of
|
# the block commend below wrongly as the measurement of
|
||||||
|
|
|
@ -57,6 +57,8 @@ class Ticket < ApplicationModel
|
||||||
belongs_to :organization
|
belongs_to :organization
|
||||||
has_many :articles, class_name: 'Ticket::Article', after_add: :cache_update, after_remove: :cache_update, dependent: :destroy, inverse_of: :ticket
|
has_many :articles, class_name: 'Ticket::Article', after_add: :cache_update, after_remove: :cache_update, dependent: :destroy, inverse_of: :ticket
|
||||||
has_many :ticket_time_accounting, class_name: 'Ticket::TimeAccounting', dependent: :destroy, inverse_of: :ticket
|
has_many :ticket_time_accounting, class_name: 'Ticket::TimeAccounting', dependent: :destroy, inverse_of: :ticket
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :state, class_name: 'Ticket::State'
|
belongs_to :state, class_name: 'Ticket::State'
|
||||||
belongs_to :priority, class_name: 'Ticket::Priority'
|
belongs_to :priority, class_name: 'Ticket::Priority'
|
||||||
belongs_to :owner, class_name: 'User'
|
belongs_to :owner, class_name: 'User'
|
||||||
|
@ -65,6 +67,7 @@ class Ticket < ApplicationModel
|
||||||
belongs_to :updated_by, class_name: 'User'
|
belongs_to :updated_by, class_name: 'User'
|
||||||
belongs_to :create_article_type, class_name: 'Ticket::Article::Type'
|
belongs_to :create_article_type, class_name: 'Ticket::Article::Type'
|
||||||
belongs_to :create_article_sender, class_name: 'Ticket::Article::Sender'
|
belongs_to :create_article_sender, class_name: 'Ticket::Article::Sender'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
self.inheritance_column = nil
|
self.inheritance_column = nil
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,14 @@ class Ticket::Article < ApplicationModel
|
||||||
|
|
||||||
belongs_to :ticket
|
belongs_to :ticket
|
||||||
has_one :ticket_time_accounting, class_name: 'Ticket::TimeAccounting', foreign_key: :ticket_article_id, dependent: :destroy, inverse_of: :ticket_article
|
has_one :ticket_time_accounting, class_name: 'Ticket::TimeAccounting', foreign_key: :ticket_article_id, dependent: :destroy, inverse_of: :ticket_article
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :type, class_name: 'Ticket::Article::Type'
|
belongs_to :type, class_name: 'Ticket::Article::Type'
|
||||||
belongs_to :sender, class_name: 'Ticket::Article::Sender'
|
belongs_to :sender, class_name: 'Ticket::Article::Sender'
|
||||||
belongs_to :created_by, class_name: 'User'
|
belongs_to :created_by, class_name: 'User'
|
||||||
belongs_to :updated_by, class_name: 'User'
|
belongs_to :updated_by, class_name: 'User'
|
||||||
belongs_to :origin_by, class_name: 'User'
|
belongs_to :origin_by, class_name: 'User'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
before_create :check_subject, :check_body, :check_message_id_md5
|
before_create :check_subject, :check_body, :check_message_id_md5
|
||||||
before_update :check_subject, :check_body, :check_message_id_md5
|
before_update :check_subject, :check_body, :check_message_id_md5
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
class Ticket::State < ApplicationModel
|
class Ticket::State < ApplicationModel
|
||||||
include ChecksLatestChangeObserved
|
include ChecksLatestChangeObserved
|
||||||
|
|
||||||
|
# rubocop:disable Rails/InverseOf
|
||||||
belongs_to :state_type, class_name: 'Ticket::StateType', inverse_of: :states
|
belongs_to :state_type, class_name: 'Ticket::StateType', inverse_of: :states
|
||||||
belongs_to :next_state, class_name: 'Ticket::State'
|
belongs_to :next_state, class_name: 'Ticket::State'
|
||||||
|
# rubocop:enable Rails/InverseOf
|
||||||
|
|
||||||
after_create :ensure_defaults
|
after_create :ensure_defaults
|
||||||
after_update :ensure_defaults
|
after_update :ensure_defaults
|
||||||
|
|
Loading…
Reference in a new issue