removed user 'donor?' method and changed default badge_id from 0 to 1

This commit is contained in:
MrYummy
2017-06-18 18:51:01 +02:00
parent 91169ab103
commit b73ba5d739
3 changed files with 3 additions and 7 deletions

View File

@@ -30,10 +30,6 @@ class User < ActiveRecord::Base
self == user
end
def donor?
!!self.donor
end
def confirmed?
!!self.confirmed
end

View File

@@ -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

View File

@@ -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