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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 964db7b13b183284e5d084f8e88897a6a53c6928727e94fa704fe27ae16f6695
4
- data.tar.gz: 6193cb3b0ddfc68dd0a91d1bba54b616390e661202ba0dacd17a5c870ce2e40c
3
+ metadata.gz: fe0d222969d9e996100fa97f1bbc9e108bea08761393b1dc499fe3013ae3a069
4
+ data.tar.gz: 2a1c60f12b2475dcd4c6ce0ee43812e426016f80b62c63c053e706b2cb608012
5
5
  SHA512:
6
- metadata.gz: d64ea8c9c217bfda494404739374c492e256af5c1cc359474aca55d600e810111f44dd2cf84c3e15191bb37c05a629c66c06b8f1987371cbcc25580005aa6cfb
7
- data.tar.gz: d18518059334d25a8cf40d93e58b1c7157c08bcab8a5c61950c9d04b5da43cfa57894328d3bfeb7486f5e2ace1519c575fa55e017c07b4b5541204e43234652e
6
+ metadata.gz: a5c6424c003e72e2c699185866879070bd32b944062ce06d68055a84f232cb3dd868ca95dc922708c04676535a208871551cb77f4f0a22e154141df51a18674a
7
+ data.tar.gz: a5fb9c081d8451d0c7e1afa4b1c17fb4f6aac64298797853f55e4cdc8b8eaf7945c2218203a81982e2030267d24ee2261ed8f4bffe52c335f31f486de5bfc634
data/Rakefile CHANGED
@@ -28,8 +28,7 @@ require 'rake/testtask'
28
28
  Rake::TestTask.new(:test) do |t|
29
29
  t.libs << 'test'
30
30
  t.pattern = 'test/**/*_test.rb'
31
- t.verbose = true
32
- t.warning = false
31
+ t.verbose = false
33
32
  end
34
33
 
35
34
  task default: :test
@@ -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-Z_]+\z/, message: "alpha characters only" }
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
- before_save :normalize_email
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.build_auth_headers(@token.token, @token.client)
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 "rhino/engine"
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("../../lib", __dir__)
7
+ config.autoload_paths << File.expand_path('../../lib', __dir__)
12
8
 
13
- initializer "rhino_organizations.register_module" do
9
+ initializer 'rhino_organizations.register_module' do
14
10
  config.after_initialize do
15
- if Rhino.resources.include?("Organization")
11
+ if Rhino.resources.include?('Organization')
16
12
  Rhino.registered_modules[:rhino_organizations] = {
17
- version: RhinoOrganizations::VERSION::STRING
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 "rhino_organizations.overrides" do
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?("Organization")
27
+ if Rhino.resources.include?('Organization')
32
28
  Dir.glob("#{overrides}/**/*_override.rb").each do |override|
33
29
  load override
34
30
  end
@@ -10,7 +10,7 @@ module RhinoOrganizations
10
10
  MAJOR = 0
11
11
  MINOR = 20
12
12
  TINY = 0
13
- PRE = "alpha.0"
13
+ PRE = "beta.22"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  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.alpha.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-08-08 00:00:00.000000000 Z
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.1.0
19
+ version: 7.0.0
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 7.1.0
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.1.0
29
+ version: 7.0.0
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 7.1.0
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.alpha.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.alpha.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
- - jp@codalio.com
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: '0'
104
+ version: 1.3.1
120
105
  requirements: []
121
- rubygems_version: 3.5.11
122
- signing_key:
106
+ rubygems_version: 3.3.26
107
+ signing_key:
123
108
  specification_version: 4
124
109
  summary: ''
125
110
  test_files: []
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "users"
4
-
5
- Organization.find_or_create_by(name: "Rhino")
6
- Role.find_or_create_by(name: "admin")
7
- UsersRole.find_or_create_by(user: User.first, role: Role.find_by(name: "admin"), organization: Organization.first)