Permalink
Browse files

no more generated ids and fixed rake build

  • Loading branch information...
1 parent 61d8ede commit 232b0f8ac93b19d7140f39ed5f35253f674b2f6e @jashkenas committed Oct 2, 2010
Showing with 2 additions and 5 deletions.
  1. +1 −3 Rakefile
  2. +1 −2 backbone.js
View
@@ -3,8 +3,6 @@ require 'closure-compiler'
desc "rebuild the backbone-min.js files for distribution"
task :build do
- files = Dir['lib/*.js']
- source = files.map {|f| File.read f }.join "\n\n"
- File.open('backbone.js', 'w+') {|f| f.write source }
+ source = File.read 'backbone.js'
File.open('backbone-min.js', 'w+') {|f| f.write Closure::Compiler.new.compress(source) }
end
View
@@ -96,7 +96,6 @@
Backbone.Model = function(attributes) {
this._attributes = {};
attributes = attributes || {};
- attributes.id = attributes.id || -_.uniqueId();
this.set(attributes, true);
this.cid = _.uniqueId('c');
this._formerAttributes = this.attributes();
@@ -147,7 +146,7 @@
// A model is new if it has never been saved to the server, and has a negative
// ID.
isNew : function() {
- return this.id < 0;
+ return !this.id;
},
// Call this method to fire manually fire a `changed` event for this model.

0 comments on commit 232b0f8

Please sign in to comment.