]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset.rb
Removed debugging code.
[rails.git] / app / models / changeset.rb
index 7e2216f0e501165c6e2f1b2b870f52eb70e6b991..446ca351de81cd4d574722630cc4785284ffd30f 100644 (file)
@@ -12,7 +12,8 @@ class Changeset < ActiveRecord::Base
   has_many :old_ways
   has_many :old_relations
   
-  validates_presence_of :user_id, :created_at, :open
+  validates_presence_of :user_id, :created_at
+  validates_inclusion_of :open, :in => [ true, false ]
   
   # Use a method like this, so that we can easily change how we
   # determine whether a changeset is open, without breaking code in at 
@@ -39,13 +40,16 @@ class Changeset < ActiveRecord::Base
         end
       end
     rescue Exception => ex
-    print "noes "+ ex.to_s + "\n"
       cs = nil
     end
 
     return cs
   end
 
+  def tags_as_hash
+    return tags
+  end
+
   def tags
     unless @tags
       @tags = {}
@@ -70,6 +74,7 @@ class Changeset < ActiveRecord::Base
 
     Changeset.transaction do
       # fixme update modified_at time?
+      # FIXME there is no modified_at time, should it be added
       self.save!
     end