Skip to content

Commit

Permalink
Removed requirement for validatable gem.
Browse files Browse the repository at this point in the history
Allows for using more uptodate versions of the library, or doesn't install it when you're using ActiveModel.
  • Loading branch information
roidrage authored and langalex committed May 4, 2010
1 parent 88ee244 commit a6ed397
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion Rakefile
Expand Up @@ -90,7 +90,6 @@ begin
s.authors = ["Alexander Lang"]
s.files = FileList["[A-Z]*.*", "{lib,spec,rails}/**/*", "init.rb"]
s.add_dependency 'json'
s.add_dependency 'validatable'
s.add_dependency 'couchrest', '>=0.24'
end
rescue LoadError
Expand Down
7 changes: 6 additions & 1 deletion lib/couch_potato/validation/with_validatable.rb
Expand Up @@ -2,7 +2,12 @@ module CouchPotato
module Validation
module WithValidatable
def self.included(base)
require 'validatable'
begin
require 'validatable'
rescue LoadError
puts "Please install the gem validatable using 'gem install validatable'"
raise
end
base.send :include, ::Validatable
base.class_eval do
# Override the validate method to first run before_validation callback
Expand Down

0 comments on commit a6ed397

Please sign in to comment.