Used ActiveRecord::Base.primary_key instead of static id