mleung-koujou 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/koujou/custom_validation.rb +15 -0
  2. metadata +2 -1
@@ -0,0 +1,15 @@
1
+ # TODO: We need to override any before_validation, or before_validation_on create callbacks as well, I think.
2
+ module Koujou #:nodoc:
3
+ class CustomValidation # :nodoc:
4
+
5
+ # This just goes in and redefines any custom validation methods. Since we can't
6
+ # really ascertain what the intent of those are when koujou runs, it seems
7
+ # like stubbing them out is the most logical choice.
8
+ def self.stub_custom_validations!(instance)
9
+ instance.class.custom_validations.each do |v|
10
+ instance.class.module_eval { define_method(v.name.to_s) { true } }
11
+ end
12
+ end
13
+
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mleung-koujou
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Leung
@@ -67,6 +67,7 @@ files:
67
67
  - test/test_helper.rb
68
68
  - test/test_kojo.rb
69
69
  - test/test_sequence.rb
70
+ - lib/koujou/custom_validation.rb
70
71
  has_rdoc: true
71
72
  homepage: http://github.com/mleung/koujou
72
73
  licenses: