Replace deprecated use of Relation#first with finder options
Treat rails 4 the same as rails 3
Replace deprecated filter method in Filter class