Class: ZanTools::SpringGenerator

Inherits:
Object
  • Object
show all
Includes:
Generatable
Defined in:
lib/zan_tools/spring_generator.rb

Constant Summary collapse

ID_KEY =
'id'

Class Method Summary collapse

Methods included from Generatable

included

Class Method Details

.belongs_to(generator) ⇒ Object



54
55
# File 'lib/zan_tools/spring_generator.rb', line 54

def self.belongs_to(generator)
end

.has_many(generator) ⇒ Object



57
58
# File 'lib/zan_tools/spring_generator.rb', line 57

def self.has_many(generator)
end

.init!(name, fields) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/zan_tools/spring_generator.rb', line 45

def self.init!(name, fields)
  configure do |config|
    config.name = name.upper_camel
    config.fields = {ID_KEY => {'type'=>'Long'}}

    fields.each{|name, conf| config.field(name, conf) }
  end
end