BoletoSimples / boletosimples-ruby

Biblioteca Ruby para API da Kobana
https://developers.kobana.com.br
MIT License
17 stars 4 forks source link

A gem não funciona no Rails versão 5.2 #9

Closed diegorv closed 6 years ago

diegorv commented 6 years ago

Olá,

Acabei de testar a gem de vocês em um projeto com Rails 5.2 e não está funcionando, aparentemente é um problenma relacionado ao Her, tem um PR aberto lá por isso: https://github.com/remiprev/her/pull/492, será necessário fazer um update da gem de vocês pra utilizar a versão nova do Her, quando ela sair.

Uma amostra do output:

  68) BoletoSimples::Discharge all
      Failure/Error: it { expect(subject.first).to be_a_kind_of(BoletoSimples::Discharge) }

      NoMethodError:
        undefined method `changed?' for nil:NilClass
      # ./spec/boletosimples/resources/discharge_spec.rb:15:in `block (3 levels) in <top (required)>'

  69) BoletoSimples::Transaction all
      Failure/Error: it { expect(subject.first).to be_a_kind_of(BoletoSimples::Transaction) }

      NoMethodError:
        undefined method `changed?' for nil:NilClass
      # ./spec/boletosimples/resources/transactions_spec.rb:15:in `block (3 levels) in <top (required)>'

  70) BoletoSimples::Remittance all
      Failure/Error: it { expect(subject.first).to be_a_kind_of(BoletoSimples::Remittance) }

      NoMethodError:
        undefined method `changed?' for nil:NilClass
      # ./spec/boletosimples/resources/remittance_spec.rb:15:in `block (3 levels) in <top (required)>'
eduardofiorezi commented 6 years ago

Mesmo problema aqui também:

  1) BankBillet#create error 
     Failure/Error: BoletoSimples::BankBillet.create(attributes)

     NoMethodError:
       undefined method `changed?' for nil:NilClass
     # ./app/services/bank_billet.rb:8:in `create'
     # ./spec/services/bank_billet_spec.rb:41:in `block (4 levels) in <top (required)>'
     # ./spec/services/bank_billet_spec.rb:43:in `block (4 levels) in <top (required)>'

  2) BankBillet#create error 
     Failure/Error: BoletoSimples::BankBillet.create(attributes)

     NoMethodError:
       undefined method `changed?' for nil:NilClass
     # ./app/services/bank_billet.rb:8:in `create'
     # ./spec/services/bank_billet_spec.rb:41:in `block (4 levels) in <top (required)>'
     # ./spec/services/bank_billet_spec.rb:45:in `block (4 levels) in <top (required)>'

  3) BankBillet#create success 
     Failure/Error: BoletoSimples::BankBillet.create(attributes)

     NoMethodError:
       undefined method `changed?' for nil:NilClass
     # ./app/services/bank_billet.rb:8:in `create'
     # ./spec/services/bank_billet_spec.rb:32:in `block (4 levels) in <top (required)>'
     # ./spec/services/bank_billet_spec.rb:35:in `block (4 levels) in <top (required)>'

  4) BankBillet#create success 
     Failure/Error: BoletoSimples::BankBillet.create(attributes)

     NoMethodError:
       undefined method `changed?' for nil:NilClass
     # ./app/services/bank_billet.rb:8:in `create'
     # ./spec/services/bank_billet_spec.rb:32:in `block (4 levels) in <top (required)>'
     # ./spec/services/bank_billet_spec.rb:34:in `block (4 levels) in <top (required)>'
diegorv commented 6 years ago

@eduardofiorezi Uma solução tempóraria é colocar no seu Gemfile:

gem 'her', git: 'https://github.com/zoltankiss/her', branch: 'rails5-2'

É o branch do próprio PR para corrigir o problema. Deve resolver por momento, até o her ser atualizado oficialmente para o 5.2.

eduardofiorezi commented 6 years ago

boa!! vlw @diegorv

diegorv commented 6 years ago

@kivanio @williamweckl

Fala galera, td bem?

Saiu a versão nova da gem HER com suporte para o Rails 5.2, vcs podem atualizar a gem do BoletoSimples?!

Por favor? :)

eduardofiorezi commented 6 years ago

👏 👏 https://github.com/BoletoSimples/boletosimples-ruby/commit/41dbd9ddd334db870c2791af8ca2e6ee00f5757f