-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Use datagrid_form_with | ||
git grep 'datagrid_form_for' | ||
|
||
# Inline content of datagrid/order_for partial | ||
git grep 'datagrid_order_for' | ||
|
||
# Put necessary classes manually | ||
git grep 'datagrid_column_classes' | ||
|
||
# Inherit Datagrid::Base | ||
git grep 'include Datagrid' | ||
|
||
# Rename to ApplicationGrid (optional) | ||
git grep 'BaseDatagrid' | ||
git grep 'BaseGrid' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Important in development to have all classes in memory | ||
Rails.application.eager_load! | ||
|
||
raise "Use version 2" if Datagrid::VERSION < "2.0.0" | ||
|
||
included_classes = ObjectSpace.each_object(Class).select do |klass| | ||
klass.included_modules.include?(Datagrid) | ||
end | ||
classes = [*included_classes, *Datagrid::Base.subclasses].uniq | ||
|
||
classes.flat_map(&:filters).select do |f| | ||
f.respond_to?(:range?) && f.range? && f.block | ||
end.map do |f| | ||
[f.grid_class, f.name].join("#") | ||
end |