class RuboCop::Cop::Rails::TableNameAssignment
self.table_name = :some_other_name
self.table_name = ‘some_table_name’
# bad
@example
For more information: api.rubyonrails.org/classes/ActiveRecord/Inheritance.html<br>STI base classes named ‘Base` are ignored by this cop.
the default prefix, `self.table_name_prefix` might better suit your needs:
If you wish to add a prefix in front of your model, or wish to change
a table name, you may want to look at Inflections:
If you need to change how your model’s name is translated to
on a legacy project.
such as not having control over the database, or working
`self.table_name=‘ should only be used for very good reasons,
Enforces the absence of explicit table name assignment.
def on_class(class_node)
def on_class(class_node) return if base_class?(class_node) find_set_table_name(class_node).each { |node| add_offense(node) } end