validation_reflection-active_model 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,14 @@ module ValidationReflection
|
|
26
26
|
def kind
|
27
27
|
self.macro.to_s.match(/\w+_(\w+)_\w+/)[1].to_sym
|
28
28
|
end
|
29
|
+
|
30
|
+
def kind=(kind)
|
31
|
+
self.instance_variable_set('@macro', "validates_#{kind}_of".to_sym)
|
32
|
+
end
|
33
|
+
|
34
|
+
def attributes
|
35
|
+
[self.name]
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
31
39
|
|