Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
Tested in [Samba](https://github.com/grottopress/samba):

```
Showing last frame. Use --error-trace for full trace.

There was a problem expanding macro 'included'

Code in macro 'included'

 20 | include Shield::NotifyOauthAccessTokenIfSet
      ^
Called macro defined in lib/shield/src/shield/operations/mixins/notify_oauth_access_token_if_set.cr:2:3

 2 | macro included

Which expanded to:

 > 5 |       bearer_login = BearerLoginQuery.preload_oauth_client(bearer_login)
 > 6 |
 > 7 |       return unless bearer_login.user.settings.oauth_access_token_notify?
                                                      ^-------------------------
Error: undefined method 'oauth_access_token_notify?' for UserSettings
```
  • Loading branch information
akadusei committed Aug 23, 2024
1 parent b4cd9ef commit 528f053
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shield/models/user_settings.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ module Shield::UserSettings
macro included
include Lucille::JSON

{% if Lucille::JSON.includers.find(&.name.== :BearerLogin.id) %}
{% if Avram::Model.all_subclasses.find(&.name.== :BearerLogin.id) %}
include Shield::BearerLoginUserSettings
{% end %}

{% if Lucille::JSON.includers.find(&.name.== :Login.id) %}
{% if Avram::Model.all_subclasses.find(&.name.== :Login.id) %}
include Shield::LoginUserSettings
{% end %}

{% if Lucille::JSON.includers.find(&.name.== :OauthClient.id) %}
{% if Avram::Model.all_subclasses.find(&.name.== :OauthClient.id) %}
include Shield::OauthClientUserSettings
{% end %}

Expand Down

0 comments on commit 528f053

Please sign in to comment.