has_many :old_relations
has_many :comments, -> { where(:visible => true).order(:created_at) }, :class_name => "ChangesetComment"
has_many :old_relations
has_many :comments, -> { where(:visible => true).order(:created_at) }, :class_name => "ChangesetComment"
- has_and_belongs_to_many :subscribers, :class_name => 'User', :join_table => 'changesets_subscribers', :association_foreign_key => 'subscriber_id'
+ has_and_belongs_to_many :subscribers, :class_name => "User", :join_table => "changesets_subscribers", :association_foreign_key => "subscriber_id"
validates_presence_of :id, :on => :update
validates_presence_of :user_id, :created_at, :closed_at, :num_changes
validates_presence_of :id, :on => :update
validates_presence_of :user_id, :created_at, :closed_at, :num_changes
return Changeset.from_xml_node(pt, create)
end
fail OSM::APIBadXMLError.new("changeset", xml, "XML doesn't contain an osm/changeset element.")
return Changeset.from_xml_node(pt, create)
end
fail OSM::APIBadXMLError.new("changeset", xml, "XML doesn't contain an osm/changeset element.")
- pt.find('tag').each do |tag|
- fail OSM::APIBadXMLError.new("changeset", pt, "tag is missing key") if tag['k'].nil?
- fail OSM::APIBadXMLError.new("changeset", pt, "tag is missing value") if tag['v'].nil?
- cs.add_tag_keyval(tag['k'], tag['v'])
+ pt.find("tag").each do |tag|
+ fail OSM::APIBadXMLError.new("changeset", pt, "tag is missing key") if tag["k"].nil?
+ fail OSM::APIBadXMLError.new("changeset", pt, "tag is missing value") if tag["v"].nil?
+ cs.add_tag_keyval(tag["k"], tag["v"])
- el1['user'] = user_display_name_cache[user_id] unless user_display_name_cache[user_id].nil?
- el1['uid'] = user_id.to_s if user.data_public?
+ el1["user"] = user_display_name_cache[user_id] unless user_display_name_cache[user_id].nil?
+ el1["uid"] = user_id.to_s if user.data_public?
- el1['created_at'] = created_at.xmlschema
- el1['closed_at'] = closed_at.xmlschema unless is_open?
- el1['open'] = is_open?.to_s
+ el1["created_at"] = created_at.xmlschema
+ el1["closed_at"] = closed_at.xmlschema unless is_open?
+ el1["open"] = is_open?.to_s
- el3 = XML::Node.new('comment')
- el3['date'] = comment.created_at.xmlschema
- el3['uid'] = comment.author.id.to_s if comment.author.data_public?
- el3['user'] = comment.author.display_name.to_s if comment.author.data_public?
- el4 = XML::Node.new('text')
+ el3 = XML::Node.new("comment")
+ el3["date"] = comment.created_at.xmlschema
+ el3["uid"] = comment.author.id.to_s if comment.author.data_public?
+ el3["user"] = comment.author.display_name.to_s if comment.author.data_public?
+ el4 = XML::Node.new("text")