This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CouchRestExt | |
class Model < CouchRest::ExtendedDocument | |
include CouchRest::Validation | |
define_callbacks :validation | |
def valid?(context = :default) | |
_run_validation_callbacks do | |
self.class.validators.execute(context, self) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CouchRestExt::Model | |
class << self | |
def make attributes={} | |
new(@_blueprint_block.call.merge(attributes)).tap do |obj| | |
yield obj if block_given? | |
obj.save | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function grapp { | |
find ./app -name "*.rb" |xargs fgrep --color $1; | |
} |
NewerOlder