Class: ActiveForce::ModelGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/active_force/model/model_generator.rb

Defined Under Namespace

Classes: Attribute, String

Instance Method Summary collapse

Instance Method Details

#create_model_fileObject



7
8
9
10
11
# File 'lib/generators/active_force/model/model_generator.rb', line 7

def create_model_file
  @table_name = file_name.capitalize
  @class_name = @table_name.gsub '__c', ''
  template "model.rb.erb", "app/models/#{@class_name.downcase}.rb" if table_exists?
end