Deprecated syntax

updated for rails 4