This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/image_decorator.rb | |
Image.class_eval do | |
has_attached_file( | |
:attachment, | |
:storage => :s3, | |
:bucket => ENV['S3_BUCKET'] | |
:s3_credentials => { | |
:access_key_id => ENV['S3_KEY'], | |
:secret_access_key => ENV['S3_SECRET'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# app/views/order_mailer/confirm.html.erb %> | |
<html> | |
<head> | |
<style type="text/css"> | |
* { | |
font-size: 12px; | |
} | |
h2 {color: #00704a; font-family:Arial, Helvetica, sans-serif; font-size: 16px;} | |
.yellow_tr { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: Robert Zhang <[email protected]> | |
Date: 2011/8/12 | |
Subject: RE: Internet Domain Name & Keyword | |
To: [email protected] | |
Dear Our Client, | |
Based on your company having no relationship with them, we have | |
suggested they should choose another name to avoid this conflict but |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'order_invoice' | |
class OrderMailer < ActionMailer::Base | |
helper "spree/base" | |
def confirm_email(order, resend = false) | |
send_the_mail(order, "Confirmation", "confirm", resend) | |
end | |
def shipped_email(order, resend = false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Order.class_eval do | |
attr_accessor :ship_notified | |
# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details) | |
state_machine :initial => 'cart', :use_transactions => false do | |
event :next do | |
transition :from => 'cart', :to => 'address' | |
transition :from => 'address', :to => 'delivery' | |
transition :from => 'delivery', :to => 'payment' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Gateway.current.payment_profiles_supported? | |
=> false | |
>> Gateway.all | |
=> [#<Gateway::AuthorizeNetCim id: 3, type: "Gateway::AuthorizeNetCim", name: "Credit Card", description: "Authorize.net CIM ", active: true, environment: "production", created_at: "2010-03-08 20:29:39", updated_at: "2011-07-26 18:27:11", deleted_at: nil, display_on: "">] | |
>> Gateway.current | |
=> #<PaymentMethod::Check id: 4, type: "PaymentMethod::Check", name: "COD", description: "Cash on delivery.", active: true, environment: "production", created_at: "2010-07-21 20:03:14", updated_at: "2010-10-15 09:09:59", deleted_at: nil, display_on: ""> | |
>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updates the +payment_state+ attribute according to the following logic: | |
# | |
# paid when +payment_total+ is equal to +total+ | |
# balance_due when +payment_total+ is less than +total+ | |
# credit_owed when +payment_total+ is greater than +total+ | |
# failed when most recent payment is in the failed state | |
# | |
# The +payment_state+ value helps with reporting, etc. since it provides a quick and easy way to locate Orders needing attention. | |
def update_payment_state | |
if round_money(payment_total) < round_money(total) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.2@refinery-app expelliarmus:~/workzone/projects master! $ refinerycms refinery-app | |
Running: "/Users/cmaujean/.rvm/rubies/ruby-1.9.2-p180/bin/ruby" -S bundle install | |
Fetching source index for http://rubygems.org/ | |
Installing rake (0.9.2) | |
Using abstract (1.0.0) | |
Using activesupport (3.0.9) | |
Using builder (2.1.2) | |
Using i18n (0.5.0) | |
Using activemodel (3.0.9) | |
Using erubis (2.6.6) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails' | |
gem 'aws-s3', :require => 'aws/s3' | |
gem 'dynamic_form' | |
gem 'heroku' | |
gem 'memcache-client' | |
gem 'prawn' | |
gem 'prawnto' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Content Manager | |
# – can access overview, reports, events, faq, snippets, and pages. | |
class ContentAbility | |
include CanCan::Ability | |
def initialize(user) | |
if user.has_role?(:content) | |
can :manage, :all | |
cannot :manage, Product | |
cannot :manage, Configuration |