Skip to content

Instantly share code, notes, and snippets.

Created December 28, 2013 12:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kianryan/8159246 to your computer and use it in GitHub Desktop.
EDMX Element Checker
require 'rexml/document'
edmx =
doc =
mapped = []
constrained = []
doc.elements.each('edmx:Edmx/edmx:Runtime/edmx:ConceptualModels/Schema/Association') do |ele|
if ele.get_elements('ReferentialConstraint').any?
constrained.push ele.attribute("Name")
mapped.push ele.attribute("Name")
puts "Mapped Elements"
puts "---------------"
puts mapped
puts "Constrained Elements"
puts "--------------------"
puts constrained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment