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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60aa3d000059c9c0380d1312c19613174e912975651ae275294fd46d988a1e9a
|
4
|
+
data.tar.gz: 13439e65ee1da45cc2fdcc3539d9ad1bb16af73871254b3e533d910f242950f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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'))
|
data/lib/tramway/core/version.rb
CHANGED
data/lib/tramway/core.rb
CHANGED