Class: NullGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
EasyGenGenerator
Defined in:
lib/easy_gen/null/null_generator.rb

Constant Summary collapse

LOCATION =

bundle exec rails g null MyModel bundle exec rails d null MyModel

"domain"
TYPE =
"null"
AR_DEFAULTS =
{integer: 0,
string: '"No Value"',
text: '"No Value"',
float: 0.0,
decimal: 0.0,
binary: false,
boolean: false,
date: 'Date.parse("1 Jan 1970")',
datetime: 'Date.parse("1 Jan 1970")',
timestamp: 'Date.parse("1 Jan 1970")',
time:  'Time.parse("00:00:00")' }

Instance Method Summary collapse

Methods included from EasyGenGenerator

#copy_templates

Instance Method Details

#mainObject



32
33
34
35
# File 'lib/easy_gen/null/null_generator.rb', line 32

def main
  raise "No such model - please check naming" unless model_exists?
  copy_templates
end