Sha256: 9d102d608af8ce11cafa8b91a8c2017fd79743dedcfcf28de10edf9e38657ae7

Contents?: true

Size: 366 Bytes

Versions: 44

Compression:

Stored size: 366 Bytes

Contents

class Application
  get '/receipts' do
    json Receipt.recent.includes(:document).as_json(
      :only => [:id, :printer, :keyword, :created_at, :printed], :methods => :document_title
    )
  end

  post '/receipts/print' do
    receipts = Receipt.where(:printed => false)
    receipts.each{|x| x.print}
    json receipts.as_json(:only => [:id, :printed])
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
smartkiosk-client-0.2.1 app/controllers/receipts.rb
smartkiosk-client-0.2 app/controllers/receipts.rb
smartkiosk-client-0.1.19 app/controllers/receipts.rb
smartkiosk-client-0.1.18 app/controllers/receipts.rb
smartkiosk-client-0.1.17 app/controllers/receipts.rb
smartkiosk-client-0.1.16 app/controllers/receipts.rb
smartkiosk-client-0.1.15 app/controllers/receipts.rb
smartkiosk-client-0.1.14 app/controllers/receipts.rb
smartkiosk-client-0.1.13 app/controllers/receipts.rb
smartkiosk-client-0.1.12 app/controllers/receipts.rb
smartkiosk-client-0.1.11 app/controllers/receipts.rb
smartkiosk-client-0.1.10 app/controllers/receipts.rb
smartkiosk-client-0.1.9 app/controllers/receipts.rb
smartkiosk-client-0.1.8 app/controllers/receipts.rb
smartkiosk-client-0.1.7 app/controllers/receipts.rb
smartkiosk-client-0.1.6 app/controllers/receipts.rb
smartkiosk-client-0.1.5 app/controllers/receipts.rb
smartkiosk-client-0.1.4 app/controllers/receipts.rb
smartkiosk-client-0.1.3 app/controllers/receipts.rb
smartkiosk-client-0.1.2 app/controllers/receipts.rb