run_cl 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +12 -0
  2. data/lib/run_cl.rb +4 -4
  3. data/lib/run_cl/version.rb +1 -1
  4. metadata +2 -2
data/README.md CHANGED
@@ -26,6 +26,18 @@ At your model:
26
26
 
27
27
  Where 'rut' is the name of the column that stores the RUN.
28
28
 
29
+ By default has_run_cl performs two validations, *run format* and *run uniqueness*, if you want to skip these validations do:
30
+
31
+ has_run_cl :rut, run: false # skip format validation
32
+
33
+ or
34
+
35
+ has_run_cl :rut, uniq_run: false # skip uniqueness validation
36
+
37
+ or
38
+
39
+ has_run_cl :rut, run: false, uniq_run: false # skip both validations
40
+
29
41
  If you are using factorygirl put this in your factory:
30
42
 
31
43
  FactoryGirl.define do
data/lib/run_cl.rb CHANGED
@@ -9,11 +9,11 @@ module RunCl
9
9
  module ActAsRun
10
10
  extend ActiveSupport::Concern
11
11
 
12
- module InstanceMethods
13
- end
12
+ # module InstanceMethods
13
+ # end
14
14
 
15
15
  module ClassMethods
16
- include InstanceMethods
16
+ # include InstanceMethods
17
17
  def has_run_cl(name, options = {})
18
18
  if not options[:run].presence or options[:run]
19
19
  if options[:on].presence
@@ -31,7 +31,7 @@ module RunCl
31
31
  end
32
32
  end
33
33
 
34
- before_save "make_#{name}_format!"
34
+ before_validation "make_#{name}_format!"
35
35
 
36
36
  define_method "make_#{name}_format!" do
37
37
  self.send("#{name}=", Run.remove_format(self.send("#{name}")) )
@@ -1,3 +1,3 @@
1
1
  module RunCl
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2013-11-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Formateador/Desformateador, Generador, Validador de Rut Chilenos
15
15
  email: