-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: create wallet api #14
base: feature/authentication-api
Are you sure you want to change the base?
Conversation
current_user.user_wallets.each do |user_wallet| | ||
@wallets.push(user_wallet.wallet) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current_user.user_wallets.each do |user_wallet| | |
@wallets.push(user_wallet.wallet) | |
end | |
@wallets = user_wallet.wallet |
だけでいいかも
UserWallet.create( | ||
user_id: current_user.id, | ||
wallet_id: @wallet.id, | ||
user_role: User::roles[:OWNER] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_role: User::roles[:OWNER] | |
user_role: User.roles[:OWNER] |
https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/ColonMethodCall
end | ||
|
||
def find_wallet | ||
@wallet = Wallet.find_by(id: params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idの時はfindの時の方がシンプル
|
||
def show | ||
if accessible? | ||
render :show, status: :ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
省略可
|
||
private | ||
def http_token | ||
@http_token = request.headers['Authorization'].split(' ').last if request.headers['Authorization'].present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentずれてる?
ちなみに、MFではユニットテストにrspecを使ってます。 |
Requirement