Hopefully getting the database to init and reset itself (in testground.rb, need to make that more of a active_rpg.rb thing...
This commit is contained in:
parent
3579f47eda
commit
d81c397629
7 changed files with 35 additions and 25 deletions
|
|
@ -1,16 +1,16 @@
|
|||
class ActiveSqliteRecord
|
||||
@mc = nil # MongoConnect instance
|
||||
@doc = nil # MongoDocument instance....
|
||||
@id = nil # BSON ID for the Doc
|
||||
@sqlite_connect = nil # SQLiteConnect instance
|
||||
@row = nil # SQLite row...
|
||||
@id = nil # Row ID for the record
|
||||
|
||||
def initialize(mc, doc=nil)
|
||||
@mc = mc
|
||||
def initialize(sc, table, row=nil)
|
||||
@sqlite_connect = sc
|
||||
|
||||
if doc == nil then
|
||||
create()
|
||||
if row == nil then
|
||||
create(table)
|
||||
else
|
||||
@id = doc['_id']
|
||||
@doc = doc
|
||||
@id = row['_id']
|
||||
@row = row
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue