X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2347761266d8848dcdc42f9e5d9ef380fa04b89a..a8eb3a6ada2fafe77deba8456b61811b162e5faa:/app/models/changeset.rb diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 7e2216f0e..446ca351d 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -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