simple_teams 0.1.0 → 0.1.3

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: 7f626da6c44a20f9b042cea11e321034ddaea542c5a96504017c309850d67bdb
4
- data.tar.gz: 5c8bc35a2bbd95fc017ce9e427197cc962bb7118096de9675ca8980cfec0d79c
3
+ metadata.gz: acdf88bfe936ac559c9454125c3219d9eba2e9a8d029cda43ac7d749231ac273
4
+ data.tar.gz: 5eb9a31ff2ab4a078e086c80396ad822f0baf718823de36ca3927290ea1b3a2b
5
5
  SHA512:
6
- metadata.gz: 7012cf09146fa7e7f5c2b86835baf11db9a72d26194cc1125021980aa65567d66fd56a37e7d668634a9989e3665fddad1ea773d1572f37e8a110d50cf8d8c872
7
- data.tar.gz: 4e69cb8dab76dc70b37171e043d89c877daa75d2389c2757a62e85311d6143b8df3d85a6164a232550b368bc46b95979ca625147be109d249d7f9df0e1dd0fe2
6
+ metadata.gz: d5dc54ba9215f56f8161b8b22e7e1b110f5e3a73a74be7ed3e57460dc119e38d1bc323c99e21b7ffa92413a942e05144d13892fc9693da96142b0dcbea969326
7
+ data.tar.gz: c345c9fc4fcbedbf30055ff8af61b48751badceebccfd1b36921a08b038c65757f90088fb41032226ea09e9510896e43fa2c968ef30e192decee50cb31dd9ccd
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2024 Laney Stroup
1
+ Copyright 2024 Thomas Laney Stroup
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,25 +1,14 @@
1
+ # WARNING:
2
+ This gem is a work in progress. If you like what we are doing, feel free to watch it for updates, but please do not attempt to use it in production.
3
+
1
4
  # SimpleTeams
2
- Short description and motivation.
5
+ SimpleTeams is an all-in-one solution for implementing teams quickly in a Ruby on Rails (RoR) application. It follows best practices, using the Rails Engine design pattern for easy configurability, CanCan for authorization, and polymorphic association (like ActiveStorage) to avoid dictating model names.
3
6
 
4
7
  ## Usage
5
- How to use my plugin.
8
+ Pending...
6
9
 
7
10
  ## Installation
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem "simple_teams"
12
- ```
13
-
14
- And then execute:
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install simple_teams
22
- ```
11
+ Pending...
23
12
 
24
13
  ## Contributing
25
14
  Contribution directions go here.
@@ -1,11 +1,11 @@
1
1
  module SimpleTeams
2
- class RelatedUsersController < ApplicationController
2
+ class RelatedMembersController < ApplicationController
3
3
 
4
4
  def index
5
5
  if params[:term].present?
6
6
  @members = SimpleTeams.member_class
7
7
  .joins(:team_memberships, :teams)
8
- .where("teams_teams.id" => current_user.teams.pluck(:id))
8
+ .where("simple_teams_teams.id" => current_user.teams.pluck(:id))
9
9
  .where("email ilike ?", "%#{params[:term]}%")
10
10
  .order("#{SimpleTeams.member_class.table_name}.first_name")
11
11
  .uniq
@@ -21,7 +21,7 @@ module SimpleTeams
21
21
  scope :unexpired, -> { where("? <= expires_at", Time.now) }
22
22
 
23
23
  # enums
24
- enum :role, [:member, :administrator, :owner]
24
+ enum :role, SimpleTeams.roles
25
25
  enum :status, [:initial, :accepted, :declined]
26
26
 
27
27
  def expired?
@@ -4,7 +4,7 @@ module SimpleTeams
4
4
  belongs_to :member, :class_name => SimpleTeams.member_class.to_s
5
5
  has_one :invitation, :dependent => :nullify
6
6
 
7
- enum :role, [:member, :administrator, :owner]
7
+ enum :role, SimpleTeams.roles
8
8
 
9
9
  validates_presence_of :role
10
10
 
@@ -6,6 +6,7 @@ module SimpleTeams
6
6
  mattr_accessor :member_class
7
7
  mattr_accessor :parent_controller
8
8
  mattr_accessor :layout
9
+ mattr_accessor :roles
9
10
 
10
11
  def self.member_class
11
12
  (@@member_class || "User").constantize
@@ -19,4 +20,8 @@ module SimpleTeams
19
20
  (@@layout || "simple_teams/application")
20
21
  end
21
22
 
23
+ def self.roles
24
+ (@@roles || [:member, :administrator, :owner])
25
+ end
26
+
22
27
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleTeams
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_teams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
- - Laney Stroup
7
+ - Thomas Laney Stroup
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
@@ -112,6 +112,7 @@ files:
112
112
  - app/views/simple_teams/invitations/edit.html.erb
113
113
  - app/views/simple_teams/invitations/new.html.erb
114
114
  - app/views/simple_teams/leave_teams/edit.html.erb
115
+ - app/views/simple_teams/mailer/invitation_notification.html.erb
115
116
  - app/views/simple_teams/memberships/_form.html.erb
116
117
  - app/views/simple_teams/memberships/_membership.html.erb
117
118
  - app/views/simple_teams/memberships/edit.html.erb
@@ -120,7 +121,6 @@ files:
120
121
  - app/views/simple_teams/teams/_add_member_link.html.erb
121
122
  - app/views/simple_teams/teams/_members_table.html.erb
122
123
  - app/views/simple_teams/teams/show.html.erb
123
- - app/views/simple_teams/teams_mailer/invitation_notification.html.erb
124
124
  - config/locales/simple_teams.en.yml
125
125
  - config/routes.rb
126
126
  - db/migrate/20240311052758_create_simple_teams_teams.rb
@@ -130,14 +130,14 @@ files:
130
130
  - lib/simple_teams/engine.rb
131
131
  - lib/simple_teams/version.rb
132
132
  - lib/tasks/simple_teams_tasks.rake
133
- homepage: https://github.com/laneystroup/simple_teams
133
+ homepage: https://github.com/strouptl/simple_teams
134
134
  licenses:
135
135
  - MIT
136
136
  metadata:
137
137
  allowed_push_host: https://rubygems.org
138
- homepage_uri: https://github.com/laneystroup/simple_teams
139
- source_code_uri: https://github.com/laneystroup/simple_teams
140
- changelog_uri: https://github.com/laneystroup/simple_teams/CHANGELOG.md
138
+ homepage_uri: https://github.com/strouptl/simple_teams
139
+ source_code_uri: https://github.com/strouptl/simple_teams
140
+ changelog_uri: https://github.com/strouptl/simple_teams/blob/main/CHANGELOG.md
141
141
  post_install_message:
142
142
  rdoc_options: []
143
143
  require_paths: