gridify 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gridify}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["swalke16"]
@@ -73,12 +73,12 @@ module Gridify
73
73
  def jqgrid_type
74
74
  return sortable unless sortable==true
75
75
  case value_type
76
- when :string : 'text'
77
- when :text : 'text'
78
- when :integer : 'integer'
79
- when :float : 'float'
80
- when :boolean : 'boolean'
81
- when :datetime : 'date'
76
+ when :string then 'text'
77
+ when :text then 'text'
78
+ when :integer then 'integer'
79
+ when :float then 'float'
80
+ when :boolean then 'boolean'
81
+ when :datetime then 'date'
82
82
  end
83
83
  end
84
84
 
@@ -58,7 +58,7 @@ module Gridify
58
58
  total_pages = total_count / rows_per_page + 1
59
59
  #TODO: :only => [attributes], :methods => [virtual attributes]
60
60
  case data_type
61
- when :xml
61
+ when :xml then
62
62
  xml = records.to_xml( :skip_types => true, :dasherize => false ) do |xml|
63
63
  if rows_per_page > 0
64
64
  xml.page current_page
@@ -67,7 +67,7 @@ module Gridify
67
67
  end
68
68
  end
69
69
 
70
- when :json
70
+ when :json then
71
71
  #debugger
72
72
  data = { resource => records }
73
73
  if rows_per_page > 0
@@ -170,11 +170,10 @@ module Gridify
170
170
 
171
171
  # header layer
172
172
  def title
173
- if @title.is_a? String
174
- @title
175
- elsif @title == true
176
- resource.titleize
177
- else
173
+ case @title
174
+ when String then @title
175
+ when true then resource.titleize
176
+ else
178
177
  (' ' if collapsible || collapsed) #show header with blank title
179
178
  end
180
179
  end
@@ -185,10 +184,9 @@ module Gridify
185
184
 
186
185
  # pager layer
187
186
  def pager
188
- if @pager.is_a? String
189
- @pager
190
- elseif @pager == true
191
- dom_id+'_pager'
187
+ case @pager
188
+ when String then @pager
189
+ when true then dom_id+'_pager'
192
190
  end
193
191
  end
194
192
 
@@ -126,13 +126,13 @@ module Gridify
126
126
  vals['gridview'] = true # faster views, NOTE theres cases when this needs to be disabled
127
127
 
128
128
  case width_fit
129
- when :fitted
129
+ when :fitted then
130
130
  #vals[:autowidth] = false #default
131
131
  #vals[:shrinkToFit] = true #default
132
132
  vals['forceFit'] = true
133
133
  vals['width'] = width if width
134
134
 
135
- when :scroll
135
+ when :scroll then
136
136
  #vals[:autowidth] = false #default
137
137
  vals['shrinkToFit'] = false
138
138
  #vals['forceFit'] = #ignored by jqGrid
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - swalke16
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- hash: 3904651847311372664
112
+ hash: 4343728898991169038
113
113
  segments:
114
114
  - 0
115
115
  version: "0"