Use find_or_initialize_by rather find_or_initialize_by_key
Fix tests and deprecated warnings
@gstib
Added ruby version @gstib