teamable 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef4a40776f50d3acd1148b325ed1be22771bc4d0a0b887dc19922f6919872a4
|
4
|
+
data.tar.gz: 3835d42ce487b9987189fc89d9a50a61d37d6045f7a72002773943052ae0e082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c0dd8dd693dc1ad3dd7b27a6376889e3c5e669cf35c54e64002db51862a0f3f179c023c67f09654076073605d24b9ba9a4729bb592759c5dc929b038aae80c2
|
7
|
+
data.tar.gz: 2ba7c15ec33d622960056bf4976c427b48b66f0ffa21c6330139cf9fc37e43e608b52430719679434cf1dc2a049725ae237ba44e47a0d1044550bc805885dcd4
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ When building your customized account switcher, redirect your user to `switch_ac
|
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
current_user.accounts.each do |account|
|
37
|
-
|
37
|
+
button_to account.name, switch_account_path(account), method: :patch
|
38
38
|
end
|
39
39
|
```
|
40
40
|
|
@@ -44,7 +44,7 @@ Installation
|
|
44
44
|
Add the following line to Gemfile:
|
45
45
|
|
46
46
|
```ruby
|
47
|
-
gem "teamable",
|
47
|
+
gem "teamable", "~> 0.2.0"
|
48
48
|
```
|
49
49
|
|
50
50
|
and run `bundle install` from your terminal to install it.
|
@@ -122,7 +122,7 @@ should) specify a dependency on this gem using the [Pessimistic Version
|
|
122
122
|
Constraint](http://guides.rubygems.org/patterns/#pessimistic-version-constraint) with two digits of precision. For example:
|
123
123
|
|
124
124
|
```ruby
|
125
|
-
gem "teamable", "~>
|
125
|
+
gem "teamable", "~> 0.2.0"
|
126
126
|
```
|
127
127
|
|
128
128
|
License
|
@@ -43,9 +43,7 @@ module Teamable
|
|
43
43
|
# Load current account from Account model and store it
|
44
44
|
# in the Teamable::Current singleton.
|
45
45
|
def load_current_account
|
46
|
-
|
47
|
-
|
48
|
-
Teamable::Current.account ||= account_from_params || current_user.personal_account || nil
|
46
|
+
Teamable::Current.account ||= account_from_params || account_from_personal_account || nil
|
49
47
|
end
|
50
48
|
|
51
49
|
# Try to load current account using session[:teamable_account_id]
|
@@ -55,12 +53,11 @@ module Teamable
|
|
55
53
|
current_user.accounts.find_puid(params[:account_id])
|
56
54
|
end
|
57
55
|
|
58
|
-
#
|
59
|
-
def
|
60
|
-
|
61
|
-
return nil if memberships.empty?
|
56
|
+
# Try to load current account using current_user.personal_account
|
57
|
+
def account_from_personal_account
|
58
|
+
return unless defined?(current_user) && !current_user.nil?
|
62
59
|
|
63
|
-
|
60
|
+
current_user&.personal_account
|
64
61
|
end
|
65
62
|
|
66
63
|
# Check if the current controller is a TeamableController
|
data/lib/teamable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rasmus Kjellberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-03-
|
12
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-configurable
|