tramway-export 0.2.0.2 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 797b8646f1afd946efe3b2926e75d95f056b6dd190d8424357e5b78c06bf70b9
4
- data.tar.gz: 1ff12e2b514aa49dec363ebb473276df849f3504dbfd693ec29c8333424ca15f
3
+ metadata.gz: bd13981fdb5e8efaf10ca1d0f2ae38affb27920f456c19e293bf831ef151469e
4
+ data.tar.gz: f7553ceb6c55fdcaa5f5970345dbd677873ec2ca2eb4e2e21a434e23f03f5c1c
5
5
  SHA512:
6
- metadata.gz: 7faa2448f27af2740baafc8ec75c32c5b545098c4955f237696213a41ce8a4e03a298e4994169fd29773e01184768f614d3b31828087eb1c58baac388e449c9d
7
- data.tar.gz: bc1e60703f934e9803d1c9e345bf6ef9576e0401c7407918894cd1865190ab29ef0a20f93667c45cc16d00cf4a98377cd3ea1c5efde3b5b08d37e44fe8de1cd6
6
+ metadata.gz: 526d31a70858f63528eb448b5f502322952c184740e8952c97b0f5850831a076278b14488b0602080a211c3ba405030f3481af476ac8503d34ccd581e9322688
7
+ data.tar.gz: ef4ccfd2ae44b7440d3ae876509c2bcf30aa264e60192db92ace2b64adcce46b4409070ef130f7bde9b2814625cd330a6b052586906c64eec3c36965f3278236
@@ -7,7 +7,7 @@ class Tramway::Export::ExportsController < Tramway::Admin::ApplicationController
7
7
  scope = params[:scope].present? ? params[:scope] : :all
8
8
  model_class = model_class_name(params[:model])
9
9
  xls_decorator_class = xls_decorator_class_name(params[:model])
10
- records = model_class.active.order(id: :desc).send scope
10
+ records = model_class.order(id: :desc).send scope
11
11
  records = records.ransack(params[:filter]).result if params[:filter].present?
12
12
  records = records.send "#{current_admin.role}_scope", current_admin.id
13
13
  records = xls_decorator_class.decorate records
@@ -33,7 +33,7 @@ class Tramway::Export::ExportsController < Tramway::Admin::ApplicationController
33
33
 
34
34
  model_class = model_class_name(params[:model])
35
35
  xls_collection_decorator_class = xls_collection_decorator_class_name(params[:model], params[:collection])
36
- records = model_class.find(params[:id]).send(params[:collection]).active.order(id: :desc)
36
+ records = model_class.find(params[:id]).send(params[:collection]).order(id: :desc)
37
37
  records = records.send "#{current_admin.role}_scope", current_admin.id
38
38
  records = xls_collection_decorator_class.decorate records
39
39
 
@@ -2,8 +2,6 @@
2
2
  - model_name = model_class.name.underscore
3
3
  - id = "export-#{model_name.gsub('/', '_')}"
4
4
  .btn-group{ role: :group }
5
- %button{ id: id, type: :button, class: 'btn btn-primary dropdown-toggle', data: { toggle: :dropdown, aria: { haspopup: :true, expanded: :false } } }
6
- = fa_icon(:download)
7
- .dropdown-menu{ aria: { labelledby: id } }
8
- - decorator_class.collections.each do |collection|
9
- = link_to collection_human_name(model_name: model_name, collection_name: collection), Tramway::Export::Engine.routes.url_helpers.exports_path(model: model_class, scope: collection, filter: params[:filter].present? ? params[:filter].permit! : nil), class: 'dropdown-item'
5
+ - decorator_class.collections.each do |collection|
6
+ = link_to Tramway::Export::Engine.routes.url_helpers.exports_path(model: model_class, scope: collection, filter: params[:filter].present? ? params[:filter].permit! : nil), class: 'btn btn-primary' do
7
+ = collection_human_name(model_name: model_name, collection_name: collection)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Export
5
- VERSION = '0.2.0.2'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
@@ -18,7 +18,7 @@ module Tramway
18
18
  def exportable_model?(model_class, project:)
19
19
  return false unless project.present?
20
20
 
21
- @exportable_models[project.to_sym].map(&:to_s)&.include?(model_class.to_s) ||
21
+ @exportable_models[project.to_sym]&.map(&:to_s)&.include?(model_class.to_s) ||
22
22
  @exportable_models[project.to_sym]&.map { |config| config.is_a?(Hash) && config.keys.first.to_s == model_class.to_s }&.include?(true)
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xls_exporter
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.1.4
72
+ rubygems_version: 3.1.6
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Rails engine for exporting data