active_collection 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "active_collection"
8
- gem.summary = %Q{Lazy-loaded array of records}
9
- gem.description = %Q{Lazy-loaded array of records}
8
+ gem.summary = %{A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.}
9
+ gem.description = %{A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.}
10
10
  gem.email = "martin.emde@gmail.com"
11
11
  gem.homepage = "http://github.com/martinemde/active_collection"
12
12
  gem.authors = ["Martin Emde"]
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 1
2
3
  :major: 0
3
4
  :minor: 2
4
- :patch: 0
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_collection}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Martin Emde"]
12
12
  s.date = %q{2009-09-14}
13
- s.description = %q{Lazy-loaded array of records}
13
+ s.description = %q{A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.}
14
14
  s.email = %q{martin.emde@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  s.require_paths = ["lib"]
41
41
  s.rubyforge_project = %q{collection}
42
42
  s.rubygems_version = %q{1.3.5}
43
- s.summary = %q{Lazy-loaded array of records}
43
+ s.summary = %q{A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.}
44
44
  s.test_files = [
45
45
  "spec/active_collection_spec.rb",
46
46
  "spec/pagination_spec.rb",
@@ -34,7 +34,7 @@ module ActiveCollection
34
34
  end
35
35
 
36
36
  def include_options
37
- @includes.blank?? {} : { :include => @includes }
37
+ { :include => @includes } unless @includes.blank?
38
38
  end
39
39
 
40
40
  protected
@@ -24,7 +24,7 @@ module ActiveCollection
24
24
  end
25
25
 
26
26
  def order_options
27
- order ? { :order => order } : {}
27
+ { :order => order } if order
28
28
  end
29
29
 
30
30
  module ClassMethods
@@ -182,7 +182,7 @@ module ActiveCollection
182
182
 
183
183
  # Find options for pagination.
184
184
  def pagination_options
185
- paginated?? { :offset => offset, :limit => per_page } : {}
185
+ { :offset => offset, :limit => per_page } if paginated?
186
186
  end
187
187
 
188
188
  end
@@ -79,7 +79,10 @@ module ActiveCollection
79
79
  end
80
80
 
81
81
  def to_options(object)
82
- inject({}) { |h, callback| h.merge( callback.call(object) ) }
82
+ inject({}) do |h, callback|
83
+ res = callback.call(object)
84
+ res ? h.merge(res) : h
85
+ end
83
86
  end
84
87
 
85
88
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Emde
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
- description: Lazy-loaded array of records
25
+ description: A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.
26
26
  email: martin.emde@gmail.com
27
27
  executables: []
28
28
 
@@ -76,7 +76,7 @@ rubyforge_project: collection
76
76
  rubygems_version: 1.3.5
77
77
  signing_key:
78
78
  specification_version: 3
79
- summary: Lazy-loaded array of records
79
+ summary: A lazy-loading, Array-like collection proxy for ActiveRecord that understands conditions and paging.
80
80
  test_files:
81
81
  - spec/active_collection_spec.rb
82
82
  - spec/pagination_spec.rb