Module: Rails3::Assist::Orm::Mongoid
- Includes:
- Base
- Defined in:
- lib/rails3_artifactor/artifact/orm/mongoid.rb
Instance Method Summary collapse
- #field(name, type = nil) ⇒ Object
- #field_name ⇒ Object
- #new_model_content(name, options = {}, &block) ⇒ Object
- #orm_name ⇒ Object
Methods included from Base
Instance Method Details
#field(name, type = nil) ⇒ Object
18 19 20 21 |
# File 'lib/rails3_artifactor/artifact/orm/mongoid.rb', line 18 def field name, type = nil return "#{field_name} :#{name}, :type => #{type}" if type "#{field_name} :#{name}" end |
#field_name ⇒ Object
9 10 11 |
# File 'lib/rails3_artifactor/artifact/orm/mongoid.rb', line 9 def field_name 'field' end |
#new_model_content(name, options = {}, &block) ⇒ Object
13 14 15 16 |
# File 'lib/rails3_artifactor/artifact/orm/mongoid.rb', line 13 def new_model_content name, ={}, &block content = block ? yield : [:content] file_w_include(name, orm_marker_name(name, )) { content } end |
#orm_name ⇒ Object
5 6 7 |
# File 'lib/rails3_artifactor/artifact/orm/mongoid.rb', line 5 def orm_name 'Mongoid' end |