Skip to content

Commit

Permalink
Adicionando campo de captura com o id do documento externo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Guimarães committed Apr 21, 2016
1 parent 2ccf060 commit 12e632d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions db/migrate/20160421185813_add_ide_documento_to_despesas.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIdeDocumentoToDespesas < ActiveRecord::Migration
def change
add_column :despesas, :ide_documento, :integer
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150319131731) do
ActiveRecord::Schema.define(version: 20160421185813) do

create_table "deputados", force: :cascade do |t|
t.string "nome", limit: 255
Expand Down Expand Up @@ -52,6 +52,7 @@
t.integer "num_especificacao_sub_cota", limit: 4
t.string "numero", limit: 255
t.string "url_recibo", limit: 255
t.integer "ide_documento", limit: 4
end

add_index "despesas", ["deputado_id"], name: "index_despesas_on_deputado_id", using: :btree
Expand Down
1 change: 1 addition & 0 deletions lib/camara/camara_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def self.parse_cota_parlamentar(content)
data_emissao = despesa.css('datEmissao').text

registro = {
:ide_documento => despesa.css('ideDocumento').text,
:matricula => despesa.css('nuCarteiraParlamentar').text,
:nome_parlamentar => despesa.css('txNomeParlamentar').text,
:beneficiario => despesa.css('txtFornecedor').text,
Expand Down

0 comments on commit 12e632d

Please sign in to comment.