Created
November 26, 2013 05:12
-
-
Save pushrax/7653771 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class window.Testing extends Batman.App | |
data = [] | |
class Testing.Storage extends Batman.StorageAdapter | |
readAll: @skipIfError (env, next) -> | |
env.result = env.records = @getRecordsFromData(data, env.subject) | |
next() | |
class Testing.Model extends Batman.Model | |
@persist Testing.Storage | |
class Testing.Order extends Testing.Model | |
@resourceName: 'order' | |
@encode 'id' | |
for i in [1...50] | |
@encode "#{i}" | |
@belongsTo 'customer', inverseof: 'orders', saveInline: true | |
class Testing.Customer extends Testing.Model | |
@resourceName: 'customer' | |
@encode 'id' | |
for i in [1...50] | |
@encode "#{i}" | |
@hasMany 'orders', inverseOf: 'customer', saveInline: false | |
for i in [0...50] | |
data[i] = id: i | |
for j in [1...50] | |
data[i][j] = "aaaaaaaaaaaaaaaaaaa" | |
data[i].customer = id: i | |
for j in [1...50] | |
data[i].customer[j] = "aaaaaaaaaaaaaaaaaaa" | |
console.log "stringified size:", JSON.stringify(data).length | |
document.addEventListener 'DOMContentLoaded', -> | |
Testing.run() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment