aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Xie <xieconnect@gmail.com>2010-07-25 00:43:02 +0800
committerHans de Graaff <hans@degraaff.org>2010-07-25 09:08:36 +0200
commit7e50fe330162a9a4c836118a3d36852826014332 (patch)
treec1e10b850be72054cc5a7b731979130d18f1d96f
parentfix User spec indention (diff)
downloadcouncil-webapp-7e50fe330162a9a4c836118a3d36852826014332.tar.gz
council-webapp-7e50fe330162a9a4c836118a3d36852826014332.tar.bz2
council-webapp-7e50fe330162a9a4c836118a3d36852826014332.zip
renamed default role to 'guest'
If default role is set to :guest, Hobo will auto-generate another migration do the renaming.
-rw-r--r--app/models/user.rb2
-rw-r--r--db/migrate/20100606021229_add_role_to_users.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 9350e30..2ab1a17 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,7 +5,7 @@ class User < ActiveRecord::Base
fields do
name :string, :required, :unique
email_address :email_address, :login => true
- role Role, :default => :guest, :limit => 20
+ role Role, :default => 'guest', :limit => 20
timestamps
end
diff --git a/db/migrate/20100606021229_add_role_to_users.rb b/db/migrate/20100606021229_add_role_to_users.rb
index 436acaf..8466952 100644
--- a/db/migrate/20100606021229_add_role_to_users.rb
+++ b/db/migrate/20100606021229_add_role_to_users.rb
@@ -1,6 +1,6 @@
class AddRoleToUsers < ActiveRecord::Migration
def self.up
- add_column :users, :role, :string, :limit => 20, :default => :guest
+ add_column :users, :role, :string, :limit => 20, :default => 'guest'
remove_column :users, :administrator
end