rest_framework 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4fe6c7cddb11163195ca847ef985d87274b20b33a16bba96ed1979dd9ef3f91
4
- data.tar.gz: e9db88d728e115a1e20d9584087fb21f48cff195476019efefa7f19c142eeb9e
3
+ metadata.gz: 057373b968952b2e2994e96e73617371a1ee8bb1f1169baa674df23de6009d77
4
+ data.tar.gz: d7773ccff492ddfcd89696502d82a041aafef09d4fbaca3188b73e4faeb00d5c
5
5
  SHA512:
6
- metadata.gz: 3c6a447cedc65be69c0ab0ae9430ecd219e6780b1373ba3cecfecc57d7335cf9af388a996e8d57f9b16cce60fc941f02d940b88f29e78841fb9eb78f4746b1d2
7
- data.tar.gz: 2c187d7b063b084970b3d8e8d13699e0c6e321cf4d4c38d23357923b9a0c10ea5fa9bd54763959913d772745d6aa5abfbaa7f8ad6fd79162c1724a5d696cfa19
6
+ metadata.gz: 2e8d2da4e111a9424a439dda5b3a997947981cf5895d56790d325d3c9b8afe70b53fd57a9f550fb5978081df3fec4ab7f047afacd5de52d93fe199a2b7ff3494
7
+ data.tar.gz: 19b9c83fd9846aa1f445eadc36943875b4fa96ec7648ec7ffbaa07d08ff7c5a9b370ca8c4ab3ccaab17ad83a611a1105ee3fefacc635c7fc3eba398d94fe4651
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.6
1
+ 0.8.7
@@ -207,6 +207,12 @@ module RESTFramework::BaseModelControllerMixin
207
207
  # Get enum variants.
208
208
  if type.is_a?(ActiveRecord::Enum::EnumType)
209
209
  metadata[:enum_variants] = type.send(:mapping)
210
+
211
+ # Custom integration with `translate_enum`.
212
+ translate_method = "translated_#{f.pluralize}"
213
+ if model.respond_to?(translate_method)
214
+ metadata[:enum_translations] = model.send(translate_method)
215
+ end
210
216
  end
211
217
  end
212
218
  end
@@ -115,8 +115,6 @@ end
115
115
 
116
116
  # Multi-field text searching on models.
117
117
  class RESTFramework::ModelSearchFilter < RESTFramework::BaseFilter
118
- DEFAULT_SEARCH_COLUMNS = %w[name email title description note]
119
-
120
118
  # Get a list of search fields for the current action. Fallback to columns but only grab a few
121
119
  # common string-like columns by default.
122
120
  def _get_fields
@@ -126,7 +124,7 @@ class RESTFramework::ModelSearchFilter < RESTFramework::BaseFilter
126
124
 
127
125
  columns = @controller.class.get_model.columns_hash.keys
128
126
  return @controller.get_fields(fallback: true).select { |f|
129
- f.in?(DEFAULT_SEARCH_COLUMNS) && f.in?(columns)
127
+ f.in?(RESTFramework.config.search_columns) && f.in?(columns)
130
128
  }
131
129
  end
132
130
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory N. Schmit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails