active_list 6.9.1 → 6.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21e6cec418301ab434edc97335af21d5cdd88ce9
4
- data.tar.gz: 2a48e4601c9d1af663944f1869aa9b3e139cdcba
3
+ metadata.gz: 19d2ab03026d988917f89129c6b30e231575aa61
4
+ data.tar.gz: f11050e05a4272429f469da1c05d165eb07cb05e
5
5
  SHA512:
6
- metadata.gz: af8ff5f81a206f5253eb0efe52a0d5cba83a7a5f7748d790bd7a4afc6b34637e3326b6c514d25372b4804fead2765e3b0c6ea5e0e4b418d2cd86b1eead2f5c67
7
- data.tar.gz: f792da2cbde29ad8b063770b3246efbe3bba82d763344ffa26b5ba3e6374615194cee78d12764b681328d008c93dba37c814ffaa0acbc01696b30977ab9298ca
6
+ metadata.gz: df9a228e2170d291e42465b246edf06de056482877682805580ddb2edbca4c72679126a45f5d0b968771ed665eb7bad325f8744f27696a52dcc7616c11f6db87
7
+ data.tar.gz: 5a62e044889dc68c1ba168e38c600630c1c18878c6b041736fde9d4698fa18b1b442375a32ec6865857d35f75161a91f969cde40dbc5980834cad3e36e8ab610
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  module ActiveList
3
4
  module Definition
4
5
  class ActionColumn < AbstractColumn
@@ -6,7 +7,7 @@ module ActiveList
6
7
 
7
8
  ID_PLACEHOLDER = '##IDS##'.freeze
8
9
 
9
- USE_MODES = [:none, :single, :many, :both].freeze
10
+ USE_MODES = %i[none single many both].freeze
10
11
 
11
12
  attr_reader :use_mode
12
13
 
@@ -6,11 +6,11 @@ module ActiveList
6
6
  def initialize(table, name, options = {})
7
7
  super(table, name, options)
8
8
  @label_method = (options[:label_method] || @name).to_sym
9
- if options[:value_method].present?
10
- @value_method = options[:value_method].to_sym
11
- else
12
- @value_method = @label_method.to_s.gsub('human_', '').to_sym
13
- end
9
+ @value_method = if options[:value_method].present?
10
+ options[:value_method].to_sym
11
+ else
12
+ @label_method.to_s.gsub('human_', '').to_sym
13
+ end
14
14
  unless @sort_column = options[:sort]
15
15
  @sort_column = if @table.model.columns_hash[@label_method.to_s]
16
16
  @label_method
@@ -1,7 +1,7 @@
1
1
  module ActiveList
2
2
  module Definition
3
3
  class DataColumn < AbstractColumn
4
- LABELS_COLUMNS = [:full_name, :label, :name, :number, :coordinate].freeze
4
+ LABELS_COLUMNS = %i[full_name label name number coordinate].freeze
5
5
 
6
6
  def header_code
7
7
  if @options[:label]
@@ -57,7 +57,7 @@ module ActiveList
57
57
  end
58
58
 
59
59
  def numeric?
60
- [:decimal, :integer, :float, :numeric].include? datatype
60
+ %i[decimal integer float numeric].include? datatype
61
61
  end
62
62
 
63
63
  # Returns the size/length of the column if the column is in the database
@@ -139,9 +139,9 @@ module ActiveList
139
139
  if reflections.size == 1
140
140
  reflection = reflections.first
141
141
  columns = reflection.class_name.constantize.columns.collect { |c| c.name.to_s }
142
- self.column([:label, :name, :code, :number].detect { |l| columns.include?(l.to_s) }, through: reflection.name, url: true)
142
+ column(%i[label name code number].detect { |l| columns.include?(l.to_s) }, through: reflection.name, url: true)
143
143
  else
144
- self.column(column.name.to_sym)
144
+ column(column.name.to_sym)
145
145
  end
146
146
  end
147
147
  true
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  require 'zip'
3
4
 
4
5
  # Register ODS format unless is already set
@@ -36,7 +36,6 @@ module ActiveList
36
36
 
37
37
  def build_table_code
38
38
  record = 'r'
39
- child = 'c'
40
39
 
41
40
  # colgroup = columns_definition_code
42
41
  header = header_code
@@ -138,7 +137,7 @@ module ActiveList
138
137
 
139
138
  def columns_to_cells(nature, options = {})
140
139
  code = ''
141
- unless [:body, :children].include?(nature)
140
+ unless %i[body children].include?(nature)
142
141
  raise ArgumentError, 'Nature is invalid'
143
142
  end
144
143
  record = options[:record] || 'record_of_the_death'
@@ -156,7 +155,7 @@ module ActiveList
156
155
  elsif column.is_a? ActiveList::Definition::StatusColumn
157
156
 
158
157
  value_code = column.datum_code(record, children_mode)
159
- levels = %w(go caution stop)
158
+ levels = %w[go caution stop]
160
159
  lights = levels.collect do |light|
161
160
  "content_tag(:span, '', :class => #{light.inspect})"
162
161
  end.join(' + ')
@@ -170,7 +169,7 @@ module ActiveList
170
169
  value_code = column.datum_code(record, children_mode)
171
170
  if column.datatype == :boolean
172
171
  value_code = "content_tag(:div, '', :class => 'checkbox-'+(" + value_code.to_s + " ? 'true' : 'false'))"
173
- elsif [:date, :datetime, :timestamp, :measure].include? column.datatype
172
+ elsif %i[date datetime timestamp measure].include? column.datatype
174
173
  value_code = "(#{value_code}.nil? ? '' : #{value_code}.l)"
175
174
  elsif [:item].include? column.datatype
176
175
  value_code = "(#{value_code}.nil? ? '' : #{value_code}.human_name)"
@@ -309,7 +308,7 @@ module ActiveList
309
308
  precision = "''"
310
309
  if column.options[:currency]
311
310
  unit = "Nomen::Currency.find(#{column.currency_for(generator.records_variable_name + '.first').inspect} || 'EUR').symbol.to_s"
312
- precision = "Nomen::Currency.find(#{column.currency_for(generator.records_variable_name + '.first').inspect} || 'EUR').precision.to_s"
311
+ precision = "Nomen::Currency.find(#{column.currency_for(generator.records_variable_name + '.first').inspect} || 'EUR').precision.to_s"
313
312
  elsif column.computable?
314
313
  unit = "#{generator.records_variable_name}.first.#{column.value_method}.symbol"
315
314
  precision = "'2'"
@@ -362,9 +361,6 @@ module ActiveList
362
361
  pagination << '<span class="paginator">'
363
362
  pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{current_page} - 1).to_s + '\" class=\"btn previous-page\"' + (#{current_page} != 1 ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.previous') + '</a>"
364
363
 
365
- x = '@@PAGE-NUMBER@@'
366
- y = '@@PAGE-COUNT@@'
367
-
368
364
  pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{current_page} + 1).to_s + '\" class=\"btn next-page\"' + (#{current_page} != #{last_page} ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.next')+'</a>"
369
365
  pagination << '</span>'
370
366
 
@@ -373,13 +369,7 @@ module ActiveList
373
369
  code << "'#{pagination}'"
374
370
  codes[:pagination] = "'#{pagination}'"
375
371
  end
376
- return codes
377
-
378
- unless code.empty?
379
- code = "content_tag(:div, (#{code.join(' + ')}).html_safe, class: 'list-control')"
380
- end
381
-
382
- code
372
+ codes
383
373
  end
384
374
 
385
375
  def uid
@@ -410,7 +400,7 @@ module ActiveList
410
400
  classes << :col
411
401
  classes << DATATYPE_ABBREVIATION[column.datatype]
412
402
  classes << :url if column.options[:url].is_a?(Hash)
413
- classes << column.label_method if [:code, :color].include? column.label_method.to_sym
403
+ classes << column.label_method if %i[code color].include? column.label_method.to_sym
414
404
  if column.options[:mode] == :download
415
405
  classes << :dld
416
406
  elsif column.options[:mode] || column.label_method == :email
@@ -1,3 +1,3 @@
1
1
  module ActiveList
2
- VERSION = '6.9.1'.freeze
2
+ VERSION = '6.9.2'.freeze
3
3
  end
data/test/dummy/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '4.2.7'
3
+ gem 'rails', '4.2.8'
4
4
 
5
5
  # Bundle edge Rails instead:
6
6
  # gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -4,7 +4,7 @@ require 'rails/all'
4
4
 
5
5
  if defined?(Bundler)
6
6
  # If you precompile assets before deploying to production, use this line
7
- Bundler.require(*Rails.groups(assets: %w(development test)))
7
+ Bundler.require(*Rails.groups(assets: %w[development test]))
8
8
  # If you want your assets lazily compiled in production, use this line
9
9
  # Bundler.require(:default, :assets, Rails.env)
10
10
  end
@@ -11,24 +11,26 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20_120_510_134_500) do
15
- create_table 'contacts', force: :cascade do |t|
16
- t.integer 'person_id'
17
- t.text 'address'
18
- t.string 'phone'
19
- t.string 'fax'
20
- t.string 'country'
21
- t.datetime 'created_at', null: false
22
- t.datetime 'updated_at', null: false
14
+ ActiveRecord::Schema.define(version: 20120510134500) do
15
+
16
+ create_table "contacts", force: :cascade do |t|
17
+ t.integer "person_id"
18
+ t.text "address"
19
+ t.string "phone"
20
+ t.string "fax"
21
+ t.string "country"
22
+ t.datetime "created_at", null: false
23
+ t.datetime "updated_at", null: false
23
24
  end
24
25
 
25
- create_table 'people', force: :cascade do |t|
26
- t.string 'name'
27
- t.date 'born_on'
28
- t.decimal 'height'
29
- t.decimal 'balance_amount'
30
- t.string 'currency'
31
- t.datetime 'created_at', null: false
32
- t.datetime 'updated_at', null: false
26
+ create_table "people", force: :cascade do |t|
27
+ t.string "name"
28
+ t.date "born_on"
29
+ t.decimal "height"
30
+ t.decimal "balance_amount"
31
+ t.string "currency"
32
+ t.datetime "created_at", null: false
33
+ t.datetime "updated_at", null: false
33
34
  end
35
+
34
36
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  Person.create! name: 'Leonardo di ser Piero da Vinci', born_on: '1452-04-15'
3
4
  Person.create! name: '宮崎 駿', born_on: '1941-01-05'
4
5
  Person.create! name: 'عَبْدَالله مُحَمَّد بِن مُوسَى اَلْخْوَارِزْمِي‎', born_on: Date.new(780, 8, 7)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.9.1
4
+ version: 6.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice Texier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  requirements: []
230
230
  rubyforge_project:
231
- rubygems_version: 2.6.8
231
+ rubygems_version: 2.5.2
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: Simple interactive tables for Rails app