datagrid 2.0.1 → 2.0.5
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +2 -2
- data/lib/datagrid/columns/column.rb +11 -4
- data/lib/datagrid/drivers/active_record.rb +1 -1
- data/lib/datagrid/generators/scaffold.rb +1 -1
- data/lib/datagrid/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c86512c8f1419a81e769bc5341867e20071dcf1424ce55200a496e529a3b275c
|
|
4
|
+
data.tar.gz: b192c0bd6a90ce4085255de178ef732cbef691c7e529905138b47b6edd122fa1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da1baacc64d7e8502ce8738ff4de3c6346f2e1b486a49337c7194a64fcabbf9c38ba8839e1cd1f1be181419b185b79b41147cc0536581846625ca6386c21e1fd
|
|
7
|
+
data.tar.gz: af4ababb2213b465ef1fbac48a406166d336d917becbde4cb58ad0643aa78032f0f23fcf4461c730582cf5a162edfec5817f794bea54d9b3310d9801ba5aca63
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.5]
|
|
4
|
+
|
|
5
|
+
* Add support for timestamptz ActiveRecord column type
|
|
6
|
+
|
|
7
|
+
## [2.0.4]
|
|
8
|
+
|
|
9
|
+
* Support Rails 8.1 [#342](https://github.com/bogdan/datagrid/issues/342)
|
|
10
|
+
* Support Ruby 3.4 [#342](https://github.com/bogdan/datagrid/issues/342)
|
|
11
|
+
|
|
12
|
+
## [2.0.3]
|
|
13
|
+
|
|
14
|
+
* Fix `default_column_options` bug [#338](https://github.com/bogdan/datagrid/issues/338) by @pokonski.
|
|
15
|
+
* Fix generator [#336](https://github.com/bogdan/datagrid/issues/336)
|
|
16
|
+
|
|
3
17
|
## [2.0.1]
|
|
4
18
|
|
|
5
19
|
* Fixed `search` field type support [#330](https://github.com/bogdan/datagrid/issues/330)
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ including admin panels, analytics and data browsers:
|
|
|
33
33
|
|
|
34
34
|
* [Rdoc](https://rubydoc.info/gems/datagrid) - full API reference
|
|
35
35
|
* [Scope](https://rubydoc.info/gems/datagrid/Datagrid/Core) - working with datagrid scope
|
|
36
|
-
* [Columns](https://rubydoc.info/gems/datagrid/Datagrid/Columns) -
|
|
36
|
+
* [Columns](https://rubydoc.info/gems/datagrid/Datagrid/Columns) - defining datagrid columns
|
|
37
37
|
* [Filters](https://rubydoc.info/gems/datagrid/Datagrid/Filters) - defining datagrid filters
|
|
38
38
|
* [Frontend](https://rubydoc.info/gems/datagrid/Datagrid/Helper) - building a frontend
|
|
39
39
|
* [Configuration](https://rubydoc.info/gems/datagrid/Datagrid/Configuration) - configuring the gem
|
|
@@ -189,7 +189,7 @@ insert app/assets/stylesheet/application.css
|
|
|
189
189
|
In order to get a control on datagrid built-in views run:
|
|
190
190
|
|
|
191
191
|
``` sh
|
|
192
|
-
rails g datagrid
|
|
192
|
+
rails g datagrid:views
|
|
193
193
|
```
|
|
194
194
|
|
|
195
195
|
#### Advanced frontend
|
|
@@ -43,16 +43,16 @@ module Datagrid
|
|
|
43
43
|
# @return [Class] grid class where column is defined
|
|
44
44
|
# @attribute [r] name
|
|
45
45
|
# @return [Symbol] column name
|
|
46
|
-
# @attribute [r]
|
|
46
|
+
# @attribute [r] column_options
|
|
47
47
|
# @return [Hash<Symbol, Object>] column options
|
|
48
48
|
attr_reader :grid_class, :name, :query, :options, :data_block, :html_block
|
|
49
49
|
|
|
50
50
|
# @!visibility private
|
|
51
|
-
def initialize(grid_class, name, query,
|
|
51
|
+
def initialize(grid_class, name, query, column_options = {}, &block)
|
|
52
52
|
@grid_class = grid_class
|
|
53
53
|
@name = name.to_sym
|
|
54
54
|
@query = query
|
|
55
|
-
@options = Datagrid::Utils.callable(grid_class.default_column_options, self).merge(
|
|
55
|
+
@options = Datagrid::Utils.callable(grid_class.default_column_options, self).merge(column_options)
|
|
56
56
|
|
|
57
57
|
if options[:class]
|
|
58
58
|
Datagrid::Utils.warn_once(
|
|
@@ -168,7 +168,14 @@ module Datagrid
|
|
|
168
168
|
|
|
169
169
|
# @return [String] column console inspection
|
|
170
170
|
def inspect
|
|
171
|
-
|
|
171
|
+
options_inspection = if RUBY_VERSION >= "3.4"
|
|
172
|
+
# Ruby 3.4+ changed Hash#inspect format for symbol keys from {:key=>"value"} to {key: "value"}
|
|
173
|
+
options.inspect
|
|
174
|
+
else
|
|
175
|
+
"{#{options.map { |key, value| "#{key}: #{value.inspect}" }.join(", ")}}"
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
"#<#{self.class} #{grid_class}##{name} #{options_inspection}>"
|
|
172
179
|
end
|
|
173
180
|
|
|
174
181
|
# @return [String] column header
|
|
@@ -97,7 +97,7 @@ module Datagrid
|
|
|
97
97
|
%i[integer primary_key] => :integer,
|
|
98
98
|
%i[float decimal] => :float,
|
|
99
99
|
[:date] => :date,
|
|
100
|
-
%i[datetime timestamp] => :timestamp,
|
|
100
|
+
%i[datetime timestamp timestamptz] => :timestamp,
|
|
101
101
|
[:boolean] => :boolean,
|
|
102
102
|
}.each do |keys, value|
|
|
103
103
|
return value if keys.include?(builtin_type)
|
|
@@ -10,7 +10,7 @@ module Datagrid
|
|
|
10
10
|
include Rails::Generators::ResourceHelpers
|
|
11
11
|
|
|
12
12
|
check_class_collision suffix: "Grid"
|
|
13
|
-
source_root File.expand_path("#{
|
|
13
|
+
source_root File.expand_path("#{__dir__}/../../../templates")
|
|
14
14
|
|
|
15
15
|
def create_scaffold
|
|
16
16
|
template "base.rb.erb", base_grid_file unless file_exists?(base_grid_file)
|
data/lib/datagrid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: datagrid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bogdan Gusiev
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: railties
|
|
@@ -98,7 +97,6 @@ metadata:
|
|
|
98
97
|
changelog_uri: https://github.com/bogdan/datagrid/blob/main/CHANGELOG.md
|
|
99
98
|
source_code_uri: https://github.com/bogdan/datagrid
|
|
100
99
|
rubygems_mfa_required: 'true'
|
|
101
|
-
post_install_message:
|
|
102
100
|
rdoc_options: []
|
|
103
101
|
require_paths:
|
|
104
102
|
- lib
|
|
@@ -113,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
113
111
|
- !ruby/object:Gem::Version
|
|
114
112
|
version: '0'
|
|
115
113
|
requirements: []
|
|
116
|
-
rubygems_version: 3.
|
|
117
|
-
signing_key:
|
|
114
|
+
rubygems_version: 3.6.7
|
|
118
115
|
specification_version: 4
|
|
119
116
|
summary: Library that provides DSL to present table like data
|
|
120
117
|
test_files: []
|