recordselect 3.2.6 → 3.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -219,7 +219,7 @@ RecordSelect.Abstract = Class.extend({
219
219
  open: function() {
220
220
  if (this.is_open()) return;
221
221
  var _this = this;
222
- $.rails.fire(_this.obj, 'rs:before');
222
+ jQuery.rails.fire(_this.obj, 'rs:before');
223
223
  jQuery.ajax({
224
224
  url: this.url,
225
225
  //type: "POST",
data/lib/record_select.rb CHANGED
@@ -27,7 +27,14 @@ module RecordSelect
27
27
  self.send :include, RecordSelect::Conditions
28
28
  end
29
29
 
30
- attr_reader :record_select_config
30
+ def record_select_config
31
+ case
32
+ when defined?(@record_select_config)
33
+ @record_select_config
34
+ when superclass.respond_to?(:record_select_config)
35
+ superclass.record_select_config
36
+ end
37
+ end
31
38
 
32
39
  def uses_record_select?
33
40
  !record_select_config.nil?
@@ -16,7 +16,7 @@ module RecordSelect
16
16
  wants.html { render_record_select :partial => 'browse'}
17
17
  wants.js {
18
18
  if params[:update]
19
- render_record_select :template => 'browse.js', :layout => false
19
+ render_record_select :template => 'browse'
20
20
  else
21
21
  render_record_select :partial => 'browse'
22
22
  end
@@ -83,12 +83,14 @@ module RecordSelect
83
83
 
84
84
  # generates an SQL condition for the given column/value
85
85
  def record_select_condition_for_column(column, value)
86
+ model = record_select_config.model
87
+ column_name = model.quoted_table_name + '.' + model.connection.quote_column_name(column.name)
86
88
  if value.blank? and column.null
87
- "#{column.name} IS NULL"
89
+ "#{column_name} IS NULL"
88
90
  elsif column.text?
89
- ["LOWER(#{column.name}) LIKE ?", value]
91
+ ["LOWER(#{column_name}) LIKE ?", value]
90
92
  else
91
- ["#{column.name} = ?", column.type_cast(value)]
93
+ ["#{column_name} = ?", column.type_cast(value)]
92
94
  end
93
95
  end
94
96
 
@@ -184,7 +184,7 @@ module RecordSelectHelper
184
184
 
185
185
  when Proc
186
186
  # return an html-cleaned descriptive string
187
- h renderer.call(record)
187
+ renderer.call(record)
188
188
  end
189
189
  end
190
190
 
@@ -2,7 +2,7 @@ module RecordSelect
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- PATCH = 6
5
+ PATCH = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordselect
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 6
10
- version: 3.2.6
9
+ - 7
10
+ version: 3.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Cambra
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2013-02-04 00:00:00 Z
20
+ date: 2013-05-03 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  type: :development
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  requirements: []
133
133
 
134
134
  rubyforge_project:
135
- rubygems_version: 1.8.24
135
+ rubygems_version: 1.8.23
136
136
  signing_key:
137
137
  specification_version: 3
138
138
  summary: RecordSelect widget as a replacement for massive drop down lists