class Pettanr.User extends Backbone.Model url: '/users/' defaults: { id: null } author: () -> artist: () -> initialize: () -> if @id @url = @url + @id class Pettanr.User.Current extends Pettanr.User save: (model_attr, after_save = null) -> super(model_attr, { success: (model, response, options) => author = new Pettanr.Author(@get('author')) if @get('author') artist = new Pettanr.Artist(@get('artist')) if @get('artist') window.operators = new Pettanr.Operator({ user: this, author: author, artist: artist }) if after_save after_save(this) error: (model, response, options) -> r = new Pettanr.Views.User.Index({}) $("#pettanr").html(r.render().el) }) initialize: () -> @url = '/users/sign_in'