rares-acts_as_filterable 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +15 -6
- data/Rakefile +4 -1
- data/VERSION.yml +1 -1
- data/acts_as_filterable.gemspec +13 -6
- metadata +33 -3
data/README.rdoc
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
= acts_as_filterable
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
database that had a bunch of bad apps depending on the fields
|
6
|
-
looking just the right way.
|
3
|
+
acts_as_filterable is a small ActiveRecord plugin that was thrown together
|
4
|
+
to avoid duplicating the same text filtering logic all over the place in a domain model.
|
7
5
|
|
8
|
-
|
9
|
-
|
6
|
+
The only filter in place so far is one that will strip everything out of a string except the digit information. You might ask, "Why don't you just change the column type to a numeric one?". That _is_ the right way to go but we were faced with tens of millions of records and a lot of text processing (with a lot of bad data that would be hard to apply a deterministic ruleset to). So putting this in place will avoid the garbage data coming in moving forward.
|
7
|
+
|
8
|
+
I'd like to expand the ruleset moving forward to support different schemes like decimals and so on.
|
9
|
+
|
10
|
+
to install as a gem:
|
11
|
+
|
12
|
+
@config.gem "rares-acts_as_filterable", :source => "http://gems.github.com"@
|
13
|
+
|
14
|
+
to apply to fields on a model, add the following inside the class body:
|
15
|
+
|
16
|
+
@filter_for_digits :phone_number, :fax_number@
|
17
|
+
|
18
|
+
if something is broken or it is missing a feature you know the deal; don't be part of the problem.
|
10
19
|
|
11
20
|
== Copyright
|
12
21
|
|
data/Rakefile
CHANGED
@@ -10,7 +10,10 @@ begin
|
|
10
10
|
gem.homepage = "http://github.com/rares/acts_as_filterable"
|
11
11
|
gem.authors = ["Rob Ares"]
|
12
12
|
|
13
|
-
gem.add_dependency("activerecord", ">= 1.15.0")
|
13
|
+
gem.add_dependency("activerecord", ">= 1.15.0")
|
14
|
+
gem.add_runtime_dependency("activesupport", ">= 1.4.4")
|
15
|
+
gem.add_development_dependency("Shoulda")
|
16
|
+
gem.add_development_dependency("matchy")
|
14
17
|
end
|
15
18
|
rescue LoadError
|
16
19
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
data/VERSION.yml
CHANGED
data/acts_as_filterable.gemspec
CHANGED
@@ -1,15 +1,12 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
2
|
|
6
3
|
Gem::Specification.new do |s|
|
7
4
|
s.name = %q{acts_as_filterable}
|
8
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.4"
|
9
6
|
|
10
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
8
|
s.authors = ["Rob Ares"]
|
12
|
-
s.date = %q{2009-09-
|
9
|
+
s.date = %q{2009-09-08}
|
13
10
|
s.email = %q{rob.ares@gmail.com}
|
14
11
|
s.extra_rdoc_files = [
|
15
12
|
"LICENSE",
|
@@ -30,10 +27,11 @@ Gem::Specification.new do |s|
|
|
30
27
|
"test/acts_as_filterable_integration_test.rb",
|
31
28
|
"test/test_helper.rb"
|
32
29
|
]
|
30
|
+
s.has_rdoc = true
|
33
31
|
s.homepage = %q{http://github.com/rares/acts_as_filterable}
|
34
32
|
s.rdoc_options = ["--charset=UTF-8"]
|
35
33
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = %q{1.3.
|
34
|
+
s.rubygems_version = %q{1.3.2}
|
37
35
|
s.summary = %q{TODO}
|
38
36
|
s.test_files = [
|
39
37
|
"test/acts_as_filterable_integration_test.rb",
|
@@ -46,10 +44,19 @@ Gem::Specification.new do |s|
|
|
46
44
|
|
47
45
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
48
46
|
s.add_runtime_dependency(%q<activerecord>, [">= 1.15.0"])
|
47
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 1.4.4"])
|
48
|
+
s.add_development_dependency(%q<Shoulda>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<matchy>, [">= 0"])
|
49
50
|
else
|
50
51
|
s.add_dependency(%q<activerecord>, [">= 1.15.0"])
|
52
|
+
s.add_dependency(%q<activesupport>, [">= 1.4.4"])
|
53
|
+
s.add_dependency(%q<Shoulda>, [">= 0"])
|
54
|
+
s.add_dependency(%q<matchy>, [">= 0"])
|
51
55
|
end
|
52
56
|
else
|
53
57
|
s.add_dependency(%q<activerecord>, [">= 1.15.0"])
|
58
|
+
s.add_dependency(%q<activesupport>, [">= 1.4.4"])
|
59
|
+
s.add_dependency(%q<Shoulda>, [">= 0"])
|
60
|
+
s.add_dependency(%q<matchy>, [">= 0"])
|
54
61
|
end
|
55
62
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rares-acts_as_filterable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Ares
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-08 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,36 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 1.15.0
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.4.4
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: Shoulda
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: matchy
|
47
|
+
type: :development
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
25
55
|
description:
|
26
56
|
email: rob.ares@gmail.com
|
27
57
|
executables: []
|
@@ -45,7 +75,7 @@ files:
|
|
45
75
|
- rails/init.rb
|
46
76
|
- test/acts_as_filterable_integration_test.rb
|
47
77
|
- test/test_helper.rb
|
48
|
-
has_rdoc:
|
78
|
+
has_rdoc: true
|
49
79
|
homepage: http://github.com/rares/acts_as_filterable
|
50
80
|
post_install_message:
|
51
81
|
rdoc_options:
|