hot-glue 0.6.24 → 0.6.25
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/generators/hot_glue/fields/association_field.rb +1 -0
- data/lib/generators/hot_glue/templates/typeahead_controller.rb.erb +1 -1
- data/lib/generators/hot_glue/typeahead_generator.rb +4 -0
- data/lib/hotglue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 484a64a521f4d21dbb5b437ce26950d218e5a7ea5917261eb0fbb59119bc19d5
|
4
|
+
data.tar.gz: 8d4570fcf5fc850c1bee98868fa19bd2805f794fa6a94425876c2bc9d4bc94af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49bc8ddab30ed9cb637dbbe9da496fd47836239c9f260a61b03b81ef23ef3dab864aba2c84a634dad6004720cb6a9697afed9cbbdcb2ff3de76324bc42ab760e
|
7
|
+
data.tar.gz: 3145730b0c6510dcf6d813ff59acca04b867c248fb4f8107cae496c6a9405cf29260c6a8bde3e644aadf4e9853275fc55ba741409ef30014ac48fdd6fc12c2ef
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2042,6 +2042,11 @@ has_many :users, through: :account_users
|
|
2042
2042
|
```
|
2043
2043
|
|
2044
2044
|
|
2045
|
+
Notice that from the table of things referencing the typeahead thing,
|
2046
|
+
the `--modify` takes a 3rd parameter in `[...]` to specify the nested set if the typeahead itself is nested.
|
2047
|
+
|
2048
|
+
As with this example, this means that the object referencing the typeahead object must be in the same namespace, but does not need to be at the same nest level.
|
2049
|
+
|
2045
2050
|
`bin/rails generate hot_glue:scaffold Member --auth='current_user' --auth-identifier='user' --auth-identifier=user --modify='user_id{typeahead}[account]'`
|
2046
2051
|
|
2047
2052
|
in our routes.rb file, we have
|
@@ -100,6 +100,7 @@ class AssociationField < Field
|
|
100
100
|
parts = name.split('_')
|
101
101
|
"<%= f.text_field :__lookup_#{assoc}_#{lookup_field}, value: @#{singular}.#{assoc_name}&.#{lookup_field}, placeholder: \"#{lookup_field}\" " + (stimmify ? ", 'data-#{@stimmify}-target': '#{camelcase_name}' " : "") + "%>"
|
102
102
|
elsif modify_as && modify_as[:typeahead]
|
103
|
+
|
103
104
|
search_url = "#{namespace ? namespace + "_" : ""}" +
|
104
105
|
modify_as[:nested].join("_") + ( modify_as[:nested].any? ? "_" : "") +
|
105
106
|
+ "#{assoc.class_name.downcase.pluralize}_typeahead_index_url"
|
@@ -14,7 +14,7 @@ class <%= ((@namespace.titleize.gsub(" ", "") + "::" if @namespace) || "") + @pl
|
|
14
14
|
<% nest_chain = [] %>
|
15
15
|
<% @nested_set.each { |arg|
|
16
16
|
if @auth_identifier == arg[:singular]
|
17
|
-
this_scope =
|
17
|
+
this_scope = auth_object
|
18
18
|
elsif nest_chain.empty?
|
19
19
|
this_scope = "#{@auth ? @auth : class_name}.#{arg[:plural]}"
|
20
20
|
else
|
data/lib/hotglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot-glue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|