Cross Reference: mappings_helper.rb
xref
: /
ontohub
/
app
/
helpers
/
mappings_helper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
mappings_helper.rb revision 0d3763fcd43f738899afcf8699b0e02b833c8132
module
MappingsHelper
def
sort_mapping_list
(
collection
)
hash
= {}
collection.each
_with_index
do
|
mapping
, i|
if
mapping.symbol_mappings.empty
?
hash
[
"empty#{i}"
] = [{
mapping
:
mapping
,
target
:
''
}]
else
mapping.symbol_mappings.each
do
|
symbol_mapping
|
sym
=
mapping.source.to_s.to
_sym
hash
[
sym
] ||= []
hash
[
sym
] << {
mapping
:
mapping
,
target
:
symbol_mapping.target
}
end
end
end
hash
end
end