Module: HttpUtilities::Generators::OrmHelpers

Included in:
ActiveRecord::Generators::HttpUtilitiesGenerator
Defined in:
lib/generators/helpers/orm_helpers.rb

Instance Method Summary collapse

Instance Method Details

#model_exists?(model) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/generators/helpers/orm_helpers.rb', line 5

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

#model_path(model) ⇒ Object



9
10
11
# File 'lib/generators/helpers/orm_helpers.rb', line 9

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