tramway-core 1.14.5.3 → 1.14.7.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: ec8a9dd2fded028872c1df491bb5c77d9c3968aa4f36ffa59ccf06d1831f25af
4
- data.tar.gz: ceb1f3097bf8c0de11aa0af8e65761533cddbe506edcec7068d8c35ff5f51101
3
+ metadata.gz: 57429caa3a4b72ed49f83929d83d6c3739edb046fa16f219c01951e4c05935fe
4
+ data.tar.gz: 66abea73625c9c3bb82b71cb7763476419771950c1cf50bfa9e59959e59275c6
5
5
  SHA512:
6
- metadata.gz: f8eeaf2299b58e3ba5b3d871d41b53e150ad61acfa5a89c3e008a9257c265ee3a1269ce37521e651e14ebaa948073f5ecd1e5ac3c7f19241be3cd63de757ba8f
7
- data.tar.gz: d249b46356de64c49bb1b74efc250c10068758211eee9879b25b9ce7a0f50eb68f6baf7dfcd9e7b392171089759408fd140c2ba46cd1dc91f055bb43f4de0e68
6
+ metadata.gz: d261540d8bdfd47cdefc7098960ac061dfb218456264b31f3939ad9fa12f56391089fb19d83fe54994def89516ea9630b4d044834e0443168fd79f19959ee5a3
7
+ data.tar.gz: fd4a3ebafd15ca76a4c1a33eb039b806bb9cd86e8713ebe58c981b84e6d5e39b4c90a0820e0cabcbde7b73ab4f1b41b03906da83d3eab0cf4eb214248f574a39
@@ -27,4 +27,3 @@ $(document).ready ->
27
27
  anchor = $(this).data('anchor')
28
28
  unless $(anchor).offset() == undefined
29
29
  $(window).scrollTop $(anchor).offset().top
30
-
@@ -3,6 +3,11 @@
3
3
  module Tramway
4
4
  module Core
5
5
  class ApplicationController < ActionController::Base
6
+ before_action :application
7
+
8
+ def application
9
+ @application = ::Tramway::Core.application_object
10
+ end
6
11
  end
7
12
  end
8
13
  end
@@ -8,7 +8,7 @@ module Tramway
8
8
  title_text = "#{page_title} | #{@application.try(:title) || @application.public_name}"
9
9
  content_for(:title) { title_text }
10
10
  else
11
- 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')
11
+ 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 maybe you don\'t have any records of application model')
12
12
  raise error.message
13
13
  end
14
14
  end
@@ -4,9 +4,13 @@ module Tramway
4
4
  module Collections
5
5
  module Helper
6
6
  def collection_list_by(name:)
7
- require name # needed to load class name with collection
7
+ begin
8
+ require name # needed to load class name with collection
9
+ rescue LoadError
10
+ raise "No such file #{name}. You should create file in the `lib/#{name}.rb` or elsewhere you want"
11
+ end
8
12
  unless ::Tramway::Collection.descendants.map(&:to_s).include?(name.camelize)
9
- raise "There no such collection named #{name.camelize}. Please create class with self method `list` and extended of `Tramway::Collection`"
13
+ raise "There no such collection named #{name.camelize}. Please create class with self method `list` and extended of `Tramway::Collection`. You should reload your server after creating this collection."
10
14
  end
11
15
 
12
16
  name.camelize.constantize.list
@@ -20,7 +20,15 @@ module Tramway
20
20
  end
21
21
 
22
22
  def application_object
23
- @application&.model_class.present? ? @application.model_class.first : @application
23
+ if @application&.model_class.present?
24
+ begin
25
+ @application.model_class.first
26
+ rescue
27
+ nil
28
+ end
29
+ else
30
+ @application
31
+ end
24
32
  end
25
33
 
26
34
  attr_reader :application
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tramway::Core::Application
4
- attr_accessor :name, :url, :model_class, :title, :tagline, :found_date
4
+ attr_accessor :name, :url, :model_class, :title, :tagline, :found_date, :phone, :email
5
5
 
6
6
  def public_name
7
7
  name.to_s.gsub('_', ' ').camelize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '1.14.5.3'
5
+ VERSION = '1.14.7.2'
6
6
  end
7
7
  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.14.5.3
4
+ version: 1.14.7.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-01-11 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: audited
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ckeditor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 4.2.4
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 4.2.4
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: enumerize
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -124,22 +138,16 @@ dependencies:
124
138
  name: loofah
125
139
  requirement: !ruby/object:Gem::Requirement
126
140
  requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '2.2'
130
141
  - - ">="
131
142
  - !ruby/object:Gem::Version
132
- version: 2.2.1
143
+ version: 2.3.1
133
144
  type: :runtime
134
145
  prerelease: false
135
146
  version_requirements: !ruby/object:Gem::Requirement
136
147
  requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '2.2'
140
148
  - - ">="
141
149
  - !ruby/object:Gem::Version
142
- version: 2.2.1
150
+ version: 2.3.1
143
151
  - !ruby/object:Gem::Dependency
144
152
  name: mini_magick
145
153
  requirement: !ruby/object:Gem::Requirement