Skip to content

Commit

Permalink
use relation instead of method
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Jul 20, 2017
1 parent 01117a1 commit 981e799
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion applications/github.moon
Expand Up @@ -113,7 +113,7 @@ class MoonrocksGithub extends lapis.Application
before: =>
import Users, LinkedModules from require "models"

accounts = @current_user\find_github_accounts!
accounts = @current_user\get_github_accounts!

modules = {}
for account in *accounts
Expand Down
2 changes: 1 addition & 1 deletion applications/user.moon
Expand Up @@ -156,7 +156,7 @@ class MoonRocksUser extends lapis.Application
GET: =>
@user = @current_user
@title = "Link GitHub - User Settings"
@github_accounts = @user\find_github_accounts!
@github_accounts = @user\get_github_accounts!
render: true
}

Expand Down
4 changes: 0 additions & 4 deletions models/users.moon
Expand Up @@ -141,10 +141,6 @@ class Users extends Model
url = url .. "&s=#{size}" if size
url

find_github_accounts: =>
import GithubAccounts from require "models"
GithubAccounts\select "where user_id = ? order by updated_at desc", @id

name_for_display: =>
@display_name or @username

Expand Down

0 comments on commit 981e799

Please sign in to comment.