X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fscroll.js.coffee;h=2bfb905c6fef19b94f1fb37c05490e9f50fabe18;hb=cc2dbf353c285c78423a8a29d7adf233e1651c6e;hp=9447642e325eef83d190be587baaa18f7616dffc;hpb=9529441f04dd2c502077a051b866eac838e5849e;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/models/scroll.js.coffee b/app/assets/javascripts/models/scroll.js.coffee index 9447642e..2bfb905c 100644 --- a/app/assets/javascripts/models/scroll.js.coffee +++ b/app/assets/javascripts/models/scroll.js.coffee @@ -12,10 +12,16 @@ class Pettanr.Scroll extends Peta.Binder visible: 0 } - initialize: () -> + author: () -> + new Pettanr.Cache.Retriever(Pettanr.Author, @get('author_id')) + + overwrite: (options) -> + operators = Pettanr.cache.operators + return false if not operators.author + @set('author_id', operators.author.id) + + initialize: (attr = {}, options = {}) -> + super(attr, options) if @id @url = @url + @id -class Pettanr.Scroll.Collection extends Backbone.Collection - model: Pettanr.Scroll - url: '/scrolls'