tramway-core 1.14.5.2 → 1.14.7.1

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: 56203f0c0c9fcdf1e08f10c7053127a979cb953ba11bc638e22326a8cc4a9953
4
- data.tar.gz: ac6e6a9d095a882662a0f725b0980637d75501f07dabff3395276c9af35cc9f6
3
+ metadata.gz: 342f7e0203c9760eb999b73aab0851970249cb4842b372f190e7b64f80072ba1
4
+ data.tar.gz: 8d65b2c788927529f8c0e7202ada01fd18ffd26e3a8b16a1f0297c6ba04bbc92
5
5
  SHA512:
6
- metadata.gz: 5b263cc4fc7bdb6fd10a463c26064749e90b75ebe9a45c002c910d1a74ecb1190191253b348486d982eadfea6831a3200bf047b80aad12f814b10f2d857b0f14
7
- data.tar.gz: 24667714b920410c7f022c8a958cbcd71d302fd7b31d3207b5f8bc12b9df6e4d76f1a751418e14db8c89d25abc64bcef73d29951e83518168112616fc9cb40cc
6
+ metadata.gz: 3fa66055ce40a7e966fb66196243cb20e21f41be28c59682cce821b0d78473598da6d39e68837478d62ae66f15ed19382ca8b64748db00b67fd11b2701b39936
7
+ data.tar.gz: db16cc89c4230e09804443baa8024b98ae0c50a827718ad366041821d19d26202cbd144a0ccc64d859258884793b6e58c5fcf59f7cf093e32f388417e28e921d
@@ -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
@@ -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.2'
5
+ VERSION = '1.14.7.1'
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.2
4
+ version: 1.14.7.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: 2020-01-11 00:00:00.000000000 Z
11
+ date: 2020-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: audited
@@ -124,22 +124,16 @@ dependencies:
124
124
  name: loofah
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '2.2'
130
127
  - - ">="
131
128
  - !ruby/object:Gem::Version
132
- version: 2.2.1
129
+ version: 2.3.1
133
130
  type: :runtime
134
131
  prerelease: false
135
132
  version_requirements: !ruby/object:Gem::Requirement
136
133
  requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '2.2'
140
134
  - - ">="
141
135
  - !ruby/object:Gem::Version
142
- version: 2.2.1
136
+ version: 2.3.1
143
137
  - !ruby/object:Gem::Dependency
144
138
  name: mini_magick
145
139
  requirement: !ruby/object:Gem::Requirement