rhino_project_organizations 0.20.0.alpha.0 → 0.20.0.beta.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -2
- data/app/models/rhino/role.rb +1 -5
- data/app/models/rhino/users_role_invite.rb +1 -6
- data/app/overrides/devise/invitations_controller_override.rb +1 -1
- data/lib/generators/rhino_organizations/install/install_generator.rb +0 -6
- data/lib/rhino_organizations/engine.rb +7 -11
- data/lib/rhino_organizations/version.rb +1 -1
- metadata +15 -30
- data/lib/generators/rhino_organizations/install/templates/seeds/organizations.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe0d222969d9e996100fa97f1bbc9e108bea08761393b1dc499fe3013ae3a069
|
4
|
+
data.tar.gz: 2a1c60f12b2475dcd4c6ce0ee43812e426016f80b62c63c053e706b2cb608012
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5c6424c003e72e2c699185866879070bd32b944062ce06d68055a84f232cb3dd868ca95dc922708c04676535a208871551cb77f4f0a22e154141df51a18674a
|
7
|
+
data.tar.gz: a5fb9c081d8451d0c7e1afa4b1c17fb4f6aac64298797853f55e4cdc8b8eaf7945c2218203a81982e2030267d24ee2261ed8f4bffe52c335f31f486de5bfc634
|
data/Rakefile
CHANGED
data/app/models/rhino/role.rb
CHANGED
@@ -4,12 +4,8 @@ module Rhino
|
|
4
4
|
class Role < ApplicationRecord
|
5
5
|
self.abstract_class = true
|
6
6
|
|
7
|
-
validates :name, presence: true, uniqueness: true, format: { with: /\A[a-zA-
|
7
|
+
validates :name, presence: true, uniqueness: true, format: { with: /\A[a-zA-Z]+\z/, message: "alpha characters only" }
|
8
8
|
|
9
9
|
rhino_owner_global
|
10
|
-
|
11
|
-
def display_name
|
12
|
-
name.titleize
|
13
|
-
end
|
14
10
|
end
|
15
11
|
end
|
@@ -8,9 +8,8 @@ module Rhino
|
|
8
8
|
# FIXME: Only necessary because this module is in tree NUB-910
|
9
9
|
rhino_owner :organization if Rhino.resources.include?("Organization")
|
10
10
|
rhino_references %i[role organization]
|
11
|
-
rhino_controller :users_role_invite
|
12
11
|
|
13
|
-
|
12
|
+
rhino_controller :users_role_invite
|
14
13
|
|
15
14
|
after_create do
|
16
15
|
::UsersRole.create!(user: ::User.find_by(email:), organization:, role:)
|
@@ -22,9 +21,5 @@ module Rhino
|
|
22
21
|
def track_invite
|
23
22
|
Rhino::SegmentHelper.track_invite(self)
|
24
23
|
end
|
25
|
-
|
26
|
-
def normalize_email
|
27
|
-
self.email = email.downcase
|
28
|
-
end
|
29
24
|
end
|
30
25
|
end
|
@@ -36,7 +36,7 @@ class Devise::InvitationsController
|
|
36
36
|
def set_cookie
|
37
37
|
return unless DeviseTokenAuth.cookie_enabled
|
38
38
|
|
39
|
-
auth_header = resource.
|
39
|
+
auth_header = resource.build_auth_header(@token.token, @token.client)
|
40
40
|
cookies[DeviseTokenAuth.cookie_name] = DeviseTokenAuth.cookie_attributes.merge(value: auth_header.to_json)
|
41
41
|
end
|
42
42
|
|
@@ -42,12 +42,6 @@ module RhinoOrganizations
|
|
42
42
|
inject_into_file 'config/initializers/rhino.rb', optimize_indentation(data, 2), after: /^\s*config\.resources.+\n/
|
43
43
|
end
|
44
44
|
|
45
|
-
def install_seeds
|
46
|
-
say 'Copying seed files'
|
47
|
-
copy_file "#{__dir__}/templates/seeds/organizations.rb", 'db/seeds/development/organizations.rb'
|
48
|
-
copy_file "#{__dir__}/templates/seeds/organizations.rb", 'db/seeds/test/organizations.rb'
|
49
|
-
end
|
50
|
-
|
51
45
|
def install_active_admin # rubocop:disable Metrics/MethodLength
|
52
46
|
say 'Copying rhino_organization ActiveAdmin files and configurations'
|
53
47
|
copy_file "#{__dir__}/templates/admin/users_roles.rb", 'app/admin/users_roles.rb'
|
@@ -1,20 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require "rhino_organizations/version"
|
5
|
-
|
6
|
-
# https://guides.rubyonrails.org/engines.html#other-gem-dependencies
|
7
|
-
require "devise_invitable"
|
3
|
+
require 'rhino/engine'
|
8
4
|
|
9
5
|
module RhinoOrganizations
|
10
6
|
class Engine < ::Rails::Engine
|
11
|
-
config.autoload_paths << File.expand_path(
|
7
|
+
config.autoload_paths << File.expand_path('../../lib', __dir__)
|
12
8
|
|
13
|
-
initializer
|
9
|
+
initializer 'rhino_organizations.register_module' do
|
14
10
|
config.after_initialize do
|
15
|
-
if Rhino.resources.include?(
|
11
|
+
if Rhino.resources.include?('Organization')
|
16
12
|
Rhino.registered_modules[:rhino_organizations] = {
|
17
|
-
version: RhinoOrganizations::VERSION
|
13
|
+
version: RhinoOrganizations::VERSION
|
18
14
|
}
|
19
15
|
end
|
20
16
|
end
|
@@ -22,13 +18,13 @@ module RhinoOrganizations
|
|
22
18
|
|
23
19
|
# https://guides.rubyonrails.org/engines.html#overriding-models-and-controllers
|
24
20
|
# Use root instead of Rails.root to scope for this engine
|
25
|
-
initializer
|
21
|
+
initializer 'rhino_organizations.overrides' do
|
26
22
|
overrides = "#{root}/app/overrides"
|
27
23
|
Rails.autoloaders.main.ignore(overrides)
|
28
24
|
|
29
25
|
config.to_prepare do
|
30
26
|
# FIXME: Only necessary because this module is in tree NUB-682
|
31
|
-
if Rhino.resources.include?(
|
27
|
+
if Rhino.resources.include?('Organization')
|
32
28
|
Dir.glob("#{overrides}/**/*_override.rb").each do |override|
|
33
29
|
load override
|
34
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_organizations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.0.
|
4
|
+
version: 0.20.0.beta.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,51 +16,37 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.
|
19
|
+
version: 7.0.0
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 7.
|
22
|
+
version: 7.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 7.
|
29
|
+
version: 7.0.0
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 7.
|
32
|
+
version: 7.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rhino_project_core
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - '='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.20.0.
|
39
|
+
version: 0.20.0.beta.22
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - '='
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.20.0.
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: devise_invitable
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - '='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 2.0.9
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - '='
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.0.9
|
46
|
+
version: 0.20.0.beta.22
|
61
47
|
description: ''
|
62
48
|
email:
|
63
|
-
-
|
49
|
+
- jprosevear@gmail.com
|
64
50
|
executables: []
|
65
51
|
extensions: []
|
66
52
|
extra_rdoc_files: []
|
@@ -91,7 +77,6 @@ files:
|
|
91
77
|
- lib/generators/rhino_organizations/install/templates/models/role.rb
|
92
78
|
- lib/generators/rhino_organizations/install/templates/models/users_role.rb
|
93
79
|
- lib/generators/rhino_organizations/install/templates/models/users_role_invite.rb
|
94
|
-
- lib/generators/rhino_organizations/install/templates/seeds/organizations.rb
|
95
80
|
- lib/rhino_organizations/engine.rb
|
96
81
|
- lib/rhino_organizations/test_case.rb
|
97
82
|
- lib/rhino_organizations/test_case/organization_controller.rb
|
@@ -103,7 +88,7 @@ homepage: ''
|
|
103
88
|
licenses:
|
104
89
|
- MIT
|
105
90
|
metadata: {}
|
106
|
-
post_install_message:
|
91
|
+
post_install_message:
|
107
92
|
rdoc_options: []
|
108
93
|
require_paths:
|
109
94
|
- lib
|
@@ -114,12 +99,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
99
|
version: '0'
|
115
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
101
|
requirements:
|
117
|
-
- - "
|
102
|
+
- - ">"
|
118
103
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
104
|
+
version: 1.3.1
|
120
105
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
-
signing_key:
|
106
|
+
rubygems_version: 3.3.26
|
107
|
+
signing_key:
|
123
108
|
specification_version: 4
|
124
109
|
summary: ''
|
125
110
|
test_files: []
|