Skip to content

Instantly share code, notes, and snippets.

module Spree
class Payment < ActiveRecord::Base
include Spree::Payment::Processing
IDENTIFIER_CHARS = (('A'..'Z').to_a + ('0'..'9').to_a - %w(0 1 I O)).freeze
belongs_to :order, class_name: 'Spree::Order', touch: true
belongs_to :source, polymorphic: true
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
module Spree
# This is somewhat contrary to standard REST convention since there is not
# actually a Checkout object. There's enough distinct logic specific to
# checkout which has nothing to do with updating an order that this approach
# is waranted.
class CheckoutController < Spree::StoreController
ssl_required
before_filter :load_order_with_lock
@miriamdeana
miriamdeana / on refresh
Last active August 29, 2015 14:01
$ heroku logs
2014-05-21T16:35:47.381847+00:00 app[web.1]:
2014-05-21T16:35:47.381848+00:00 app[web.1]:
2014-05-21T16:35:47.381853+00:00 app[web.1]: ^
2014-05-21T16:35:47.381855+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2014-05-21T16:35:47.381856+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2014-05-21T16:35:47.381869+00:00 app[web.1]: vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `exec_no_cache'
2014-05-21T16:35:47.381871+00:00 app[web.1]: vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:138:in `block in exec_query'
2014-05-21T16:35:47.381873+00:00 app[web.1]: vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
2014-05-21T16:35:47.381863+00:00 app[
@miriamdeana
miriamdeana / spree.rb
Created May 19, 2014 13:56
Spree mail method settings
Spree.config do |config|
# Example:
# Uncomment to override the default site name.
config.site_name = "Delta Museum"
config.layout = "layouts/application"
config.override_actionmailer_config = true
config.enable_mail_delivery = true
config.mails_from = "[email protected]"
config.mail_bcc = '[email protected]'
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.timestamps
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token