Class: RuboCop::Rails::SchemaLoader::AddIndex
- Defined in:
- lib/rubocop/rails/schema_loader/schema.rb
Overview
Represent an ‘add_index`
Instance Attribute Summary collapse
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Attributes inherited from Index
#columns, #expression, #name, #unique
Instance Method Summary collapse
-
#initialize(node) ⇒ AddIndex
constructor
A new instance of AddIndex.
Constructor Details
#initialize(node) ⇒ AddIndex
Returns a new instance of AddIndex.
180 181 182 183 184 185 186 187 188 |
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 180 def initialize(node) super @table_name = node.first_argument.value @columns, @expression = build_columns_or_expr(node.arguments[1]) @unique = nil analyze_keywords!(node) end |
Instance Attribute Details
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
178 179 180 |
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 178 def table_name @table_name end |