rares-acts_as_filterable 0.1.1 → 0.1.2
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/VERSION.yml +1 -1
- data/acts_as_filterable.gemspec +12 -4
- data/test/acts_as_filterable_integration_test.rb +9 -1
- data/test/test_helper.rb +11 -5
- metadata +33 -3
data/VERSION.yml
CHANGED
data/acts_as_filterable.gemspec
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
7
|
s.name = %q{acts_as_filterable}
|
5
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
6
9
|
|
7
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
11
|
s.authors = ["Rob Ares"]
|
9
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-06}
|
10
13
|
s.email = %q{rob.ares@gmail.com}
|
11
14
|
s.extra_rdoc_files = [
|
12
15
|
"LICENSE",
|
@@ -31,7 +34,7 @@ Gem::Specification.new do |s|
|
|
31
34
|
s.homepage = %q{http://github.com/rares/acts_as_filterable}
|
32
35
|
s.rdoc_options = ["--charset=UTF-8"]
|
33
36
|
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.
|
37
|
+
s.rubygems_version = %q{1.3.1}
|
35
38
|
s.summary = %q{TODO}
|
36
39
|
s.test_files = [
|
37
40
|
"test/acts_as_filterable_integration_test.rb",
|
@@ -40,14 +43,19 @@ Gem::Specification.new do |s|
|
|
40
43
|
|
41
44
|
if s.respond_to? :specification_version then
|
42
45
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version =
|
46
|
+
s.specification_version = 2
|
44
47
|
|
45
48
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
49
|
s.add_runtime_dependency(%q<activerecord>, [">= 1.15.0"])
|
50
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 1.4.4"])
|
51
|
+
s.add_development_dependency(%q<Shoulda>)
|
52
|
+
s.add_development_dependency(%q<matchy>)
|
47
53
|
else
|
48
54
|
s.add_dependency(%q<activerecord>, [">= 1.15.0"])
|
55
|
+
s.add_dependency(%q<activesupport>, [">= 1.4.4"])
|
49
56
|
end
|
50
57
|
else
|
51
58
|
s.add_dependency(%q<activerecord>, [">= 1.15.0"])
|
59
|
+
s.add_dependency(%q<activesupport>, [">= 1.4.4"])
|
52
60
|
end
|
53
61
|
end
|
@@ -59,7 +59,7 @@ class ActsAsFilterableIntegrationTest < Test::Unit::TestCase
|
|
59
59
|
|
60
60
|
end
|
61
61
|
|
62
|
-
context "with a
|
62
|
+
context "with a nil attribute value" do
|
63
63
|
setup do
|
64
64
|
@model.phone_number = nil
|
65
65
|
end
|
@@ -101,6 +101,14 @@ class ActsAsFilterableIntegrationTest < Test::Unit::TestCase
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
context "that has filtered attribute names that are identical to another filtered model" do
|
105
|
+
|
106
|
+
should "hold seperate collections of filtered_attributes" do
|
107
|
+
User.filtered_attributes.should_not == ContactDetail.filtered_attributes
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
104
112
|
end
|
105
113
|
|
106
114
|
end
|
data/test/test_helper.rb
CHANGED
@@ -3,12 +3,9 @@ require "activerecord"
|
|
3
3
|
require "shoulda"
|
4
4
|
require "matchy"
|
5
5
|
|
6
|
-
gem "sqlite3-ruby"
|
7
|
-
|
8
6
|
require "acts_as_filterable"
|
9
7
|
|
10
|
-
ActiveRecord::Base.
|
11
|
-
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "/tmp/acts_as_filterable.sqlite")
|
8
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
12
9
|
ActiveRecord::Migration.verbose = false
|
13
10
|
|
14
11
|
ActiveRecord::Schema.define do
|
@@ -18,11 +15,20 @@ ActiveRecord::Schema.define do
|
|
18
15
|
t.string :fax_number
|
19
16
|
t.float :discount
|
20
17
|
end
|
18
|
+
|
19
|
+
create_table :user do |t|
|
20
|
+
t.string :handle
|
21
|
+
t.string :phone_number
|
22
|
+
end
|
21
23
|
end
|
22
24
|
|
23
25
|
class ContactDetail < ActiveRecord::Base
|
24
26
|
filter_for_digits :phone_number, :fax_number
|
25
27
|
end
|
26
28
|
|
29
|
+
class User < ActiveRecord::Base
|
30
|
+
filter_for_digits :phone_number
|
31
|
+
end
|
32
|
+
|
27
33
|
class Test::Unit::TestCase
|
28
|
-
end
|
34
|
+
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.2
|
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-06 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: []
|
@@ -69,7 +99,7 @@ requirements: []
|
|
69
99
|
rubyforge_project:
|
70
100
|
rubygems_version: 1.2.0
|
71
101
|
signing_key:
|
72
|
-
specification_version:
|
102
|
+
specification_version: 2
|
73
103
|
summary: TODO
|
74
104
|
test_files:
|
75
105
|
- test/acts_as_filterable_integration_test.rb
|