Skip to content

Instantly share code, notes, and snippets.

@pehrlich
Created March 9, 2012 22:46
Show Gist options
  • Select an option

  • Save pehrlich/2009116 to your computer and use it in GitHub Desktop.

Select an option

Save pehrlich/2009116 to your computer and use it in GitHub Desktop.
monkey patch dynamic spine model configuration
Spine.Model.include
# this is a monkey patch to allow dynamic loading of attributes.
load_without_updating_config: Spine.Model.prototype.load
load: (atts)->
for key, value of atts
if @constructor.attributes.indexOf(key) == -1
@constructor.attributes.push key
@load_without_updating_config(atts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment