summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMrYummy <elemental428@gmail.com>2017-06-18 18:51:01 +0200
committerMrYummy <elemental428@gmail.com>2017-06-18 13:11:36 -0400
commitb73ba5d739f6c1d3a84c5ea1128cdbe5320d950e (patch)
treef03bfc4658fe42df70aa3d9450311deda884423f
parent91169ab103234feb78d0a3882d9b89c3ef1dfad2 (diff)
removed user 'donor?' method and changed default badge_id from 0 to 1
-rw-r--r--app/models/user.rb4
-rw-r--r--db/migrate/20170319193517_add_badge_id_to_users.rb2
-rw-r--r--db/schema.rb4
3 files changed, 3 insertions, 7 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 52b7130..d755646 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -30,10 +30,6 @@ class User < ActiveRecord::Base
self == user
end
- def donor?
- !!self.donor
- end
-
def confirmed?
!!self.confirmed
end
diff --git a/db/migrate/20170319193517_add_badge_id_to_users.rb b/db/migrate/20170319193517_add_badge_id_to_users.rb
index 19b58de..4738e11 100644
--- a/db/migrate/20170319193517_add_badge_id_to_users.rb
+++ b/db/migrate/20170319193517_add_badge_id_to_users.rb
@@ -10,7 +10,7 @@ class AddBadgeIdToUsers < ActiveRecord::Migration
Badge.create!({name: "none", symbol: "", color: "#000"})
dbadge = Badge.create!({name: "donor", symbol: "$", color: "#f60"})
- add_column :users, :badge_id, :integer, default: 0
+ add_column :users, :badge_id, :integer, default: 1
User.where(donor: true).update_all(badge_id: dbadge.id)
remove_column :users, :donor
end
diff --git a/db/schema.rb b/db/schema.rb
index 916c41f..f2d73de 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -88,8 +88,8 @@ ActiveRecord::Schema.define(version: 20170522210610) do
end
create_table "register_tokens", force: :cascade do |t|
- t.string "uuid", limit: 32, null: false
- t.string "token", limit: 6, null: false
+ t.string "uuid", limit: 191, null: false
+ t.string "token", limit: 191, null: false
t.string "email", limit: 191, null: false
end