recordselect_vho 3.1.104 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDMzMTM3NjExYzc5Y2E1YjZmNGJhYWRkNjZjZGQyYjQ4YmNmY2ZjMA==
5
- data.tar.gz: !binary |-
6
- MWU0ZWIwMzhhMWQ1NWI3ZmI5N2M5ZTkxNDFhNjg5NGFjM2Y1M2Q4ZQ==
2
+ SHA1:
3
+ metadata.gz: c95ec98968bc6a97a6b6e59bee3bbb66e15ae2c2
4
+ data.tar.gz: 6386c27b2d4720bea97f31ea58c587466cdf1cd7
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YTA2ZWViZTgxNzA4MTYzM2ExOGM3YWYyNmU1MTVjNjFiZjdiZGNkMWZiYmNm
10
- OWQxYmNlNWEwZGFjNjJmMThlOWJkNzI0N2JlYzNiMzY0MDljNzMyY2I3MzRk
11
- M2QyZTI0ODgyZGZmODE1YWNkNmMzMzFjYmJmNDE3YTg4YTU1OWI=
12
- data.tar.gz: !binary |-
13
- MTM1ODNmNjE5MWNhOWU5ZWY0YjhmOTliZjU0MDRlMWFkNjAzY2QzY2U1NWVk
14
- MTY0M2I1MjU4NjYzNWJjNTIwOTg5MjVjYzQ4ODc1ZDViMzIwMmZmYTJhZWYz
15
- OTBhOTg4MjJjNWZjMzBiNzdjODJlZDVlNGQ2MDljZjBjMjdhNDA=
6
+ metadata.gz: c818a3155e5e4e1e2f5bfd2b7831b3bef65628d29e0db55337298b0bcefef311e2f5bed64dff18d0fec8d3e65e3d27b6387f0667a16aa10af043cb9ca9dd991c
7
+ data.tar.gz: 3409be184f36213d4e218062a5a19356eddb40825830a864b592c9c1dc4af0ca7ee397578303aac418e60c57381e9999dcb7cbed42ab333f2bfe7ad248a2b59f
@@ -5,15 +5,15 @@ module RecordSelect
5
5
  def browse
6
6
  conditions = record_select_conditions
7
7
  klass = record_select_model
8
- @count = klass.count(:conditions => conditions, :include => record_select_includes)
8
+ @count = append_to_query(klass, {:where => conditions, :includes => record_select_includes}).count
9
9
  @count = @count.length if @count.is_a? ActiveSupport::OrderedHash
10
10
  pager = ::Paginator.new(@count, record_select_config.per_page) do |offset, per_page|
11
- klass.find(:all, :offset => offset,
11
+ append_to_query(klass, {:offset => offset,
12
12
  :select => record_select_select||"*",
13
- :include => [record_select_includes, record_select_config.include].flatten.compact,
13
+ :includes => [record_select_includes, record_select_config.include].flatten.compact,
14
14
  :limit => per_page,
15
- :conditions => conditions,
16
- :order => record_select_config.order_by)
15
+ :where => conditions,
16
+ :reorder => record_select_config.order_by}).to_a
17
17
  end
18
18
  @page = pager.page(params[:page] || 1)
19
19
 
@@ -60,6 +60,13 @@ module RecordSelect
60
60
  if block_given? then yield options else render options end
61
61
  end
62
62
 
63
+ def append_to_query(query, options)
64
+ options.assert_valid_keys :where, :select, :group, :reorder, :limit, :offset, :joins, :includes, :lock, :readonly, :from
65
+ options.reject{|k, v| v.blank?}.inject(query) do |query, (k, v)|
66
+ query.send((k.to_sym), v)
67
+ end
68
+ end
69
+
63
70
  private
64
71
 
65
72
  def record_select_views_path
@@ -1,8 +1,8 @@
1
1
  module RecordSelect
2
2
  module Version
3
- MAJOR = 3
4
- MINOR = 1
5
- PATCH = 104
3
+ MAJOR = 4
4
+ MINOR = 0
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordselect_vho
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.104
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
@@ -10,50 +10,56 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-09-27 00:00:00.000000000 Z
13
+ date: 2016-09-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: shoulda
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ! '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ! '>='
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: bundler
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ! '>'
33
+ - - ">"
34
34
  - !ruby/object:Gem::Version
35
35
  version: 1.0.0
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ! '>'
40
+ - - ">"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.0.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rails
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ! '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 3.1.0
49
+ version: 4.0.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: 5.0.0
50
53
  type: :runtime
51
54
  prerelease: false
52
55
  version_requirements: !ruby/object:Gem::Requirement
53
56
  requirements:
54
- - - ! '>='
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 4.0.0
60
+ - - "<"
55
61
  - !ruby/object:Gem::Version
56
- version: 3.1.0
62
+ version: 5.0.0
57
63
  description: RecordSelect is a Rails widget to help you pick one record out of many.
58
64
  I designed it as a more usable and performant alternative to generating a massive
59
65
  dropdown list
@@ -101,17 +107,17 @@ require_paths:
101
107
  - lib
102
108
  required_ruby_version: !ruby/object:Gem::Requirement
103
109
  requirements:
104
- - - ! '>='
110
+ - - ">="
105
111
  - !ruby/object:Gem::Version
106
112
  version: '0'
107
113
  required_rubygems_version: !ruby/object:Gem::Requirement
108
114
  requirements:
109
- - - ! '>='
115
+ - - ">="
110
116
  - !ruby/object:Gem::Version
111
117
  version: '0'
112
118
  requirements: []
113
119
  rubyforge_project:
114
- rubygems_version: 2.2.2
120
+ rubygems_version: 2.5.1
115
121
  signing_key:
116
122
  specification_version: 4
117
123
  summary: RecordSelect widget as a replacement for massive drop down lists