sibu 0.6.8 → 0.6.9

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: f71d0ed5ea931e10b3ac298b61719f4e90781c84
4
- data.tar.gz: 86c5c7c355cb751903633f5f8548bef66a6877d9
3
+ metadata.gz: 11718eee8d05389ba6c3e54992c419d06e87039f
4
+ data.tar.gz: 64985305666f99c3f52636d5447a37389044b0f5
5
5
  SHA512:
6
- metadata.gz: 103b62d79ad05287ce1b1d7096cffdc394fb65368209f4b8eb9cb785bc8f86cda3be9b642fa80695c83791b97a1963a1eae9ffb1005bd006362449a849c79275
7
- data.tar.gz: 373113cd05d72a79f389273730eb8f3697898ed8417242c8858ac83803ea91aa4ff591bd9b6a38a0360b8a9998f66e0fb76f10b6111895e68219fe90939c7b88
6
+ metadata.gz: ef9befafde933e52bdcd6617efb75385d79e7cd7c075fab9fa6e0d04396840e4131d858180b1ac5f7c0a52cef9737fe3bef600e6104399dfb318a10289cd8490
7
+ data.tar.gz: 2cb79f2f07fb033870f71f38f4975c3ce757f584e65fc872bd12c7cb27a84cb87859c0f275b18d0f137598e9b7991bd7cf61f799b1e8b88e65962bc6a0eab2b1
@@ -17,7 +17,7 @@ module Sibu
17
17
  end
18
18
 
19
19
  def site_versions
20
- [['Français (par défaut)', 'fr'], ['Anglais', 'en']]
20
+ Rails.application.config.sibu[:versions] || [['Français', 'fr']]
21
21
  end
22
22
  end
23
23
  end
@@ -25,7 +25,7 @@ class Sibu::ImageUploader < Shrine
25
25
  end
26
26
 
27
27
  def generate_location(io, context)
28
- user_id = context[:record].user_id
28
+ user_id = context[:record] ? context[:record].user_id : nil
29
29
  style = context[:version] != :original ? "resized" : "originals"
30
30
  name = super
31
31
 
@@ -3,11 +3,7 @@ module Sibu
3
3
  include ActiveSupport::Concern
4
4
 
5
5
  def for_user(usr)
6
- Rails.application.config.sibu[:multi_user] ? (shared + where(user_id: usr.id)) : all
7
- end
8
-
9
- def shared
10
- where(user_id: nil)
6
+ Rails.application.config.sibu[:multi_user] ? where(user_id: [nil, usr.id]) : all
11
7
  end
12
8
  end
13
9
  end
@@ -31,7 +31,8 @@ module Sibu
31
31
 
32
32
  # Todo : fix me (is_home flag ?)
33
33
  def update_path
34
- self.path = name.parameterize if self.path.blank? && name != 'Accueil'
34
+ prefix = site.version == Sibu::Site::DEFAULT_VERSION ? '' : "#{site.version}/"
35
+ self.path = "#{prefix}#{name != 'Accueil' ? name.parameterize : ''}" if self.path.blank?
35
36
  end
36
37
 
37
38
  def site_template
@@ -1,5 +1,6 @@
1
1
  require "shrine"
2
2
  require "shrine/storage/file_system"
3
+ require "mini_magick"
3
4
 
4
5
  Shrine.storages = {
5
6
  cache: Shrine::Storage::FileSystem.new("public", prefix: "uploads/cache"),
@@ -11,4 +12,8 @@ Shrine.storages = {
11
12
  }
12
13
 
13
14
  Shrine.plugin :activerecord
14
- Shrine.plugin :cached_attachment_data
15
+ Shrine.plugin :cached_attachment_data
16
+
17
+ MiniMagick.configure do |config|
18
+ config.whiny = false
19
+ end
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.6.8'
2
+ VERSION = '0.6.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails