Use a safer check for :scoped being deprecated.

This works even if ActiveRecord is not defined.
Merge pull request #288 from dougo/check-for-activerecord

Use a safer check for :scoped being deprecated.