diff --git a/generators/models_from_tables/templates/model.rb b/generators/models_from_tables/templates/model.rb
index <HASH>..<HASH> 100644
--- a/generators/models_from_tables/templates/model.rb
+++ b/generators/models_from_tables/templates/model.rb
@@ -1,6 +1,6 @@
 class <%= class_name -%> < ActiveRecord::Base
   set_table_name :<%= table_name %>
-  <%= "set_primary_key #{primary_key}" if primary_key %>
+  <%= "set_primary_key #{primary_key.inspect}" if primary_key %>
   
   # Relationships
   <%- relations[:has_some].each do |class_name, foreign_key|
fixed typo with primary key in generated model file