Skip to content

Commit

Permalink
Fixes the bug #395
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Kulk committed Oct 23, 2024
1 parent ca66fb2 commit a974053
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.1.3

* Fixes [the bug](https://github.com/leikind/wice_grid/issues/395).

## 7.1.2

* This is the fix for the workaround of the [Facebook](https://www.facebook.com) problem.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GIT
PATH
remote: .
specs:
wice_grid (7.1.2)
wice_grid (7.1.3)
coffee-rails (>= 5.0.0)
jquery-rails
kaminari
Expand Down
3 changes: 1 addition & 2 deletions lib/wice/columns/column_integer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def self.get_value(val) #:nodoc:
separator = I18n.t!('number.format.separator') rescue nil
val = val.sub(separator, '.') if val.respond_to?(:sub) && separator

# Parse as float
Float(val) rescue nil
Integer(val) rescue nil
end

def get_op_and_value(val) #:nodoc:
Expand Down
9 changes: 6 additions & 3 deletions lib/wice_grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def with_resultset(&callback)
end

def fix_facebook_bug
Rails.logger.debug {%%WiceGrid@#{__LINE__}#fix_facebook_bug: #{params[name].inspect}%}
if params[name] and filter = params[name][:f]
params[name][:f] = filter.to_unsafe_h
.each_with_object({}) do |(key, value), hash|
Expand Down Expand Up @@ -267,8 +266,12 @@ def declare_column(
end

if column
conditions_generator = ActiveRecordColumnWrapper.new(column, @status[:f], main_table, table_alias, custom_filter_active, filter_type)
conditions, current_parameter_name = conditions_generator.wg_initialize_request_parameters
conditions_generator = ActiveRecordColumnWrapper.new(
column, @status[:f], main_table,
table_alias, custom_filter_active, filter_type
)
conditions, current_parameter_name =
conditions_generator.wg_initialize_request_parameters

if @status[:f] && conditions.blank?
@status[:f].delete(current_parameter_name)
Expand Down
4 changes: 2 additions & 2 deletions wice_grid.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'wice_grid'
s.version = '7.1.2'
s.authors = ['Yuri Leikind and contributors']
s.version = '7.1.3'
s.authors = ['Yuri Leikind, Dimitri Kulk, and contributors']
s.email = ['[email protected]']
s.homepage = 'https://github.com/leikind/wice_grid'
s.summary = 'A Rails grid plugin to quickly create grids with sorting, pagination, and filters.'
Expand Down

0 comments on commit a974053

Please sign in to comment.