diff --git a/.rubocop.yml b/.rubocop.yml index 6579930..86175c2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,4 @@ -require: +plugins: - rubocop-performance - rubocop-rails - rubocop-rspec diff --git a/lib/operations/form/base.rb b/lib/operations/form/base.rb index 5ae8759..5d3ecd0 100644 --- a/lib/operations/form/base.rb +++ b/lib/operations/form/base.rb @@ -89,6 +89,8 @@ def reflect_on_association(...); end # :nodoc: module InstanceMethods + delegate :model_name, to: :class + # Copied from globalize-accessors, should be deprecated and removed as it is not a core method def localized_attr_name_for(attr_name, locale) "#{attr_name}_#{locale.to_s.underscore}" @@ -138,10 +140,6 @@ def respond_to_missing?(name, *) operation_result&.context&.key?(name) end - def model_name - self.class.model_name - end - def persisted? self.class.persisted.nil? ? read_attribute(self.class.primary_key).present? : self.class.persisted end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 576cabe..f1817fb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ require "bundler/setup" require "operations" -require "pp" # rubocop:disable Lint/RedundantRequireStatement +require "pp" require "active_record" require "database_cleaner-active_record" require "./spec/support/test_helpers"