-
Notifications
You must be signed in to change notification settings - Fork 5
Ticket_id #52283 - Alinhamento com o Fork da Hotsoft #3
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
base: master
Are you sure you want to change the base?
Conversation
|
Obrigado pelo pull request. Eu vou comentar lá, mas para registro vou comentar o mesmo por aqui também. Para que os commits fiquem mais limpos, por favor evite deixar o código anterior comentado, como aqui por exemplo: 2bd352f Outro exemplo de "limpeza" seria neste commit: 64afab2 Aqui o arquivo ac_filters_utils.rb tem código anterior comentado, referência ao ticket resolvido no comentário do fonte e ainda uma alteração que não tem relação com o que o commit resolve. Como boa prática os commits devem fazer somente o que se propõe e também o que foi alterado deve ser alterado e não comentado. Peço por favor que ajuste o pull request neste sentido e reenvie para eu analisar. |
…. Removido Ticket removido do fonte.
| @data_end | ||
| end | ||
|
|
||
| def new_page(print_titles = true) |
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.
Trouxe manualmente dos commits do nosso form.
Evita problemas com alguns relatórios.
| class Listing < Report | ||
|
|
||
| #alias :super_new_page :new_page | ||
| alias :super_new_page :new_page |
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.
Supre uso do super_new_page em alguns relatórios.
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.
Não entendi o objetivo desta alteração.
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.
Segue o Ticket: http://192.168.200.44:3000/issues/22060
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.
É utilizado em alguns de nossos relatórios.
Alteração realizada para evitar problema com os relatórios que utilizam este alias.
Conforme o Ticket citado acima.
| s.email = %q{ricardo@acras.com.br julianoch@gmail.com egon@acras.com.br viniciuscb@gmail.com} | ||
| s.version = "1.9.21" | ||
| s.date = %q{2016-11-23} | ||
| s.authors = ["Ricardo Acras", "Egon Hilgenstieler", "Juliano Andrade", "Vinicius Cubas Brand", "Wellington Torrejais da Silva"] |
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.
Array de emails não estava separado por ","
Agora segue conforme a documentação.
| if !value.nil? && value != '' | ||
| if (formatter == :currency) | ||
| value = value.round(2) | ||
| value = value.round(2) rescue sprintf('%.2f', value).to_f |
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.
Gera problema com versões do framework mais antigas como no nossa caso.
Um simples rescue resolve o problema mantendo compatibilidade com Ruby antigo.
| def run_totals(data_row) | ||
| @running_totals.each do |rt| | ||
| vl = get_raw_field_value(data_row, rt) | ||
| vl = (vl.is_a? (String) ? vl.to_f : vl) |
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.
Gerava problemas com alguns tipos de dados do Mysql.
De acordo com a query e o tipo retornado.
Este ajuste evitou muitos problemas com médias e suas totalizações.
| sql_to_execute = ActiveRecord::Base.send(:sanitize_sql_array, conditions) | ||
| r = [] | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(:as => :hash) {|i| r << i} | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(as :hash) {|i| r << i} |
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.
Alteração sem relação direta com o commit portada do nosso fork.
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.
O que faz esta alteração?
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.
Só troca de sintaxe mesmo. Posso remover esta alteração.
Trouxe dos commits legados.
| value.nil? ? {} : Marshal.load(value) | ||
| begin | ||
| value.nil? ? {} : Marshal.load(value) | ||
| rescue TypeError |
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.
Tratamento em relação a nulidade do valor
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.
Aqui você está abafando uma exceção. Isto não é uma boa prática pois apesar de resolver algum caso específico que você precisou resolver poderá abafar exceções que deveriam aparecer para o programador. Isto pode atrapalhar em debugs.
Poderia alterar e somente abafar nos casos em que necessita?
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.
O commit original somente descreve: tratamento de valor nulo.
Se desejar posso remover esta alteração e testar um por um dos relatórios.
No na época(2013) não foi documentado não sei se a alteração
pode tratar situação específicas ou influenciadas pela combinação de filtros.
Se eu remover apesar dos testes locais ainda haverá a possibilidade do erro ocorrer no cliente. Neste caso seria interessante manter esta alteração?
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.
Como boa prática peço que remova a alteração. Se for necessário de fato o ideal é criar em seu projeto uma subclasse desta classe que faça isto e a use somente no seu projeto. Como se trata de uma biblioteca usada em vários projetos não temos como aceitar esta mudança na classe comum.
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.
Hum. Entendi.
Neste caso irei refatorar e em breve subo as alterações.
No entanto devido a rotina interna irei alinhar um prazo.
Não conseguirei fazer neste momento.
Portanto o pull request vai demorar um tempo para ser realizado novamente.
| def self.up | ||
| add_column :report_templates, :excluir, :boolean | ||
| 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.
Migration relativa a coluna que agora controla a exclusão.
| f = AcFilterDef.find_by_name(params.delete("filter_name")) | ||
| if f | ||
| params["ac_filter_def_id"] = f.id | ||
| r = ReportTemplate.find_by_name(params["name"]) |
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.
Ajustes para o novo comportamento relativo a "exclusão".
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.
Favor detalhar esta lógica de exclusão. O que ela resolve? Por que foi implementada?
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.
Alterado para atualizar ao invés de excluir. Para não perder relação entre os relatórios e os laboratórios. Só exibir relatórios para laboratórios específicos.
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.
Como se trata de uma implementação específica para o seu projeto peço que realize em classes fora do contexto da biblioteca, no seu projeto por exemplo. Ou então que insira este comportamento porém de forma configurável e mantendo o padrão como era anteriormente.
|
Bom dia @acras, realizado além da limpeza alguns comentários adicionais. Em novas alterações farei com Pull requests mais frequentes com No entanto creio que agora este pull request esteja passível de ser aplicado. |
acras
left a comment
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.
Obrigado pela evolução Wellington, favor revisar os pontos que levantei e postar novamete.
| value.nil? ? {} : Marshal.load(value) | ||
| begin | ||
| value.nil? ? {} : Marshal.load(value) | ||
| rescue TypeError |
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.
Aqui você está abafando uma exceção. Isto não é uma boa prática pois apesar de resolver algum caso específico que você precisou resolver poderá abafar exceções que deveriam aparecer para o programador. Isto pode atrapalhar em debugs.
Poderia alterar e somente abafar nos casos em que necessita?
| sql_to_execute = ActiveRecord::Base.send(:sanitize_sql_array, conditions) | ||
| r = [] | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(:as => :hash) {|i| r << i} | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(as :hash) {|i| r << i} |
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.
O que faz esta alteração?
| f = AcFilterDef.find_by_name(params.delete("filter_name")) | ||
| if f | ||
| params["ac_filter_def_id"] = f.id | ||
| r = ReportTemplate.find_by_name(params["name"]) |
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.
Favor detalhar esta lógica de exclusão. O que ela resolve? Por que foi implementada?
| class Listing < Report | ||
|
|
||
| #alias :super_new_page :new_page | ||
| alias :super_new_page :new_page |
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.
Não entendi o objetivo desta alteração.
|
Boa tarde Wellington, acabo de enviar para você solicitações de alteração e
mais informações.
Aguardo novo pull request.
…--
Ricardo Acras
ricardo@acras.com.br
www.focuslojas.com.br
www.focusnfe.com.br
2016-11-24 10:59 GMT-02:00 Hotsoft_desenv2 <notifications@github.com>:
Bom dia @acras <https://github.com/acras>,
realizado além da limpeza alguns comentários adicionais.
Portei manualmente conforme nosso fork local.
(Ajustes realizados no passado)
Em novas alterações farei com Pull requests mais frequentes com
comentários mais concisos e sem alterações não relacionadas ao comentário.
(Mantive os comentários originais do nosso Fork).
No entanto creio que agora este pull request esteja passível de ser
aplicado.
Aguardo sua nova revisão.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAt0EYha9TsUl3aMroG6SdvpuWJjpbw5ks5rBYpJgaJpZM4K69yQ>
.
|
hotsoft-desenv2
left a comment
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.
Realizei novos comentários. Favor validar.
| class Listing < Report | ||
|
|
||
| #alias :super_new_page :new_page | ||
| alias :super_new_page :new_page |
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.
Segue o Ticket: http://192.168.200.44:3000/issues/22060
| f = AcFilterDef.find_by_name(params.delete("filter_name")) | ||
| if f | ||
| params["ac_filter_def_id"] = f.id | ||
| r = ReportTemplate.find_by_name(params["name"]) |
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.
Alterado para atualizar ao invés de excluir. Para não perder relação entre os relatórios e os laboratórios. Só exibir relatórios para laboratórios específicos.
| sql_to_execute = ActiveRecord::Base.send(:sanitize_sql_array, conditions) | ||
| r = [] | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(:as => :hash) {|i| r << i} | ||
| ActiveRecord::Base.connection.instance_exec(sql_to_execute).each(as :hash) {|i| r << i} |
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.
Só troca de sintaxe mesmo. Posso remover esta alteração.
Trouxe dos commits legados.
| class Listing < Report | ||
|
|
||
| #alias :super_new_page :new_page | ||
| alias :super_new_page :new_page |
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.
É utilizado em alguns de nossos relatórios.
Alteração realizada para evitar problema com os relatórios que utilizam este alias.
Conforme o Ticket citado acima.
| value.nil? ? {} : Marshal.load(value) | ||
| begin | ||
| value.nil? ? {} : Marshal.load(value) | ||
| rescue TypeError |
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.
O commit original somente descreve: tratamento de valor nulo.
Se desejar posso remover esta alteração e testar um por um dos relatórios.
No na época(2013) não foi documentado não sei se a alteração
pode tratar situação específicas ou influenciadas pela combinação de filtros.
Se eu remover apesar dos testes locais ainda haverá a possibilidade do erro ocorrer no cliente. Neste caso seria interessante manter esta alteração?
|
Bom dia @acras, acabo de enviar novos comentários complementando as informações anteriores. Obrigado. |
|
Enviados mais comentários... |
Se possível aceitem este pull request relativo ao alinhamento com o Fork da Hotsoft.