lib/facemock/database/user.rb in facemock-0.0.6 vs lib/facemock/database/user.rb in facemock-0.0.7
- old
+ new
@@ -1,14 +1,14 @@
-require 'facemock/database'
require 'facemock/database/table'
-require 'sqlite3'
-require 'hashie'
+require 'facemock/database/permission'
+require 'facemock/database/authorization_code'
module Facemock
class Database
class User < Table
TABLE_NAME = :users
COLUMN_NAMES = [:id, :name, :email, :password, :installed, :access_token, :application_id, :created_at]
+ CHILDREN = [ Permission, AuthorizationCode ]
def initialize(options={})
opts = Hashie::Mash.new(options)
@id = (opts.id.to_i > 0) ? opts.id.to_i : ("10000" + (0..9).to_a.shuffle[0..10].join).to_i
@name = opts.name || rand(36**10).to_s(36)