Module: MongoidAdapter::InstanceMethods
- Defined in:
- lib/models/mongoid_adapter.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
62
63
64
65
|
# File 'lib/models/mongoid_adapter.rb', line 62
def method_missing(meth, *args, &block)
@instance.send(meth, *args, &block)
end
|
Instance Method Details
#errors ⇒ Object
58
59
60
|
# File 'lib/models/mongoid_adapter.rb', line 58
def errors
@instance.errors.full_messages.join(', ')
end
|
#saved ⇒ Object
54
55
56
|
# File 'lib/models/mongoid_adapter.rb', line 54
def saved
@instance.valid?
end
|
#update(attributes) ⇒ Object
49
50
51
52
|
# File 'lib/models/mongoid_adapter.rb', line 49
def update(attributes)
@instance.update_attributes(attributes)
@instance.save
end
|
#valid ⇒ Object
45
46
47
|
# File 'lib/models/mongoid_adapter.rb', line 45
def valid
@instance.valid?
end
|