with_filled_field_scope 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -0
- data/lib/with_filled_field_scope.rb +1 -1
- data/spec/with_filled_field_scope_spec.rb +5 -0
- data/with_filled_field_scope.gemspec +58 -0
- metadata +4 -2
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.2
|
@@ -6,7 +6,7 @@ module ActiveRecord
|
|
6
6
|
module WithFilledFieldScope
|
7
7
|
module Base
|
8
8
|
|
9
|
-
FIELD_TYPES_SUPPORTING_ONLY_NOT_NULL = [:date, :decimal]
|
9
|
+
FIELD_TYPES_SUPPORTING_ONLY_NOT_NULL = [:date, :decimal, :boolean]
|
10
10
|
|
11
11
|
def has_with_filled_field_scope(model = self)
|
12
12
|
alias_scope :with_filled_field, lambda { |field|
|
@@ -38,6 +38,11 @@ describe 'WithFilledFieldScopeModel' do
|
|
38
38
|
WithFilledFieldScopeModel.field_support_not_blank?(:field).should be_false
|
39
39
|
end
|
40
40
|
|
41
|
+
it 'should be false for boolean' do
|
42
|
+
WithFilledFieldScopeModel.should_receive(:field_column_type).with(:field).and_return(:boolean)
|
43
|
+
WithFilledFieldScopeModel.field_support_not_blank?(:field).should be_false
|
44
|
+
end
|
45
|
+
|
41
46
|
it 'should be true for string' do
|
42
47
|
WithFilledFieldScopeModel.should_receive(:field_column_type).with(:field).and_return(:string)
|
43
48
|
WithFilledFieldScopeModel.field_support_not_blank?(:field).should be_true
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{with_filled_field_scope}
|
8
|
+
s.version = "1.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Marcin Nowicki"]
|
12
|
+
s.date = %q{2010-03-08}
|
13
|
+
s.description = %q{Adds with_filled_field scope to active record models. It scope searches for record with specified field filled.}
|
14
|
+
s.email = %q{pr0d1r2@doubledrones.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/with_filled_field_scope.rb",
|
27
|
+
"spec/spec.opts",
|
28
|
+
"spec/spec_helper.rb",
|
29
|
+
"spec/with_filled_field_scope_spec.rb",
|
30
|
+
"with_filled_field_scope.gemspec"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/Pr0d1r2/with_filled_field_scope}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.6}
|
36
|
+
s.summary = %q{Adds with_filled_field scope to active record models}
|
37
|
+
s.test_files = [
|
38
|
+
"spec/spec_helper.rb",
|
39
|
+
"spec/with_filled_field_scope_spec.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
48
|
+
s.add_development_dependency(%q<active_record_connectionless>, [">= 1.0.2"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
51
|
+
s.add_dependency(%q<active_record_connectionless>, [">= 1.0.2"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
55
|
+
s.add_dependency(%q<active_record_connectionless>, [">= 1.0.2"])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Marcin Nowicki
|
@@ -60,10 +60,12 @@ files:
|
|
60
60
|
- LICENSE
|
61
61
|
- README.rdoc
|
62
62
|
- Rakefile
|
63
|
+
- VERSION
|
63
64
|
- lib/with_filled_field_scope.rb
|
64
65
|
- spec/spec.opts
|
65
66
|
- spec/spec_helper.rb
|
66
67
|
- spec/with_filled_field_scope_spec.rb
|
68
|
+
- with_filled_field_scope.gemspec
|
67
69
|
has_rdoc: true
|
68
70
|
homepage: http://github.com/Pr0d1r2/with_filled_field_scope
|
69
71
|
licenses: []
|