= Cops

In RuboCop lingo the various checks performed on the code are called cops.
Each cop is responsible for detecting one particular offense.
RuboCop Rails has only one Rails department.

Some of the Rails cops have configuration options, allowing them to
enforce different coding conventions.

== Rails

Rails cops check for Rails best practices and coding conventions. Many of the them are
based on the https://rails.rubystyle.guide/[Rails Style Guide].

// START_COP_LIST

=== Department xref:cops_rails.adoc[Rails]

* xref:cops_rails.adoc#railsactioncontrollerflashbeforerender[Rails/ActionControllerFlashBeforeRender]
* xref:cops_rails.adoc#railsactioncontrollertestcase[Rails/ActionControllerTestCase]
* xref:cops_rails.adoc#railsactionfilter[Rails/ActionFilter]
* xref:cops_rails.adoc#railsactionorder[Rails/ActionOrder]
* xref:cops_rails.adoc#railsactiverecordaliases[Rails/ActiveRecordAliases]
* xref:cops_rails.adoc#railsactiverecordcallbacksorder[Rails/ActiveRecordCallbacksOrder]
* xref:cops_rails.adoc#railsactiverecordoverride[Rails/ActiveRecordOverride]
* xref:cops_rails.adoc#railsactivesupportaliases[Rails/ActiveSupportAliases]
* xref:cops_rails.adoc#railsactivesupportonload[Rails/ActiveSupportOnLoad]
* xref:cops_rails.adoc#railsaddcolumnindex[Rails/AddColumnIndex]
* xref:cops_rails.adoc#railsaftercommitoverride[Rails/AfterCommitOverride]
* xref:cops_rails.adoc#railsapplicationcontroller[Rails/ApplicationController]
* xref:cops_rails.adoc#railsapplicationjob[Rails/ApplicationJob]
* xref:cops_rails.adoc#railsapplicationmailer[Rails/ApplicationMailer]
* xref:cops_rails.adoc#railsapplicationrecord[Rails/ApplicationRecord]
* xref:cops_rails.adoc#railsarelstar[Rails/ArelStar]
* xref:cops_rails.adoc#railsassertnot[Rails/AssertNot]
* xref:cops_rails.adoc#railsattributedefaultblockvalue[Rails/AttributeDefaultBlockValue]
* xref:cops_rails.adoc#railsbelongsto[Rails/BelongsTo]
* xref:cops_rails.adoc#railsblank[Rails/Blank]
* xref:cops_rails.adoc#railsbulkchangetable[Rails/BulkChangeTable]
* xref:cops_rails.adoc#railscompactblank[Rails/CompactBlank]
* xref:cops_rails.adoc#railscontenttag[Rails/ContentTag]
* xref:cops_rails.adoc#railscreatetablewithtimestamps[Rails/CreateTableWithTimestamps]
* xref:cops_rails.adoc#railsdangerouscolumnnames[Rails/DangerousColumnNames]
* xref:cops_rails.adoc#railsdate[Rails/Date]
* xref:cops_rails.adoc#railsdefaultscope[Rails/DefaultScope]
* xref:cops_rails.adoc#railsdelegate[Rails/Delegate]
* xref:cops_rails.adoc#railsdelegateallowblank[Rails/DelegateAllowBlank]
* xref:cops_rails.adoc#railsdeprecatedactivemodelerrorsmethods[Rails/DeprecatedActiveModelErrorsMethods]
* xref:cops_rails.adoc#railsdotseparatedkeys[Rails/DotSeparatedKeys]
* xref:cops_rails.adoc#railsduplicateassociation[Rails/DuplicateAssociation]
* xref:cops_rails.adoc#railsduplicatescope[Rails/DuplicateScope]
* xref:cops_rails.adoc#railsdurationarithmetic[Rails/DurationArithmetic]
* xref:cops_rails.adoc#railsdynamicfindby[Rails/DynamicFindBy]
* xref:cops_rails.adoc#railseagerevaluationlogmessage[Rails/EagerEvaluationLogMessage]
* xref:cops_rails.adoc#railsenumhash[Rails/EnumHash]
* xref:cops_rails.adoc#railsenumsyntax[Rails/EnumSyntax]
* xref:cops_rails.adoc#railsenumuniqueness[Rails/EnumUniqueness]
* xref:cops_rails.adoc#railsenv[Rails/Env]
* xref:cops_rails.adoc#railsenvlocal[Rails/EnvLocal]
* xref:cops_rails.adoc#railsenvironmentcomparison[Rails/EnvironmentComparison]
* xref:cops_rails.adoc#railsenvironmentvariableaccess[Rails/EnvironmentVariableAccess]
* xref:cops_rails.adoc#railsexit[Rails/Exit]
* xref:cops_rails.adoc#railsexpandeddaterange[Rails/ExpandedDateRange]
* xref:cops_rails.adoc#railsfilepath[Rails/FilePath]
* xref:cops_rails.adoc#railsfindby[Rails/FindBy]
* xref:cops_rails.adoc#railsfindbyid[Rails/FindById]
* xref:cops_rails.adoc#railsfindbyorassignmentmemoization[Rails/FindByOrAssignmentMemoization]
* xref:cops_rails.adoc#railsfindeach[Rails/FindEach]
* xref:cops_rails.adoc#railsfreezetime[Rails/FreezeTime]
* xref:cops_rails.adoc#railshasandbelongstomany[Rails/HasAndBelongsToMany]
* xref:cops_rails.adoc#railshasmanyorhasonedependent[Rails/HasManyOrHasOneDependent]
* xref:cops_rails.adoc#railshelperinstancevariable[Rails/HelperInstanceVariable]
* xref:cops_rails.adoc#railshttppositionalarguments[Rails/HttpPositionalArguments]
* xref:cops_rails.adoc#railshttpstatus[Rails/HttpStatus]
* xref:cops_rails.adoc#railshttpstatusnameconsistency[Rails/HttpStatusNameConsistency]
* xref:cops_rails.adoc#railsi18nlazylookup[Rails/I18nLazyLookup]
* xref:cops_rails.adoc#railsi18nlocaleassignment[Rails/I18nLocaleAssignment]
* xref:cops_rails.adoc#railsi18nlocaletexts[Rails/I18nLocaleTexts]
* xref:cops_rails.adoc#railsignoredcolumnsassignment[Rails/IgnoredColumnsAssignment]
* xref:cops_rails.adoc#railsignoredskipactionfilteroption[Rails/IgnoredSkipActionFilterOption]
* xref:cops_rails.adoc#railsindexby[Rails/IndexBy]
* xref:cops_rails.adoc#railsindexwith[Rails/IndexWith]
* xref:cops_rails.adoc#railsinquiry[Rails/Inquiry]
* xref:cops_rails.adoc#railsinverseof[Rails/InverseOf]
* xref:cops_rails.adoc#railslexicallyscopedactionfilter[Rails/LexicallyScopedActionFilter]
* xref:cops_rails.adoc#railslinktoblank[Rails/LinkToBlank]
* xref:cops_rails.adoc#railsmailername[Rails/MailerName]
* xref:cops_rails.adoc#railsmatchroute[Rails/MatchRoute]
* xref:cops_rails.adoc#railsmigrationclassname[Rails/MigrationClassName]
* xref:cops_rails.adoc#railsmultipleroutepaths[Rails/MultipleRoutePaths]
* xref:cops_rails.adoc#railsnegateinclude[Rails/NegateInclude]
* xref:cops_rails.adoc#railsnotnullcolumn[Rails/NotNullColumn]
* xref:cops_rails.adoc#railsorderarguments[Rails/OrderArguments]
* xref:cops_rails.adoc#railsorderbyid[Rails/OrderById]
* xref:cops_rails.adoc#railsoutput[Rails/Output]
* xref:cops_rails.adoc#railsoutputsafety[Rails/OutputSafety]
* xref:cops_rails.adoc#railspick[Rails/Pick]
* xref:cops_rails.adoc#railspluck[Rails/Pluck]
* xref:cops_rails.adoc#railspluckid[Rails/PluckId]
* xref:cops_rails.adoc#railspluckinwhere[Rails/PluckInWhere]
* xref:cops_rails.adoc#railspluralizationgrammar[Rails/PluralizationGrammar]
* xref:cops_rails.adoc#railspresence[Rails/Presence]
* xref:cops_rails.adoc#railspresent[Rails/Present]
* xref:cops_rails.adoc#railsrakeenvironment[Rails/RakeEnvironment]
* xref:cops_rails.adoc#railsreadwriteattribute[Rails/ReadWriteAttribute]
* xref:cops_rails.adoc#railsredirectbackorto[Rails/RedirectBackOrTo]
* xref:cops_rails.adoc#railsredundantactiverecordallmethod[Rails/RedundantActiveRecordAllMethod]
* xref:cops_rails.adoc#railsredundantallownil[Rails/RedundantAllowNil]
* xref:cops_rails.adoc#railsredundantforeignkey[Rails/RedundantForeignKey]
* xref:cops_rails.adoc#railsredundantpresencevalidationonbelongsto[Rails/RedundantPresenceValidationOnBelongsTo]
* xref:cops_rails.adoc#railsredundantreceiverinwithoptions[Rails/RedundantReceiverInWithOptions]
* xref:cops_rails.adoc#railsredundanttravelback[Rails/RedundantTravelBack]
* xref:cops_rails.adoc#railsreflectionclassname[Rails/ReflectionClassName]
* xref:cops_rails.adoc#railsrefutemethods[Rails/RefuteMethods]
* xref:cops_rails.adoc#railsrelativedateconstant[Rails/RelativeDateConstant]
* xref:cops_rails.adoc#railsrenderinline[Rails/RenderInline]
* xref:cops_rails.adoc#railsrenderplaintext[Rails/RenderPlainText]
* xref:cops_rails.adoc#railsrequestreferer[Rails/RequestReferer]
* xref:cops_rails.adoc#railsrequiredependency[Rails/RequireDependency]
* xref:cops_rails.adoc#railsresponseparsedbody[Rails/ResponseParsedBody]
* xref:cops_rails.adoc#railsreversiblemigration[Rails/ReversibleMigration]
* xref:cops_rails.adoc#railsreversiblemigrationmethoddefinition[Rails/ReversibleMigrationMethodDefinition]
* xref:cops_rails.adoc#railsrootjoinchain[Rails/RootJoinChain]
* xref:cops_rails.adoc#railsrootpathnamemethods[Rails/RootPathnameMethods]
* xref:cops_rails.adoc#railsrootpublicpath[Rails/RootPublicPath]
* xref:cops_rails.adoc#railssafenavigation[Rails/SafeNavigation]
* xref:cops_rails.adoc#railssafenavigationwithblank[Rails/SafeNavigationWithBlank]
* xref:cops_rails.adoc#railssavebang[Rails/SaveBang]
* xref:cops_rails.adoc#railsschemacomment[Rails/SchemaComment]
* xref:cops_rails.adoc#railsscopeargs[Rails/ScopeArgs]
* xref:cops_rails.adoc#railsselectmap[Rails/SelectMap]
* xref:cops_rails.adoc#railsshorti18n[Rails/ShortI18n]
* xref:cops_rails.adoc#railsskipsmodelvalidations[Rails/SkipsModelValidations]
* xref:cops_rails.adoc#railssquishedsqlheredocs[Rails/SquishedSQLHeredocs]
* xref:cops_rails.adoc#railsstripheredoc[Rails/StripHeredoc]
* xref:cops_rails.adoc#railsstrongparametersexpect[Rails/StrongParametersExpect]
* xref:cops_rails.adoc#railstablenameassignment[Rails/TableNameAssignment]
* xref:cops_rails.adoc#railsthreestatebooleancolumn[Rails/ThreeStateBooleanColumn]
* xref:cops_rails.adoc#railstimezone[Rails/TimeZone]
* xref:cops_rails.adoc#railstimezoneassignment[Rails/TimeZoneAssignment]
* xref:cops_rails.adoc#railstoformatteds[Rails/ToFormattedS]
* xref:cops_rails.adoc#railstoswithargument[Rails/ToSWithArgument]
* xref:cops_rails.adoc#railstoplevelhashwithindifferentaccess[Rails/TopLevelHashWithIndifferentAccess]
* xref:cops_rails.adoc#railstransactionexitstatement[Rails/TransactionExitStatement]
* xref:cops_rails.adoc#railsuniqbeforepluck[Rails/UniqBeforePluck]
* xref:cops_rails.adoc#railsuniquevalidationwithoutindex[Rails/UniqueValidationWithoutIndex]
* xref:cops_rails.adoc#railsunknownenv[Rails/UnknownEnv]
* xref:cops_rails.adoc#railsunusedignoredcolumns[Rails/UnusedIgnoredColumns]
* xref:cops_rails.adoc#railsunusedrendercontent[Rails/UnusedRenderContent]
* xref:cops_rails.adoc#railsvalidation[Rails/Validation]
* xref:cops_rails.adoc#railswhereequals[Rails/WhereEquals]
* xref:cops_rails.adoc#railswhereexists[Rails/WhereExists]
* xref:cops_rails.adoc#railswheremissing[Rails/WhereMissing]
* xref:cops_rails.adoc#railswherenot[Rails/WhereNot]
* xref:cops_rails.adoc#railswherenotwithmultipleconditions[Rails/WhereNotWithMultipleConditions]
* xref:cops_rails.adoc#railswhererange[Rails/WhereRange]

// END_COP_LIST
