lib/facemock/database/application.rb in facemock-0.0.6 vs lib/facemock/database/application.rb in facemock-0.0.7

- old
+ new

@@ -1,14 +1,13 @@ -require 'facemock/database' require 'facemock/database/table' -require 'sqlite3' -require 'hashie' +require 'facemock/database/user' module Facemock class Database class Application < Table TABLE_NAME = :applications COLUMN_NAMES = [:id, :secret, :created_at] + CHILDREN = [ User ] # WANT : DBに登録済みの値と重複しないようにする(id, secret) def initialize(options={}) opts = Hashie::Mash.new(options) @id = ( opts.id.to_i > 0 ) ? opts.id.to_i : (0..9).to_a.shuffle[0..15].join.to_i