From 0130ed2a38d2dafe412dabf1d9eef72aa4240019 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 16:57:21 -0300 Subject: [PATCH 01/13] feat(Asset): create model --- app/models/asset.rb | 9 +++++++++ app/models/stock.rb | 2 ++ app/models/user.rb | 3 +++ config/locales/activerecord/pt-BR.yml | 11 +++++++++++ db/migrate/20230124172554_create_assets.rb | 14 ++++++++++++++ db/schema.rb | 17 ++++++++++++++++- 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 app/models/asset.rb create mode 100644 db/migrate/20230124172554_create_assets.rb diff --git a/app/models/asset.rb b/app/models/asset.rb new file mode 100644 index 0000000..cecff00 --- /dev/null +++ b/app/models/asset.rb @@ -0,0 +1,9 @@ +class Asset < ApplicationRecord + belongs_to :user + belongs_to :stock + + validates :stock, :user, :amount, :average_price, :total_invested, presence: true + validates :stock_id, uniqueness: { scope: [:user_id] } + + validates :average_price, :amount, :total_invested, numericality: { greater_than_or_equal_to: 0 } +end diff --git a/app/models/stock.rb b/app/models/stock.rb index 2284511..c51aa08 100644 --- a/app/models/stock.rb +++ b/app/models/stock.rb @@ -1,4 +1,6 @@ class Stock < ApplicationRecord + has_many :assets, dependent: :restrict_with_error + validates :code, presence: true validates :code, length: { in: 5..6 } end diff --git a/app/models/user.rb b/app/models/user.rb index b8c46e8..05650ea 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,6 +4,9 @@ class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable + has_many :assets, dependent: :delete_all + has_many :stocks, through: :assets + validates :email, :password, :password_confirmation, presence: true def name diff --git a/config/locales/activerecord/pt-BR.yml b/config/locales/activerecord/pt-BR.yml index 6dae134..dabb953 100644 --- a/config/locales/activerecord/pt-BR.yml +++ b/config/locales/activerecord/pt-BR.yml @@ -1,9 +1,20 @@ pt-BR: activerecord: + models: + asset: 'Ativo' + stock: 'Ação' + user: 'Usuário' attributes: stock: code: 'Código' name: 'Nome' + asset: + amount: 'Quant.' + average_price: 'P. médio' + total_invested: 'T. invest.' + user: 'Usuário' + stock: 'Ação' + stock_code: 'Código' errors: messages: record_invalid: 'A validação falhou: %{errors}' diff --git a/db/migrate/20230124172554_create_assets.rb b/db/migrate/20230124172554_create_assets.rb new file mode 100644 index 0000000..8433759 --- /dev/null +++ b/db/migrate/20230124172554_create_assets.rb @@ -0,0 +1,14 @@ +class CreateAssets < ActiveRecord::Migration[7.0] + def change + create_table :assets, id: :uuid, bulk: true do |t| + t.integer :amount, default: 0 + t.float :average_price, default: 0 + t.float :total_invested, default: 0 + t.references :user, null: false, foreign_key: true, type: :uuid + t.references :stock, null: false, foreign_key: true, type: :uuid + t.index [:stock_id, :user_id], unique: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index f960a5b..a27481d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,24 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_01_23_182924) do +ActiveRecord::Schema[7.0].define(version: 2023_01_24_172554) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" + create_table "assets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.integer "amount", default: 0 + t.float "average_price", default: 0.0 + t.float "total_invested", default: 0.0 + t.uuid "user_id", null: false + t.uuid "stock_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["stock_id", "user_id"], name: "index_assets_on_stock_id_and_user_id", unique: true + t.index ["stock_id"], name: "index_assets_on_stock_id" + t.index ["user_id"], name: "index_assets_on_user_id" + end + create_table "stocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "code" @@ -34,4 +47,6 @@ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end + add_foreign_key "assets", "stocks" + add_foreign_key "assets", "users" end From 41d5c859edbdec07da8676b0163a7b80dfa63605 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 16:58:03 -0300 Subject: [PATCH 02/13] feat(Asset): create model --- spec/factories/assets.rb | 9 +++++++++ spec/models/asset_spec.rb | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 spec/factories/assets.rb create mode 100644 spec/models/asset_spec.rb diff --git a/spec/factories/assets.rb b/spec/factories/assets.rb new file mode 100644 index 0000000..ffa3d21 --- /dev/null +++ b/spec/factories/assets.rb @@ -0,0 +1,9 @@ +FactoryBot.define do + factory :asset do + amount { 1 } + average_price { 1.5 } + total_invested { 1.5 } + user { create(:user) } + stock { create(:stock) } + end +end diff --git a/spec/models/asset_spec.rb b/spec/models/asset_spec.rb new file mode 100644 index 0000000..8376a7a --- /dev/null +++ b/spec/models/asset_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe Asset, type: :model do + describe 'validates' do + context 'presence' do + it { should validate_presence_of(:average_price) } + it { should validate_presence_of(:total_invested) } + it { should validate_presence_of(:amount) } + it { should validate_presence_of(:user) } + it { should validate_presence_of(:stock) } + end + + context 'validate numericality' do + it { should validate_numericality_of(:average_price).is_greater_than_or_equal_to(0) } + it { should validate_numericality_of(:amount).is_greater_than_or_equal_to(0) } + it { should validate_numericality_of(:total_invested).is_greater_than_or_equal_to(0) } + end + end +end From 434efe8fe09948852ee9668a3920b97ca7c76293 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 16:59:46 -0300 Subject: [PATCH 03/13] style: create component card --- app/assets/stylesheets/components/_cards.scss | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/assets/stylesheets/components/_cards.scss diff --git a/app/assets/stylesheets/components/_cards.scss b/app/assets/stylesheets/components/_cards.scss new file mode 100644 index 0000000..0f9902a --- /dev/null +++ b/app/assets/stylesheets/components/_cards.scss @@ -0,0 +1,19 @@ +.cards { + display: flex; + justify-content: start; + align-items: center; + gap: var(--space-m); + flex-wrap: wrap; + -ms-flex-wrap: wrap; + + .card { + background-color: var(--color-white); + border-radius: var(--border-radius); + box-shadow: var(--shadow-large); + padding: var(--space-xs); + + @include media(tabletAndUp) { + padding: var(--space-l); + } + } +} From 588156882d2379e540bf9a5f86675d17e068ceb0 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 17:00:04 -0300 Subject: [PATCH 04/13] style: create component page_title --- app/assets/stylesheets/components/_page_title.scss | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 app/assets/stylesheets/components/_page_title.scss diff --git a/app/assets/stylesheets/components/_page_title.scss b/app/assets/stylesheets/components/_page_title.scss new file mode 100644 index 0000000..a62f29a --- /dev/null +++ b/app/assets/stylesheets/components/_page_title.scss @@ -0,0 +1,4 @@ +.page-title { + display: flex; + margin-bottom: var(--space-l); +} From e061ed3e33fbd427b73a0eee05ede74c66aab591 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 17:00:27 -0300 Subject: [PATCH 05/13] style: import components created --- app/assets/stylesheets/application.sass.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss index b4f5c78..4001285 100644 --- a/app/assets/stylesheets/application.sass.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -10,9 +10,11 @@ // Components @import "components/btn"; +@import "components/cards"; @import "components/error_message"; @import "components/form"; @import "components/navbar"; +@import "components/page_title"; @import "components/stock"; @import "components/turbo_progress_bar"; @import "components/visually_hidden"; From ba8a31aeb0685aa9e01fca939c4a2b963f4beab3 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 17:00:48 -0300 Subject: [PATCH 06/13] feat(Asset): create controller :index --- app/controllers/assets_controller.rb | 5 +++++ app/views/assets/index.html.erb | 16 ++++++++++++++++ config/routes.rb | 10 +++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 app/controllers/assets_controller.rb create mode 100644 app/views/assets/index.html.erb diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb new file mode 100644 index 0000000..fe1908e --- /dev/null +++ b/app/controllers/assets_controller.rb @@ -0,0 +1,5 @@ +class AssetsController < ApplicationController + def index + @assets = current_user.assets + end +end diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb new file mode 100644 index 0000000..9d2bd5c --- /dev/null +++ b/app/views/assets/index.html.erb @@ -0,0 +1,16 @@ +
+
+

<%= t(:asset, scope: 'activerecord.models').pluralize %>

+
+ +
+ <% @assets.each do |asset|%> +
+

<%= Asset.human_attribute_name('stock_code') %>: <%= asset.stock.code %>

+

<%= Asset.human_attribute_name('amount') %>: <%= asset.amount %>

+

<%= Asset.human_attribute_name('average_price') %>: <%= number_to_currency asset.average_price %>

+

<%= Asset.human_attribute_name('total_invested') %>: <%= number_to_currency asset.total_invested %>

+
+ <% end %> +
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 4e7b72c..9fce380 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,14 @@ Rails.application.routes.draw do - root to: 'home#index' + unauthenticated :user do + root to: 'home#index', as: :unauthenticated_user_root + end + + authenticated :user do + root to: 'assets#index', as: :authenticated_user_root + end get 'home', to: 'home#index' devise_for :users + + resources :assets, only: :index end From 581df499b5e028d42e66728cbfbb7178a1fc3599 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Tue, 24 Jan 2023 17:01:05 -0300 Subject: [PATCH 07/13] chore(Locale): add more translate --- config/locales/pt-BR.yml | 107 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index e277d17..23619fb 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,3 +1,110 @@ pt-BR: name_app: 'Minha carteira' hello: 'Olá' + + helpers: + select: + prompt: Por favor selecione + submit: + create: Criar %{model} + submit: Salvar %{model} + update: Atualizar %{model} + + number: + currency: + format: + delimiter: "." + format: "%u %n" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: R$ + format: + delimiter: "." + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: + one: bilhão + other: bilhões + million: + one: milhão + other: milhões + quadrillion: + one: quatrilhão + other: quatrilhões + thousand: mil + trillion: + one: trilhão + other: trilhões + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + eb: EB + gb: GB + kb: KB + mb: MB + pb: PB + tb: TB + percentage: + format: + delimiter: "." + format: "%n%" + precision: + format: + delimiter: + + errors: + format: "%{attribute} %{message}" + messages: + accepted: deve ser aceito + access_denied: Acesso Negado + blank: não pode ficar em branco + confirmation: não é igual a %{attribute} + empty: não pode ficar vazio + equal_to: deve ser igual a %{count} + even: deve ser par + exclusion: não está disponível + greater_than: deve ser maior que %{count} + greater_than_or_equal_to: deve ser maior ou igual a %{count} + inclusion: não está incluído na lista + invalid: não é válido + less_than: deve ser menor que %{count} + less_than_or_equal_to: deve ser menor ou igual a %{count} + model_invalid: 'A validação falhou: %{errors}' + not_a_number: não é um número + not_an_integer: não é um número inteiro + odd: deve ser ímpar + other_than: deve ser diferente de %{count} + present: deve ficar em branco + required: é obrigatório(a) + taken: já está em uso + too_long: + one: 'é muito longo (máximo: 1 caracter)' + other: 'é muito longo (máximo: %{count} caracteres)' + too_short: + one: 'é muito curto (mínimo: 1 caracter)' + other: 'é muito curto (mínimo: %{count} caracteres)' + wrong_length: + one: não possui o tamanho esperado (1 caracter) + other: não possui o tamanho esperado (%{count} caracteres) + template: + body: 'Por favor, verifique o(s) seguinte(s) campo(s):' + header: + one: 'Não foi possível gravar %{model}: 1 erro' + other: 'Não foi possível gravar %{model}: %{count} erros' From 8af47d7482aa38a7d03c463b3530e2fe92959b27 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 08:12:19 -0300 Subject: [PATCH 08/13] refactor: add empty line --- app/views/assets/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index 9d2bd5c..2021131 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb @@ -13,4 +13,4 @@ <% end %> - \ No newline at end of file + From f1c20cc9602ef7e113ab2d2e5bb6c8f6b73f7d06 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 08:42:14 -0300 Subject: [PATCH 09/13] setup(Rspec): configure devise to tests --- spec/support/devise.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 spec/support/devise.rb diff --git a/spec/support/devise.rb b/spec/support/devise.rb new file mode 100644 index 0000000..275276e --- /dev/null +++ b/spec/support/devise.rb @@ -0,0 +1,7 @@ +require 'devise' + +RSpec.configure do |config| + config.include Devise::Test::IntegrationHelpers, type: :request + + config.infer_spec_type_from_file_location! +end From 9b41d621debbb732de1b8782621520053f1f0ddf Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 08:42:39 -0300 Subject: [PATCH 10/13] chore(routes): change pathname the routes --- config/locales/en.yml | 34 +++------------------------------- config/locales/pt-BR.yml | 4 ++++ config/routes.rb | 2 +- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8ca56fc..d236b15 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,33 +1,5 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t "hello" -# -# In views, this is aliased to just `t`: -# -# <%= t("hello") %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# "true": "foo" -# -# To learn more, please read the Rails Internationalization guide -# available at https://guides.rubyonrails.org/i18n.html. - en: hello: "Hello world" + + routes: + assets: 'my-assets' diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 23619fb..3dca0c8 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -2,6 +2,10 @@ pt-BR: name_app: 'Minha carteira' hello: 'Olá' + routes: + assets: 'ativos' + users: 'users' + helpers: select: prompt: Por favor selecione diff --git a/config/routes.rb b/config/routes.rb index 9fce380..2f0b7ac 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,5 +10,5 @@ get 'home', to: 'home#index' devise_for :users - resources :assets, only: :index + resources :assets, only: :index, path: I18n.t('routes.assets') end From 813c3f34eda1bb0fd171b3c85c4d851806590b77 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 08:43:16 -0300 Subject: [PATCH 11/13] test(users): create controller index --- spec/requests/asset_spec.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 spec/requests/asset_spec.rb diff --git a/spec/requests/asset_spec.rb b/spec/requests/asset_spec.rb new file mode 100644 index 0000000..e11f49f --- /dev/null +++ b/spec/requests/asset_spec.rb @@ -0,0 +1,26 @@ +require 'rails_helper' + +RSpec.describe 'Asset', type: :request do + describe 'GET /index' do + context 'when user is logged' do + before :each do + user = create(:user) + create_list(:asset, 3, user:) + + sign_in(user) + end + + it 'returns http success' do + get assets_path + expect(response).to have_http_status(:success) + end + end + + context 'when not logged' do + it 'returns http success' do + get assets_path + expect(response).to have_http_status(:redirect) + end + end + end +end From f30253fd330148158c1b3d1c9fd4c242f12417dd Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 08:52:56 -0300 Subject: [PATCH 12/13] refactor: rubocop works --- config/locales/pt-BR.yml | 108 +++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 3dca0c8..04e0f95 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -8,45 +8,45 @@ pt-BR: helpers: select: - prompt: Por favor selecione + prompt: 'Por favor selecione' submit: - create: Criar %{model} - submit: Salvar %{model} - update: Atualizar %{model} + create: 'Criar %{model}' + submit: 'Salvar %{model}' + update: 'Atualizar %{model}' number: currency: format: - delimiter: "." - format: "%u %n" + delimiter: '.' + format: '%u %n' precision: 2 - separator: "," + separator: ',' significant: false strip_insignificant_zeros: false unit: R$ format: - delimiter: "." + delimiter: '.' precision: 3 - separator: "," + separator: ',' significant: false strip_insignificant_zeros: false human: decimal_units: - format: "%n %u" + format: '%n %u' units: billion: - one: bilhão - other: bilhões + one: 'bilhão' + other: 'bilhões' million: - one: milhão - other: milhões + one: 'milhão' + other: 'milhões' quadrillion: - one: quatrilhão - other: quatrilhões - thousand: mil + one: 'quatrilhão' + other: 'quatrilhões' + thousand: 'mil' trillion: - one: trilhão - other: trilhões + one: 'trilhão' + other: 'trilhões' unit: '' format: delimiter: '' @@ -54,50 +54,50 @@ pt-BR: significant: true strip_insignificant_zeros: true storage_units: - format: "%n %u" + format: '%n %u' units: byte: - one: Byte - other: Bytes - eb: EB - gb: GB - kb: KB - mb: MB - pb: PB - tb: TB + one: 'Byte' + other: 'Bytes' + eb: 'EB' + gb: 'GB' + kb: 'KB' + mb: 'MB' + pb: 'PB' + tb: 'TB' percentage: format: - delimiter: "." - format: "%n%" + delimiter: '.' + format: '%n%' precision: format: delimiter: errors: - format: "%{attribute} %{message}" + format: '%{attribute} %{message}' messages: - accepted: deve ser aceito - access_denied: Acesso Negado - blank: não pode ficar em branco - confirmation: não é igual a %{attribute} - empty: não pode ficar vazio - equal_to: deve ser igual a %{count} - even: deve ser par - exclusion: não está disponível - greater_than: deve ser maior que %{count} - greater_than_or_equal_to: deve ser maior ou igual a %{count} - inclusion: não está incluído na lista - invalid: não é válido - less_than: deve ser menor que %{count} - less_than_or_equal_to: deve ser menor ou igual a %{count} + accepted: 'deve ser aceito' + access_denied: 'Acesso Negado' + blank: 'não pode ficar em branco' + confirmation: 'não é igual a %{attribute}' + empty: 'não pode ficar vazio' + equal_to: 'deve ser igual a %{count}' + even: 'deve ser par' + exclusion: 'não está disponível' + greater_than: 'deve ser maior que %{count}' + greater_than_or_equal_to: 'deve ser maior ou igual a %{count}' + inclusion: 'não está incluído na lista' + invalid: 'não é válido' + less_than: 'deve ser menor que %{count}' + less_than_or_equal_to: 'deve ser menor ou igual a %{count}' model_invalid: 'A validação falhou: %{errors}' - not_a_number: não é um número - not_an_integer: não é um número inteiro - odd: deve ser ímpar - other_than: deve ser diferente de %{count} - present: deve ficar em branco - required: é obrigatório(a) - taken: já está em uso + not_a_number: 'não é um número' + not_an_integer: 'não é um número inteiro' + odd: 'deve ser ímpar' + other_than: 'deve ser diferente de %{count}' + present: 'deve ficar em branco' + required: 'é obrigatório(a)' + taken: 'já está em uso' too_long: one: 'é muito longo (máximo: 1 caracter)' other: 'é muito longo (máximo: %{count} caracteres)' @@ -105,8 +105,8 @@ pt-BR: one: 'é muito curto (mínimo: 1 caracter)' other: 'é muito curto (mínimo: %{count} caracteres)' wrong_length: - one: não possui o tamanho esperado (1 caracter) - other: não possui o tamanho esperado (%{count} caracteres) + one: 'não possui o tamanho esperado (1 caracter)' + other: 'não possui o tamanho esperado (%{count} caracteres)' template: body: 'Por favor, verifique o(s) seguinte(s) campo(s):' header: From 6e2b3601abce023c0356145ae58841dd18b1c250 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 25 Jan 2023 09:03:55 -0300 Subject: [PATCH 13/13] chore(locale): remove messages errors to stock --- config/locales/activerecord/pt-BR.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/config/locales/activerecord/pt-BR.yml b/config/locales/activerecord/pt-BR.yml index dabb953..0433838 100644 --- a/config/locales/activerecord/pt-BR.yml +++ b/config/locales/activerecord/pt-BR.yml @@ -21,10 +21,3 @@ pt-BR: restrict_dependent_destroy: has_one: 'Não é possível excluir o registro pois existe um %{record} dependente' has_many: 'Não é possível excluir o registro pois existem %{record} dependentes' - models: - stock: - attributes: - code: - too_short: 'tamanho pequeno' - too_long: 'tamanho grande' - blank: 'é obrigatório'