Fix metadata keys validation to work with rails 3.0

The method used before was for rails >= 3.1