aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorrhenium <rhenium@rhe.jp>2014-06-28 16:21:59 +0900
committerrhenium <rhenium@rhe.jp>2014-06-28 16:21:59 +0900
commite57d1c09aec2e21069e8d6250ff40360bcded315 (patch)
tree67028a5b13e0f6cefbb81259c64c15aa10c1ec81 /app/models/account.rb
parent4b848d92557fca967301557aec278e790dc44645 (diff)
downloadaclog-e57d1c09aec2e21069e8d6250ff40360bcded315.tar.gz
db: reorganize accounts (remove private, rename notification to notification_enabled, add index)
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index e71d0f1..c7b6d90 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -1,13 +1,12 @@
require "msgpack/rpc/transport/unix"
class Account < ActiveRecord::Base
- enum status: { active: 0, inactive: 1 }
+ enum status: { active: 0, inactive: 1, revoked: 2 }
belongs_to :user
scope :for_node, ->(block_number) { active.where("id % ? = ?", Settings.collector.nodes_count, block_number) }
- def notification?; notification end
- def private?; private end
+ def notification_enabled?; notification_enabled end
def self.create_or_update(hash)
account = where(user_id: hash[:user_id]).first_or_initialize