Module: ArAdapter::InstanceMethods
- Defined in:
- lib/models/ar_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
61
62
63
64
|
# File 'lib/models/ar_adapter.rb', line 61
def method_missing(meth, *args, &block)
@instance.send(meth, *args, &block)
end
|
Instance Method Details
#errors ⇒ Object
46
47
48
49
50
|
# File 'lib/models/ar_adapter.rb', line 46
def errors
@instance.errors.collect do |k,v|
"#{k} #{v}"
end.join(', ')
end
|
#saved ⇒ Object
57
58
59
|
# File 'lib/models/ar_adapter.rb', line 57
def saved
@instance.valid?
end
|
#update(attributes) ⇒ Object
52
53
54
55
|
# File 'lib/models/ar_adapter.rb', line 52
def update(attributes)
@instance.update_attributes attributes
end
|
#valid ⇒ Object
42
43
44
|
# File 'lib/models/ar_adapter.rb', line 42
def valid
@instance.valid?
end
|