What is best way to create primary key as a string field instead of integer in rails.
Correct Answer: when creating a new table don't add primary key using this create_table users, :id => false do |t| t.string :id, :null => false ...... end execute("ALTER TABLE users ADD PRIMARY KEY (id)") if not using id as primary key then in users model add the following line class User < ActiveRecord::Base self.primary_key = "column_name" .... end
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Ruby On Rails MCQ Questions