recourse 7.12.0 → 7.12.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: 9e4b4229005fd88e1617e55a5f4760da0ebb2d7b897eabd730adeac07c7eb61d
4
- data.tar.gz: b84e0db179300948a05e77e9bbdbdcbaad8ef1ee794632f42abeec752b3395ad
3
+ metadata.gz: c3f3474232bc6f128f093102e6695f23e9579ad323bc60bba64fc5bfeb47c5c1
4
+ data.tar.gz: 0ae245a7fd65040853c0ce90112241b19c8a47d053a86d48a513a229e35191ec
5
5
  SHA512:
6
- metadata.gz: 2aa90f2ea92f2370ac39c64f0351518785bf3cb3233e7fab52e61cae83d8c90df80362a8c8267d451e8869b5e6da3cf22b9bb38b59c0510d7cc7958355da07e2
7
- data.tar.gz: b0c47758910fe5c03c28084afa668adec4d6a07c399894f05ea0a7fbf57983c2988a84f72fed6a2ea84cb8a49c0730f9a894240e3ddfeb85f8a1f256b9081e2e
6
+ metadata.gz: 1087e317accf95b332f2e97f7aee06e22275a0129a2d6d7e8d4b3e35a0cbd84a059ce69e9f265559f6ce2d0ade6bd79b344ecb6dfe1feb86c45710da62c6372d
7
+ data.tar.gz: 55486b544450eaf334cd99d00e81fd493139870780fe78c9d2df90299b44d9a9cd2896a3a8c3e4115a4fb8c3a3929481a7390f876dcd8ea4369f9ffcdf5227c3
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 7.12.1 - 2026-10-02
11
+
12
+ * [FIX] A model kept in a module is bookmarked and nested under by its route's name
13
+
14
+ The id a bookmark posts and a nested page reads its parent by is named after the route,
15
+ `user_id`, and no longer after the model's whole name, `admin_user_id`, which no route draws.
16
+ A model's default icon and the name its parent is assigned to (`@user`) drop the module too.
17
+ For a model at the top level, all of these read as they did.
18
+
10
19
  ## 7.12.0 - 2026-10-02
11
20
 
12
21
  * [FEATURE] A route drawn in a module lists the model kept in that module
@@ -18,7 +18,7 @@ module Recourse
18
18
  model = path && Recourse.model?(path)
19
19
  return unless model && @recourse_parent.is_a?(model)
20
20
 
21
- instance_variable_set "@#{model.model_name.singular}", @recourse_parent
21
+ instance_variable_set "@#{model.model_name.element}", @recourse_parent
22
22
  end
23
23
  end
24
24
  end
@@ -27,7 +27,7 @@ module Recourse
27
27
  model = parent && Recourse.model?(parent)
28
28
  return unless model
29
29
 
30
- id = request.path_parameters[:"#{model.model_name.singular}_id"]
30
+ id = request.path_parameters[:"#{model.model_name.singular_route_key}_id"]
31
31
  model.find_by id: id if id
32
32
  end
33
33
 
@@ -83,7 +83,7 @@ module Recourse
83
83
 
84
84
  def bookmark_url(record)
85
85
  url_for controller: "/#{resource_controller_path}/bookmarks", action: :create,
86
- "#{resource_model.model_name.singular}_id": record.id
86
+ "#{resource_model.model_name.singular_route_key}_id": record.id
87
87
  end
88
88
  end
89
89
  end
data/lib/recourse/maps.rb CHANGED
@@ -18,7 +18,7 @@ module Recourse
18
18
  def self.mappable?(model) = placed?(model) || (POINT_COLUMNS - model.column_names).empty?
19
19
 
20
20
  # The layer a model's places are drawn on, or nil for a model that is no geography.
21
- def self.boundary(model) = BOUNDARIES[model.model_name.singular.to_sym]
21
+ def self.boundary(model) = BOUNDARIES[model.model_name.element.to_sym]
22
22
 
23
23
  # Whether a model's rows keep a place ID, which an area or a pin at a place is drawn from.
24
24
  def self.placed?(model) = model.column_names.include? PLACE_COLUMN
@@ -10,7 +10,7 @@ module Recourse
10
10
  # The concept a resource is drawn with, which Unicon names in each icon set it
11
11
  # knows. A model's own name by default — `contact` draws a rolodex, `job` a hammer
12
12
  # — and Unicon answers with a circle for a name it has never heard of.
13
- def recourse_icon = model_name.singular.to_sym
13
+ def recourse_icon = model_name.element.to_sym
14
14
 
15
15
  # Columns the model keeps off its screens — the table, the show page, the
16
16
  # form and the search box — none by default. One name or a list:
@@ -1,4 +1,4 @@
1
1
  module Recourse
2
2
  # Version of the gem, read by the gemspec and by hosts checking compatibility.
3
- VERSION = '7.12.0'
3
+ VERSION = '7.12.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.12.0
4
+ version: 7.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob