tramway-admin 1.31.0.1 → 1.31.0.2

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: 8e527df685599efb7b14fa1ff445ae7f61aea669a1edd406d7a5d127fe2026f6
4
- data.tar.gz: 41a7ee8ab8836d19122a094784fa3fa3c162e469a005b5f2b7a174f178bc3897
3
+ metadata.gz: 85b6f6446c7992da10f8047f5307cde053f95c0cddbecd3fb8452b54b1e1f275
4
+ data.tar.gz: f1c47470978a8da9341e5cde7327f6561bdfda5f2ea8629779457ca3994f33b3
5
5
  SHA512:
6
- metadata.gz: c6a8ba79872d5a473f77e1fe69e5d7c5d3d710890fd0293d3afbab411a347254c3dc25da2201cc6ad1ea48d9d50146356c2b1b7b5244c2483ff255b088473ea7
7
- data.tar.gz: 96cc001da48f111185dcd722ca4f61f16f4f08f1668512a6a8aa43d36b24bbeed6f13fc70a4a95bfce0644332ac5f5c30781f486447cee6d57b3c6497a5066c2
6
+ metadata.gz: 04655db55e12c76dc60edf28cf11c9e3cc73cc3256646e02363e4793522aed373300aea0c0af9391bf5a92f01391f5b72b9893426a4d7cac5eb33b9b3eb9758c
7
+ data.tar.gz: b529d3b27ce0c0a9288df0282ae0ca979ad6363446cef0cd6771b5e0279a3a42987126fc093dea569cb76ba84f48aea24bef5813ef1ef2ac19beefe099fac063
data/README.md CHANGED
@@ -140,6 +140,24 @@ class Admin::YourModelForm < Tramway::Core::ApplicationForm
140
140
  end
141
141
  end
142
142
  ```
143
+
144
+ ### 12. You can add search to your index page
145
+
146
+ Tramway use gem [PgSearch](https://github.com/Casecommons/pg_search`) as search engine
147
+
148
+ Just add `search` method to `YourModel` like this
149
+
150
+ ```ruby
151
+ search_by *attributes, **associations # `attributes` and `associations` should be the same syntax as in PgSearch
152
+ ```
153
+
154
+ Example:
155
+
156
+ ```ruby
157
+ class YourModel < Tramway::Core::ApplicationRecord
158
+ search_by :my_attribute, :another_attribute, my_association: [ :my_association_attribute, :another_my_association_attribute ]
159
+ ```
160
+
143
161
  #### 12. Run server `rails s`
144
162
  #### 13. Launch `localhost:3000/admin`
145
163
 
@@ -97,7 +97,7 @@ module Tramway
97
97
  # model: params[:model]
98
98
  # )
99
99
  # raise "Looks like model #{params[:model]} is not included to tramway-admin for `#{current_admin.role}` role. Add it in the `config/initializers/tramway.rb`. This way `Tramway::Admin.set_available_models(#{params[:model]})`"
100
- Tramway::Admin.forms.include? params[:form].underscore.sub(%r{^admin/}, '').sub(/_form$/, '')
100
+ Tramway::Admin.forms.include? params[:form].underscore.sub(%r{^admin/}, '').sub(/_form$/, '') if params[:form].present?
101
101
  end
102
102
 
103
103
  def available_scope_given?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Admin
5
- VERSION = '1.31.0.1'
5
+ VERSION = '1.31.0.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.31.0.1
4
+ version: 1.31.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views