Module: RSpec::Rails::Orm::Mongoid

Includes:
Base
Defined in:
lib/rspec_for_generators/rails_helpers/rails_orm.rb

Instance Method Summary collapse

Methods included from Model

#create_model, #model_file_name, #remove_model, #remove_models

Instance Method Details

#field(name, type = nil) ⇒ Object



58
59
60
61
# File 'lib/rspec_for_generators/rails_helpers/rails_orm.rb', line 58

def field name, type = nil
  return "field :#{name}, :type => #{type}" if type
  "field :#{name}"
end

#file_content(name) ⇒ Object



54
55
56
# File 'lib/rspec_for_generators/rails_helpers/rails_orm.rb', line 54

def file_content name
  file_w_include(name) { 'Mongoid::Document' }
end