From d55b3ac0d977c1638409a3f5d3ed1191e4881346 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 25 Sep 2014 08:20:20 +0200 Subject: [PATCH] Disable login per default. --- app/models/user.rb | 3 ++ .../20140831000001_create_object_manager.rb | 9 ++---- .../20140925000001_update_object_manager3.rb | 32 +++++++++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20140925000001_update_object_manager3.rb diff --git a/app/models/user.rb b/app/models/user.rb index 08d0621bf..6011288f4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -463,6 +463,9 @@ returns end def check_login + if !self.login && self.email + self.login = self.email + end if self.login self.login = self.login.downcase check = true diff --git a/db/migrate/20140831000001_create_object_manager.rb b/db/migrate/20140831000001_create_object_manager.rb index c1e79f9e3..7fcdb4a77 100644 --- a/db/migrate/20140831000001_create_object_manager.rb +++ b/db/migrate/20140831000001_create_object_manager.rb @@ -500,7 +500,7 @@ class CreateObjectManager < ActiveRecord::Migration :data_option => { :type => 'text', :maxlength => 100, - :null => false, + :null => true, :autocapitalize => false, }, :editable => false, @@ -508,12 +508,7 @@ class CreateObjectManager < ActiveRecord::Migration :screens => { :signup => {}, :invite_agent => {}, - :edit => { - :Agent => {}, - :Admin => { - :null => false, - }, - }, + :edit => {}, }, :pending_migration => false, :position => 100, diff --git a/db/migrate/20140925000001_update_object_manager3.rb b/db/migrate/20140925000001_update_object_manager3.rb new file mode 100644 index 000000000..cfb45165f --- /dev/null +++ b/db/migrate/20140925000001_update_object_manager3.rb @@ -0,0 +1,32 @@ +class UpdateObjectManager2 < ActiveRecord::Migration + def up + + ObjectManager::Attribute.add( + :object => 'User', + :name => 'login', + :display => 'Login', + :data_type => 'input', + :data_option => { + :type => 'text', + :maxlength => 100, + :null => true, + :autocapitalize => false, + }, + :editable => false, + :active => true, + :screens => { + :signup => {}, + :invite_agent => {}, + :edit => {}, + }, + :pending_migration => false, + :position => 100, + :created_by_id => 1, + :updated_by_id => 1, + ) + + end + + def down + end +end