organizations 0.3.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/organizations/version.rb +1 -1
- data/lib/organizations/view_helpers.rb +10 -5
- 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: 93641d7c8f80e347c31ffb9ad1c1f0f489078218f65c8204a4f3f48ad1d3c070
|
|
4
|
+
data.tar.gz: 79f97cdfe624459b128075e7800d1452b35be970109cb7b1e2c040fcc69694b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b60315a1184fe81064acb974a95dd80a82c99abf9fbedb117a231e43a44ec11b99218b25f38efeae6ad88015b7445e66354a2351c28ad3572f75dd7323e60601
|
|
7
|
+
data.tar.gz: 5d0618750b4a4e59757538a99e1ca3e8ae6817f7cf6a395e194e7754eabc1f43dd747ea37e3aacf6979b0b5c945336b226c6e18e915a3dae58b14bbe13c3c1a5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [0.3.1] - 2026-02-28
|
|
2
|
+
|
|
3
|
+
- Fixed `organization_switcher_data[:switch_path]` generating broken URLs when engine mounted with custom name (e.g., `as: 'organizations_engine'`)
|
|
4
|
+
- `switch_path` now uses engine's own route helpers, works regardless of mount name or path
|
|
5
|
+
|
|
1
6
|
## [0.3.0] - 2026-02-20
|
|
2
7
|
|
|
3
8
|
- Invitation onboarding is now first-class and configurable, so host apps can remove most custom signup/invite glue code.
|
|
@@ -326,16 +326,21 @@ module Organizations
|
|
|
326
326
|
end
|
|
327
327
|
|
|
328
328
|
# Build a lambda for generating switch paths
|
|
329
|
-
# Uses route helpers
|
|
329
|
+
# Uses the engine's own route helpers to ensure correct paths regardless of mount configuration
|
|
330
330
|
def build_switch_path_lambda
|
|
331
|
-
#
|
|
332
|
-
#
|
|
333
|
-
|
|
331
|
+
# Primary: Use the engine's own route helpers
|
|
332
|
+
# This works regardless of how the engine is mounted (name or path).
|
|
333
|
+
# When mounted (e.g., `mount Engine => '/org'`), the engine's url_helpers
|
|
334
|
+
# generate paths relative to the mount point (e.g., `/org/organizations/switch/:id`).
|
|
335
|
+
if defined?(Organizations::Engine)
|
|
336
|
+
->(org_id) { Organizations::Engine.routes.url_helpers.switch_organization_path(org_id) }
|
|
337
|
+
# Fallbacks below are for non-Rails environments (e.g., gem unit tests that don't load Rails).
|
|
338
|
+
# In production Rails apps, Organizations::Engine is always defined.
|
|
339
|
+
elsif respond_to?(:organizations) && organizations.respond_to?(:switch_organization_path)
|
|
334
340
|
->(org_id) { organizations.switch_organization_path(org_id) }
|
|
335
341
|
elsif respond_to?(:main_app) && main_app.respond_to?(:switch_organization_path)
|
|
336
342
|
->(org_id) { main_app.switch_organization_path(org_id) }
|
|
337
343
|
else
|
|
338
|
-
# Fallback to standard path
|
|
339
344
|
->(org_id) { "/organizations/switch/#{org_id}" }
|
|
340
345
|
end
|
|
341
346
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: organizations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rameerez
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-02-
|
|
10
|
+
date: 2026-02-28 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: railties
|