Skip to content
代码片段 群组 项目
提交 8b18112b 编辑于 作者: Abdul Wadood's avatar Abdul Wadood 提交者: Peter Leitzen
浏览文件

Fix false positives for Migration/SchemaAdditionMethodsNoPost cop

We allow `add_column` and `create_table` methods inside the `down`
method in post-deploy migrations. But if these methods were wrapped
inside a statement like `if` then the cop was raising an error.
For example, in the following, the 2nd example was being incorrectly
flagged as an offense:

```
def down
  add_column(:table, :column)
end
```

```
def down
  add_column(:table, :column) unless column_exists(:table, :column)
end
```
上级 555678cf
No related branches found
No related tags found
无相关合并请求
显示
11 个添加35 个删除
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册