Module: Bushido::Generators::OrmHelpers

Included in:
ActiveRecord::Generators::BushidoGenerator
Defined in:
lib/generators/bushido/orm_helpers.rb

Instance Method Summary collapse

Instance Method Details

#model_contentsObject



4
5
6
7
8
9
10
# File 'lib/generators/bushido/orm_helpers.rb', line 4

def model_contents
<<-CONTENT
  # Bind to a shared Bushido model
  bushido :customer_lead

CONTENT
end

#model_exists?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/generators/bushido/orm_helpers.rb', line 12

def model_exists?
  File.exists?(File.join(destination_root, model_path))
end

#model_pathObject



16
17
18
# File 'lib/generators/bushido/orm_helpers.rb', line 16

def model_path
  @model_path ||= File.join("app", "models", "#{file_path}.rb")
end