tramway-core 1.11 → 1.11.1

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: e17dfbdff34fe334d3e5893a96fb7b673647c1f86b4bd093a60f4ce7d6348350
4
- data.tar.gz: f1290d0d3ceb587f7b47819548109b71eb46db634cc8b5b42ab9061dfe731564
3
+ metadata.gz: 3348ffc445ecc81aad1ca01f307174a84d0952c6a399aa261b5cf15a92a1c99a
4
+ data.tar.gz: 17aa3f015b0b0b405317abe2496980ccbb736439ba312e69609782fd6f9281b4
5
5
  SHA512:
6
- metadata.gz: 0edbe1414b47bce6d44871f5806c5863d6c2908af1ad292534057e013fd1106adc6472ff5b23707ce4d52484e53653957348ce789e6b541b83577092c0099f4a
7
- data.tar.gz: a273b7e04fcedf836d3b378091cf4b83f08dd87a66d44f2319c48a5c4adfbd852b8a54313168113de04cbd11174253986d260d132910f39f88aa94036bf96a86
6
+ metadata.gz: b605c1f468816a86c3b8934deec966fe065a1d9bd422838fd5a93c4f7ae1759b244ac019853756a5821d678d7199aa41aedfe0984a5a11b056cedd7432d8b823
7
+ data.tar.gz: 9769196d88397cb81bf2c7562ff69259e2328eb9cda0a9d2d3a4112f229265f51c850f71382350a648370c2d6f2dc7959a01d4b8c5e436614810dc1354bfd86f
@@ -19,6 +19,10 @@ class Tramway::Core::ApplicationDecorator
19
19
  end
20
20
 
21
21
  class << self
22
+ def collections
23
+ [:all]
24
+ end
25
+
22
26
  def list_attributes
23
27
  []
24
28
  end
@@ -13,8 +13,13 @@ module Tramway::Core::Concerns::AttributesDecoratorHelper
13
13
 
14
14
  def image_view(value)
15
15
  content_tag(:div) do
16
- if value.url.match(/jpg|JPG|png|PNG$/)
17
- concat image_tag value.try(:small) ? value.small.url : value.url
16
+ begin
17
+ if value.url.match(/jpg|JPG|png|PNG$/)
18
+ concat image_tag value.try(:small) ? value.small.url : value.url
19
+ end
20
+ rescue NoMethodError => e
21
+ error = Tramway::Error.new plugin: :core, method: :image_view, message: e.name == :url ? 'You should mount PhotoUploader to your model. Just add `mount_uploader #{attribute_name}, PhotoUploader` to your model' : e.message
22
+ raise error.message
18
23
  end
19
24
  concat link_to(fa_icon(:download), value.url, class: 'btn btn-success')
20
25
  end
@@ -6,7 +6,7 @@ module Tramway
6
6
  title_text = "#{page_title} | #{@application.try(:title) || @application.public_name}"
7
7
  content_for(:title) { title_text }
8
8
  else
9
- error = Tramway::Error.new(plugin: :core, method: :title, message: ('You should set Tramway::Core::Application class using `::Tramway::Core.initialize_application model_class: #{model_class_name}` in config/initializers/tramway.rb'))
9
+ error = Tramway::Error.new(plugin: :core, method: :title, message: ('You should set Tramway::Core::Application class using `::Tramway::Core.initialize_application model_class: #{model_class_name}` in config/initializers/tramway.rb OR may be you don\'t have any records of application model'))
10
10
  raise error.message
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.11'
3
+ VERSION = '1.11.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.11'
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-23 00:00:00.000000000 Z
11
+ date: 2019-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails
@@ -396,7 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  version: '0'
397
397
  requirements: []
398
398
  rubyforge_project:
399
- rubygems_version: 2.7.7
399
+ rubygems_version: 2.7.6
400
400
  signing_key:
401
401
  specification_version: 4
402
402
  summary: Core for all Tramway Rails Engines