Skip to content

Commit

Permalink
Supporting more the 20 chars for login
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Jul 15, 2013
1 parent f33b495 commit e53f213
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions bricks/zena/zena/migrate/20130712081512_alter_login_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AlterLoginUsers < ActiveRecord::Migration
def self.up
change_column :users, :login, :string, :limit => 255
end

def self.down
change_column :users, :login, :string, :limit => 20
end
end
4 changes: 3 additions & 1 deletion lib/zena/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def ancestry(path)
desc "Update vhost configuration file"
task :create_vhost, :roles => :web do
unless self[:host]
puts "HOST not set (use -s host=...)"
puts "HOST not set (use -s host=... -s lang_list=...)"
else
lang = self[:lang] ||= (self[:lang_list] || 'en').split(',').map(&:strip).first
self[:lang_list] ||= lang
vhost_files = []

public_path = Bricks.raw_config['public_path'] || '/public'
Expand Down
20 changes: 20 additions & 0 deletions test/unit/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ def test_visited_node_ids
assert_nothing_raised { users(:ant).destroy }
end
end

class GroupsUsersCounter < ActiveRecord::Base
set_table_name :groups_users
end

should 'remove links to groups' do
assert_difference('User.count', -1) do
assert_difference('GroupsUsersCounter.count', -2) do
assert_nothing_raised { users(:ant).destroy }
end
end
end

should 'not remove linked node' do
assert_difference('User.count', -1) do
assert_difference('Node.count', 0) do
assert_nothing_raised { users(:ant).destroy }
end
end
end
end # with admin rights
end # Destroying a user

Expand Down

0 comments on commit e53f213

Please sign in to comment.