katalyst-tables 3.11.0 → 3.11.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: '058d981c1598d836b758da0286de162feed139ae80aa1b59465a4505bd3ef0e2'
4
- data.tar.gz: ed95bb712fdf61560678659121b5a368839830ae3577eca4ae9d4c98d04f5b6c
3
+ metadata.gz: 1e8456c713efa8b079198dff2fd156ba028258ff09eb056b6a9a95cc5eb1aeaf
4
+ data.tar.gz: 4f6045cabeecbb034134151167dae9e9ce1c0f8744e32576829665fde2ec9117
5
5
  SHA512:
6
- metadata.gz: a24284360f7f865e46001614c877a4564c87b2c6a197a94ece8430d55ac1aa14b49d5f86be1b7304f662c56418b0d288e8ddfc8933298277b7579c0eff1042f5
7
- data.tar.gz: e6cb76f7383fb3a146465701b2842ebe54f4e0352e6fd0fb0d88ea83c9c397de7789b66fdf8d1e589fafcef78a50f3063a359b9e588bf88422e8797fa38a8f3d
6
+ metadata.gz: b22f53a017c4e9120fab8d73fedc699d929c5ce855e659ce67cc20a592b27dd0400111ace41ddf0d0b5cc9646a5836263b82c564b3ed795fc2fff9b8137b7f61
7
+ data.tar.gz: 8bee047ee8e2ca64e849f8735a87f1f917ef4a83d757b9372d9be3e1f176a17de390ac0f57cab1140d967cc4dbc1c94496a9c5063bf68dc69cbbe5ddc6fd962e
@@ -3,18 +3,25 @@
3
3
  module Katalyst
4
4
  module Tables
5
5
  module Collection
6
+ class Config
7
+ attr_accessor :paginate, :sorting
8
+ end
9
+
6
10
  module Core # :nodoc:
7
11
  extend ActiveSupport::Concern
8
12
 
9
13
  include ActiveModel::Model
10
14
  include ActiveModel::Attributes
11
15
  include ActiveModel::Dirty
12
- include ActiveSupport::Configurable
13
16
 
14
17
  include HasParams
15
18
  include Reducers
16
19
 
17
20
  class_methods do
21
+ def config
22
+ @config ||= Config.new
23
+ end
24
+
18
25
  def permitted_params
19
26
  _default_attributes.to_h.each_with_object([]) do |(k, v), h|
20
27
  h << case v
@@ -20,11 +20,9 @@ module Katalyst
20
20
  attr_accessor :pagination
21
21
 
22
22
  attribute :page, :integer, default: 1, filter: false
23
-
24
- config_accessor :paginate
25
23
  end
26
24
 
27
- def initialize(paginate: config.paginate, **)
25
+ def initialize(paginate: self.class.config.paginate, **)
28
26
  super(**)
29
27
 
30
28
  @paginate = paginate.freeze
@@ -55,7 +55,7 @@ module Katalyst
55
55
  attr_reader :default_sort
56
56
  end
57
57
 
58
- def initialize(sorting: config.sorting, **)
58
+ def initialize(sorting: self.class.config.sorting, **)
59
59
  @default_sort = sorting.to_param if sorting.present?
60
60
 
61
61
  super(sort: @default_sort, **) # set default sort based on config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-tables
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive