JackDanger/permanent_records — pull request #28 by ichi (2013-04-03 06:11:57+00:00)
Title: use arel instead of plain SQL

Hi!

sample code:

```ruby
Design.where(enabled: false).deleted.where_values.reduce(:or).to_sql
```

expected:

```ruby
#=> "(`designs`.`enabled` = 0 OR `designs`.`deleted_at` IS NOT NULL)"
```

actual:

```ruby
#=> "(`designs`.`enabled` = 0 OR 'designs.deleted_at IS NOT NULL')"
```

reason:
#deleted / #not_deleted are implemented using plain SQL.

solution:
fix #deleted / #not_deleted using arel.