Method: CrailsDestroyGenerator.make_file

Defined in:
lib/metarecord/generators/crails/destroy_generator.rb

.make_file(filename, data) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/metarecord/generators/crails/destroy_generator.rb', line 49

def make_file filename, data
  include = "lib/" + filename[0...-2] + "hpp"
  source  = "#include \"#{include}\"\n"
  source += "#include \"lib/#{filename[0...-2]}queries.hpp\"\n"
  source += "#include <crails/odb/helpers.hpp>\n"
  source += "#include <crails/odb/any.hpp>\n"
  source += "#include <#{GeneratorBase.odb_connection[:include]}>\n"
  source += "#include \"lib/odb/application-odb.hxx\"\n"
  source += (collect_includes_for filename).join "\n"
  source += "\n" + (data[:bodies].join "\n")
end