Complete the code to add a uniqueness validation for the username attribute in a Rails model.
validates :username, [1]: trueThe uniqueness option ensures that the username is unique in the database.
Complete the code to make the uniqueness validation case insensitive.
validates :email, uniqueness: { [1]: false }Setting case_sensitive: false makes the uniqueness check ignore case differences.
Fix the error in the uniqueness validation syntax.
validates :nickname, uniqueness: [1]The uniqueness validation can take a hash of options. Using { case_sensitive: false } is correct syntax.
Fill both blanks to add a uniqueness validation scoped to the :account_id attribute.
validates :email, uniqueness: { [1]: :account_id, [2]: false }The scope option limits uniqueness to the given attribute, and case_sensitive controls case sensitivity.
Fill all three blanks to add a uniqueness validation with a custom error message and case insensitivity.
validates :username, uniqueness: { [1]: false, [2]: "[3]" }Set case_sensitive: false to ignore case, and use message to customize the error text.