lib/roachclip.rb in roachclip-0.1.1 vs lib/roachclip.rb in roachclip-0.1.2
- old
+ new
@@ -1,9 +1,10 @@
require 'set'
require 'tempfile'
require 'paperclip'
require 'joint'
+require 'roachclip/validations'
module Paperclip
class << self
def log *args
end
@@ -31,9 +32,13 @@
options[:styles].each { |k,v| self.attachment "#{name}_#{k}"}
before_save :process_roaches
before_save :destroy_nil_roaches
+ end
+
+ def validates_roachclip(*args)
+ add_validations(args, Roachclip::Validations::ValidatesPresenceOf)
end
end
module InstanceMethods
def process_roaches