Started working on casted models, basic functionalities are now in.
property :casted_attribute, :cast_as => 'WithCastedModelMixin' A casted attribute now knows about its parent. (#casted_by to retrieve the parent's object)
This commit is contained in:
parent
fa7b176fce
commit
621f5565e9
10 changed files with 177 additions and 40 deletions
|
@ -126,10 +126,7 @@ module CouchRest
|
|||
self.respond_to?(name, true) ? self.send(name) : nil
|
||||
end
|
||||
|
||||
# Get the corresponding Resource property, if it exists.
|
||||
#
|
||||
# Note: CouchRest validations can be used on non-CouchRest resources.
|
||||
# In such cases, the return value will be nil.
|
||||
# Get the corresponding Object property, if it exists.
|
||||
def validation_property(field_name)
|
||||
properties.find{|p| p.name == field_name}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue