-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from cassiosantana/release/v0.6
release/v0.6
- Loading branch information
Showing
134 changed files
with
2,044 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18.17.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: bin/rails server -p 3000 | ||
css: bin/rails tailwindcss:watch |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
/* | ||
@layer components { | ||
.btn-primary { | ||
@apply py-2 px-4 bg-blue-200; | ||
} | ||
} | ||
*/ |
4 changes: 2 additions & 2 deletions
4
...ervices/check_digit_calculator_service.rb → ...nesses/accounts/check_digit_calculator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ly_services/existence_verifier_service.rb → ...sinesses/assemblies/existence_verifier.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/services/application_service.rb → app/businesses/business_application.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class AccountsController < ApplicationController | ||
before_action :set_account, only: %i[show edit update destroy] | ||
|
||
def index | ||
@accounts = Account.all | ||
end | ||
|
||
def show; end | ||
|
||
def new | ||
@account = Account.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@account = Account.new(account_params) | ||
|
||
if @account.save | ||
redirect_to admin_account_url(@account), notice: "Account was successfully created." | ||
else | ||
render :new, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def update | ||
if @account.update(account_params) | ||
redirect_to admin_account_url(@account), notice: "Account was successfully updated." | ||
else | ||
render :edit, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def destroy | ||
@account.destroy | ||
|
||
redirect_to admin_accounts_url, notice: "Account was successfully destroyed." | ||
end | ||
|
||
private | ||
|
||
def set_account | ||
@account = Account.find(params[:id]) | ||
end | ||
|
||
def account_params | ||
params.require(:account).permit(:supplier_id, :account_number) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class AssembliesController < ApplicationController | ||
before_action :set_assembly, only: %i[show edit update destroy] | ||
|
||
def index | ||
@q = Assembly.ransack(params[:q]) | ||
@assemblies = @q.result(distinct: true).includes(:parts) | ||
end | ||
|
||
def show; end | ||
|
||
def new | ||
@assembly = Assembly.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@assembly = Assembly.new(assembly_params) | ||
|
||
if @assembly.save | ||
redirect_to admin_assembly_url(@assembly), notice: "Assembly was successfully created." | ||
else | ||
render :new, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def update | ||
if @assembly.update(assembly_params) | ||
|
||
%i[part book].each do |attribute| | ||
@assembly.send(attribute.to_s.pluralize).clear | ||
|
||
attribute_ids = Array(params[:assembly][:"#{attribute}_ids"]).select(&:present?) | ||
@assembly.send("#{attribute}_ids=", attribute_ids) | ||
end | ||
|
||
redirect_to admin_assembly_url(@assembly), notice: "Assembly was successfully updated." | ||
else | ||
render :edit, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def destroy | ||
@assembly.destroy | ||
|
||
redirect_to admin_assemblies_url, notice: "Assembly was successfully destroyed." | ||
end | ||
|
||
private | ||
|
||
def set_assembly | ||
@assembly = Assembly.find(params[:id]) | ||
end | ||
|
||
def assembly_params | ||
params.require(:assembly).permit(:name, part_ids: [], book_ids: []) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class AuthorsController < ApplicationController | ||
before_action :set_author, only: %i[show edit update destroy] | ||
|
||
def index | ||
@authors = Author.all | ||
end | ||
|
||
def show; end | ||
|
||
def new | ||
@author = Author.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@author = Author.new(author_params) | ||
|
||
if @author.save | ||
redirect_to admin_author_url(@author), notice: "Author was successfully created." | ||
else | ||
render :new, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def update | ||
if @author.update(author_params) | ||
redirect_to admin_author_url(@author), notice: "Author was successfully updated." | ||
else | ||
render :edit, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def destroy | ||
@author.destroy | ||
|
||
redirect_to admin_authors_url, notice: "Author was successfully destroyed." | ||
end | ||
|
||
def report | ||
@author = Author.includes(:books).find(params[:id]) | ||
end | ||
|
||
private | ||
|
||
def set_author | ||
@author = Author.find(params[:id]) | ||
end | ||
|
||
def author_params | ||
params.require(:author).permit(:name, :cpf) | ||
end | ||
end | ||
end |
Oops, something went wrong.