chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class StocksController < ApplicationController
|
||||
before_action :set_stock, only: %i[show]
|
||||
before_action :authenticate_user!
|
||||
before_action :set_portfolio
|
||||
|
||||
def index
|
||||
@stocks = policy_scope(Stock).includes(portfolio_stocks: :portfolio)
|
||||
@portfolio = current_user.portfolio if current_user.student?
|
||||
end
|
||||
|
||||
def show
|
||||
authorize @stock
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_portfolio
|
||||
@portfolio = current_user.portfolio
|
||||
end
|
||||
|
||||
def set_stock
|
||||
@stock = Stock.find(params.expect(:id))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user