udongo 7.6.2 → 7.7.0

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
  SHA1:
3
- metadata.gz: 23279efcf90b6a98a48e381fa46181ffe4668212
4
- data.tar.gz: 4937d6bff4b337ce55ff73c697012bc6242e5f7a
3
+ metadata.gz: 0571b6b0f3068ccb6289134f7d6d814acae5c949
4
+ data.tar.gz: a64e46b5f70916311602674d0df6c517b21fb36b
5
5
  SHA512:
6
- metadata.gz: 6793fcb733f26c88dc267905d0947ef3a9dfd8eb284e02a82ce5e93e56313f694cea68018ffcb88b8bcdf21c14dcb14f44930bd0052ca819ecc0efa2cc524ba5
7
- data.tar.gz: 2267a94eba5bbba648fa681ee798e98a8e632b5bc56a700ae981091866d2de9d4cdaf708440658336e83e8e64dba23c35e4ce113b6c1b2b84017c1aa4ac3e161
6
+ metadata.gz: 80c98ec1d4f10e931e4ab11fa6dd8f4c4398e92f05c4d707c8721192d02886ea4ac8abd7bc7e7bf2b6f5bc744e380d30439ccdaf87e1d3b69c6d700d59b9f966
7
+ data.tar.gz: aff3c4a867c6e42bc9a461ebb711cbce135c4bf053b6c427901247c85d0e5e94d7e3cef8de9e0b36e6485e9f9c4ea76c8fa25dc01d57f2d51a289e5f5a690c09
@@ -12,7 +12,7 @@ class Backend::AssetsController < Backend::BaseController
12
12
  def show
13
13
  send_data(
14
14
  File.open(@model.filename.path).read,
15
- filename: @model.read_attribute(:filename),
15
+ filename: @model.actual_filename,
16
16
  type: @model.content_type
17
17
  )
18
18
  end
@@ -3,10 +3,12 @@ class Article < ApplicationRecord
3
3
  include Concerns::Visible
4
4
  include Concerns::Seo
5
5
  include Concerns::FlexibleContent
6
- include Concerns::Searchable
7
6
  include Concerns::Publishable
8
7
  include Concerns::Imageable
9
8
 
9
+ include Concerns::Searchable
10
+ searchable_fields :title, :summary, :flexible_content
11
+
10
12
  include Concerns::Translatable
11
13
  translatable_fields :title, :summary
12
14
 
data/app/models/asset.rb CHANGED
@@ -25,6 +25,10 @@ class Asset < ApplicationRecord
25
25
  read_attribute(:filename)
26
26
  end
27
27
 
28
+ def extension
29
+ actual_filename.to_s.split('.').last.downcase
30
+ end
31
+
28
32
  def deletable?
29
33
  images.empty? && content_pictures.empty? && attachments.empty?
30
34
  end
@@ -51,9 +51,11 @@ module Concerns
51
51
  value = send(key)
52
52
  return if value.blank?
53
53
 
54
- index = search_indices.find_or_create_by!(locale: Udongo.config.i18n.app.default_locale, name: key)
55
- index.value = value
56
- index.save!
54
+ Udongo.config.i18n.app.locales.each do |locale|
55
+ index = search_indices.find_or_create_by!(locale: locale, name: key)
56
+ index.value = value
57
+ index.save!
58
+ end
57
59
  end
58
60
 
59
61
  def save_translatable_search_index!(key)
@@ -83,18 +85,7 @@ module Concerns
83
85
  end
84
86
 
85
87
  def searchable_fields_list
86
- @searchable_fields_list ||= default_searchable_fields
87
- end
88
-
89
- def default_searchable_fields
90
- result = []
91
-
92
- if respond_to?(:translatable_fields_list)
93
- translatable_fields_list.each { |f| result << f }
94
- end
95
-
96
- result << :flexible_content if new.respond_to?(:flexible_content?)
97
- result
88
+ @searchable_fields_list ||= []
98
89
  end
99
90
  end
100
91
  end
data/app/models/page.rb CHANGED
@@ -6,9 +6,11 @@ class Page < ApplicationRecord
6
6
  include Concerns::Deletable
7
7
  include Concerns::Draggable
8
8
  include Concerns::FlexibleContent
9
- include Concerns::Searchable
10
9
  include Concerns::Imageable
11
10
 
11
+ include Concerns::Searchable
12
+ searchable_fields :title, :subtitle, :flexible_content
13
+
12
14
  include Concerns::Sortable
13
15
  sortable scope: [:parent_id]
14
16
 
@@ -26,7 +26,7 @@
26
26
  <td>
27
27
  <%= image_tag a.image.url(150, 150), alt: '', class: 'img-fluid' %>
28
28
  </td>
29
- <td><%= a.actual_filename.split('.').last.upcase %></td>
29
+ <td><%= a.extension.upcase %></td>
30
30
  <td><%= number_to_human_size a.filesize %></td>
31
31
  <td><%= simple_format a.description %></td>
32
32
  <td><%= l a.updated_at %></td>
@@ -29,7 +29,7 @@
29
29
  <%= link_to icon(:download, t('b.download')), backend_asset_path(a) %>
30
30
  <% end %>
31
31
  </td>
32
- <td><%= a.actual_filename.split('.').last.upcase %></td>
32
+ <td><%= a.extension.upcase %></td>
33
33
  <td><%= number_to_human_size a.filesize %></td>
34
34
  <td><%= simple_format a.description %></td>
35
35
  <td>
@@ -26,7 +26,7 @@
26
26
  <td>
27
27
  <%= image_tag a.image.url(150, 150), alt: '', class: 'img-fluid' %>
28
28
  </td>
29
- <td><%= a.actual_filename.split('.').last.upcase %></td>
29
+ <td><%= a.extension.upcase %></td>
30
30
  <td><%= number_to_human_size a.filesize %></td>
31
31
  <td><%= simple_format a.description %></td>
32
32
  <td><%= l a.updated_at %></td>
@@ -26,7 +26,7 @@
26
26
  <td>
27
27
  <%= image_tag a.image.url(150, 150), alt: '', class: 'img-fluid' %>
28
28
  </td>
29
- <td><%= a.actual_filename.split('.').last.upcase %></td>
29
+ <td><%= a.extension.upcase %></td>
30
30
  <td><%= number_to_human_size a.filesize %></td>
31
31
  <td><%= simple_format a.description %></td>
32
32
  <td><%= l a.updated_at %></td>
data/changelog.md CHANGED
@@ -1,3 +1,11 @@
1
+ 7.7.0 - 2018-08-24
2
+ --
3
+ * Upgrade Rails from 5.0.1 to 5.0.7.
4
+ * Don't assume every translatable field or even the flexible content
5
+ automatically needs to be searchable.
6
+ * Upgrade draper 3.0.0.pre to 3.0.1.
7
+
8
+
1
9
  7.6.2 - 2018-08-22
2
10
  --
3
11
  * Bugfix: models that include the ```Attachable``` concern should respond to
@@ -11,9 +11,9 @@ class CreateAttachments < ActiveRecord::Migration[5.0]
11
11
  t.timestamps
12
12
  end
13
13
 
14
- add_index :attachments, [:attachable_type, :attachable_id]
15
- add_index :attachments, :position
16
- add_index :attachments, :visible
17
- add_index :attachments, :locale
14
+ add_index :attachments, [:attachable_type, :attachable_id], name: 'attachable_idx'
15
+ add_index :attachments, :position, name: 'attachable_position_idx'
16
+ add_index :attachments, :visible, name: 'attachable_visible_idx'
17
+ add_index :attachments, :locale, name: 'attachable_locale_idx'
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Udongo
2
- VERSION = '7.6.2'
2
+ VERSION = '7.7.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: udongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.2
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davy Hellemans
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-22 00:00:00.000000000 Z
12
+ date: 2018-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 5.0.1
20
+ version: 5.0.7
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 5.0.1
27
+ version: 5.0.7
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: jquery-rails
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -251,14 +251,14 @@ dependencies:
251
251
  requirements:
252
252
  - - '='
253
253
  - !ruby/object:Gem::Version
254
- version: 3.0.0.pre1
254
+ version: 3.0.1
255
255
  type: :runtime
256
256
  prerelease: false
257
257
  version_requirements: !ruby/object:Gem::Requirement
258
258
  requirements:
259
259
  - - '='
260
260
  - !ruby/object:Gem::Version
261
- version: 3.0.0.pre1
261
+ version: 3.0.1
262
262
  - !ruby/object:Gem::Dependency
263
263
  name: ransack
264
264
  requirement: !ruby/object:Gem::Requirement