tramway-core 1.9 → 1.9.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: d0c9350fbd152e4fb256d79c410815dbe6f9160d81db3057380fb959d985b256
4
- data.tar.gz: 0c278423034f87ea9c350aff9181a49d0d92e31f924cc94044dc51c020f679a8
3
+ metadata.gz: 60aa3d000059c9c0380d1312c19613174e912975651ae275294fd46d988a1e9a
4
+ data.tar.gz: 13439e65ee1da45cc2fdcc3539d9ad1bb16af73871254b3e533d910f242950f3
5
5
  SHA512:
6
- metadata.gz: a62b30818cc58cb2187c0621205d7ce81b473af7ce307e8874486be2e0558445491a0b585bd9574ce5edabf64e48382d0063bb2c514c361c26eed885e66847f8
7
- data.tar.gz: 458c61f6fdcd556594bf728b125f3eb6e84d8981c50c45eab0782ea8b2e7e5e5e0206d022f521fbdc77c1029b0749e98bb334bbc15d7a774888edae395bd0db3
6
+ metadata.gz: 94c03d8c6753e79e901b1c98ec4d06de0457934634e24962ffe999381cdf78ee74c8566dc23a5077e12ea5f3891e2f1b831185b9cbde80a3d14119ce9ac52142
7
+ data.tar.gz: b7d7a73879c8f92d05ebbf4e778874dbc4b167501c73d01c2375fa0b19ce02cf626ad94df3507172139dceffc65efa2affe70eb8c1762d210e47514318811da6
@@ -18,9 +18,11 @@ module Tramway::Core
18
18
  end
19
19
  end
20
20
  end
21
+
22
+ delegating object
21
23
  end
22
24
  end
23
-
25
+
24
26
  def submit(params)
25
27
  if params
26
28
  save if validate params
@@ -30,6 +32,10 @@ module Tramway::Core
30
32
  end
31
33
  end
32
34
 
35
+ def model_name
36
+ @@model_class.model_name
37
+ end
38
+
33
39
  def form_properties(**args)
34
40
  @form_properties = args
35
41
  end
@@ -40,6 +46,15 @@ module Tramway::Core
40
46
 
41
47
  def build_errors; end
42
48
 
49
+ def delegating(object)
50
+ methods = [:to_key, :errors]
51
+ methods.each do |method|
52
+ self.class.send(:define_method, method) do
53
+ object.send method
54
+ end
55
+ end
56
+ end
57
+
43
58
  class << self
44
59
  delegate :defined_enums, to: :model_class
45
60
 
@@ -98,6 +113,10 @@ module Tramway::Core
98
113
  end
99
114
  end
100
115
  end
116
+
117
+ def validation_group_class
118
+ ActiveModel
119
+ end
101
120
  end
102
121
  end
103
122
  end
@@ -3,7 +3,7 @@ module Tramway
3
3
  module TitleHelper
4
4
  def title(page_title = default_title)
5
5
  if @application.present?
6
- title_text = "#{page_title} | #{@application.try(:title) || @application.name}"
6
+ title_text = "#{page_title} | #{@application.try(:title) || @application.public_name}"
7
7
  content_for(:title) { title_text }
8
8
  else
9
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'))
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.9'
3
+ VERSION = '1.9.1'
4
4
  end
5
5
  end
data/lib/tramway/core.rb CHANGED
@@ -20,3 +20,12 @@ module Tramway
20
20
  end
21
21
  end
22
22
  end
23
+
24
+ # HACK FIXME
25
+
26
+ module ActiveModel
27
+ class Errors
28
+ def merge!(*args)
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.9'
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov