superglue 0.53.0 → 0.53.2

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: c657a62bc960eead2e245bb9ab18c948e4189a71b2912b93af6db77ab3c736ec
4
- data.tar.gz: 877c045ed6e1f0d9ba2ec5dd22cfff0f90fa3dc09857391329d88239706e398a
3
+ metadata.gz: 280ae24037b8a75c5173d9b4ed191d1e6661d25dfea3ddc21987ca8f39464f18
4
+ data.tar.gz: a94b4fa59affad9b246e0561c58ee6fc4012c4a3c08d73557cd92f032d957b32
5
5
  SHA512:
6
- metadata.gz: efb1cbbfa8f10db7e67d99216581f0d0852d2d4e34b49b4560d5b05c16217a8df9eba63e13489c617d8ac1324b262fdec1b9d6fc02703c1a10551cde045df8e5
7
- data.tar.gz: cbbc592a52dfd39f4ce3e9ed618e2fed40746dd4b4daadc926ed02e3dcca5dc4813f2b881ee80394c380e30fcf2927198da6a6094e7ffac2b3d1005ee6beecbc
6
+ metadata.gz: 7db0beb0224b67b309a846825ac6ee40634661b51eedf3e7f686cd6e6fed2fd253c8b4510a9c0c5dafe4bf51b5544413286a8f3c7f7e935c6b245f211429c724
7
+ data.tar.gz: 2c1a8bd715494f92e9ffeae54bec3555b1b5731ae137da606979d52bbfac7775a694772d8a0274131174799995d62442bb3a37471a27d8786372877398c44d40
@@ -1,6 +1,6 @@
1
- if @post.errors.any?
1
+ if @<%= singular_table_name %>.errors.any?
2
2
  json.errors({
3
- explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this post from being saved:",
3
+ explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:",
4
4
  messages: @<%= singular_table_name %>.errors.full_messages.map{|msg| {body: msg}}
5
5
  })
6
6
  end
@@ -1,6 +1,6 @@
1
- if @post.errors.any?
1
+ if @<%= singular_table_name %>.errors.any?
2
2
  json.errors({
3
- explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this post from being saved:",
3
+ explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:",
4
4
  messages: @<%= singular_table_name %>.errors.full_messages.map{|msg| {body: msg}}
5
5
  })
6
6
  end
@@ -5,14 +5,14 @@ export default function <%= plural_table_name.camelize %>Edit ({
5
5
  // visit,
6
6
  // remote,
7
7
  form,
8
- error,
8
+ errors,
9
9
  <%= singular_table_name.camelize(:lower) %>Path,
10
10
  <%= plural_table_name.camelize(:lower) %>Path,
11
11
  }) {
12
- const messagesEl = error && (
12
+ const messagesEl = errors && (
13
13
  <div id="error_explanation">
14
- <h2>{ error.explanation }</h2>
15
- <ul>{ error.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
14
+ <h2>{ errors.explanation }</h2>
15
+ <ul>{ errors.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
16
16
  </div>
17
17
  )
18
18
 
@@ -5,13 +5,13 @@ export default function <%= plural_table_name.camelize %>New({
5
5
  // visit,
6
6
  // remote
7
7
  form,
8
- error,
8
+ errors,
9
9
  <%= plural_table_name.camelize(:lower) %>Path,
10
10
  }) {
11
- const messagesEl = error && (
11
+ const messagesEl = errors && (
12
12
  <div id="error_explanation">
13
- <h2>{ error.explanation }</h2>
14
- <ul>{ error.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
13
+ <h2>{ errors.explanation }</h2>
14
+ <ul>{ errors.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
15
15
  </div>
16
16
  )
17
17
 
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  if path
17
17
  json.action 'graft'
18
- json.path search_path_to_camelized_param(path)
18
+ json.path params[:props_at]
19
19
  end
20
20
 
21
21
  json.restoreStrategy 'fromCacheAndRevisitInBackground'
@@ -16,27 +16,11 @@ module Superglue
16
16
 
17
17
  def param_to_search_path(param)
18
18
  if param
19
- param.gsub(/[^\da-zA-Z_=.]+/, "").squeeze(".")
19
+ param
20
+ .gsub(/[^\da-zA-Z_=.]+/, "")
21
+ .squeeze(".")
20
22
  .split(".")
21
- .map do |part|
22
- if /^-?[0-9]+$/.match?(part)
23
- part.to_i
24
- else
25
- part
26
- end
27
- end
28
23
  end
29
24
  end
30
-
31
- def search_path_to_camelized_param(path)
32
- path.map do |part|
33
- if part.include? "="
34
- key, rest = part.split("=")
35
- [key.camelize(:lower), rest].join("=")
36
- else
37
- part.camelize(:lower)
38
- end
39
- end.join(".")
40
- end
41
25
  end
42
26
  end
data/lib/superglue.rb CHANGED
@@ -10,7 +10,6 @@ module Superglue
10
10
  def self.included(base)
11
11
  if base.respond_to?(:helper_method)
12
12
  base.helper_method :param_to_search_path
13
- base.helper_method :search_path_to_camelized_param
14
13
  end
15
14
  end
16
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superglue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.53.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johny Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-10 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -52,90 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.0.5
55
- - !ruby/object:Gem::Dependency
56
- name: activerecord
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '7.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '7.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '12.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '12.0'
83
- - !ruby/object:Gem::Dependency
84
- name: sqlite3
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.3'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.3'
97
- - !ruby/object:Gem::Dependency
98
- name: minitest
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '5.10'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '5.10'
111
- - !ruby/object:Gem::Dependency
112
- name: capybara
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '3.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '3.0'
125
- - !ruby/object:Gem::Dependency
126
- name: selenium-webdriver
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '3.11'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '3.11'
139
55
  description: Rails integration for SuperglueJS
140
56
  email: jho406@gmail.com
141
57
  executables: []