0

したがって、レールアプリでユーザー名を case_insensitive にしようとしており、開発コードに :case_sensitive => false を追加しても問題なく動作しますが、heroku にプッシュしてもほとんど違いはありません。

何を与える?

何か案は?

class User < ActiveRecord::Base

  validates :name, presence: true, :uniqueness => { :case_sensitive => false }
  validates_format_of :email,:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i

  has_many :feeds, :through => :subscriptions, dependent: :destroy

  has_many :subscriptions

  has_secure_password
4

1 に答える 1

2

PostgreSQL は本質的に大文字と小文字を区別するため、case_insensitive 検証をモデルに追加しても、Postgresql db に基づくアプリには影響がないことが判明しました。

于 2012-09-11T19:07:52.427 に答える