rails/rails — pull request #17915 by deeeki (2014-12-04 18:17:29+00:00)
Title: Fix AR::Relation to unscope exlusive range conditions

An inclusive range condition like `where(created_at: 1.day.ago..Time.now)` works, but an exclusive one like `where(created_at: 1.day.ago...Time.now)` doesn't.

reproduction on rails console
```
irb(main):001:0> User.unscoped.where(created_at: 1.day.ago...Time.now).unscope(where: :created_at).to_sql
=> "SELECT \"users\".* FROM \"users\" WHERE (\"users\".\"created_at\" >= '2014-12-03 17:28:01.731356' AND \"users\".\"created_at\" < '2014-12-04 17:28:01.731977')"
```

An exclusive range condition turns to `Arel::Node::And` that contains `Arel::Nodes::GreaterThanOrEqual` and `Arel::Nodes::LessThan`. Previous logic doesn't work with `Arel::Node::And`. So I refactored to detect `Arel::Attributes::Attribute` directly.