diff options
| author | Luc Donnet | 2014-11-06 12:15:19 +0100 |
|---|---|---|
| committer | Luc Donnet | 2014-11-06 12:15:19 +0100 |
| commit | 6848cd9ff6dbc567d1900e7f8cdcefe0c3bd5202 (patch) | |
| tree | dddffb38f8a2db32e3d6489be094bc4a08eab6a3 /app/models | |
| parent | 2b86d2428d5da8be4499fc1fec2976f6c70fa34e (diff) | |
| download | chouette-core-6848cd9ff6dbc567d1900e7f8cdcefe0c3bd5202.tar.bz2 | |
Update devise sign in and sign up design
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/organisation.rb | 3 | ||||
| -rw-r--r-- | app/models/user.rb | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 17cf9a8f2..f4b2e35f8 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -3,6 +3,5 @@ class Organisation < ActiveRecord::Base has_many :users, :dependent => :destroy has_many :referentials, :dependent => :destroy - validates_presence_of :name - validates_uniqueness_of :name + validates :name, :presence => true, :uniqueness => true end diff --git a/app/models/user.rb b/app/models/user.rb index 1889a3bf0..6c14b93fb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,11 +11,11 @@ class User < ActiveRecord::Base belongs_to :organisation accepts_nested_attributes_for :organisation - - validates_presence_of :email - validates_presence_of :name - validates_presence_of :password - validates_presence_of :password_confirmation + + validates :organisation, :presence => true + validates :email, :presence => true, :uniqueness => true + validates :name, :presence => true + validates :password, :presence => true, :confirmation => true before_validation(:on => :create) do self.password ||= Devise.friendly_token.first(6) |
