Sha256: a51f088218461caf8efca845002989bb5cef2be418722ac946c0ff8af66dba11

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

module Rack
  class InAppPurchase  
    class Receipt < Sequel::Model
      plugin :json_serializer, naked: true, except: :id 
      plugin :validation_helpers
      plugin :timestamps, force: true
      
      self.dataset = :in_app_purchase_receipts
      self.strict_param_setting = false
      self.raise_on_save_failure = false

      def validate
        super
      
        validates_presence [:product_id, :transaction_id, :purchase_date]
        validates_unique :transaction_id
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-in-app-purchase-0.1.1 ./lib/rack/in-app-purchase/models/receipt.rb
rack-in-app-purchase-0.1.0 ./lib/rack/in-app-purchase/models/receipt.rb