Skip to content

Instantly share code, notes, and snippets.

def create
build_resource
card = ActiveMerchant::Billing::CreditCard.new(
:number => params[:expiry_number],
:month => params[:expiry_month],
:year => params[:date_year],
:name => params[:name_on_card],
:verification_value => :params[:cvv]
)
def create
build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?
class RegistrationsController < Devise::RegistrationsController
def new
if params[:bp].present?
puts "why"
@user = User.find_by_lbp_number(params[:bp])
else
@user = User.new
puts "this shouldn't be here"
end
if current_user.id == params[:id] or current_user.admin?
show!
else
redirect_to root_path
end
@christopherdbull
christopherdbull / gist:1329819
Created November 1, 2011 03:38
Rspec 1.9.3 error
/.rvm/gems/ruby-1.9.3-p0@buildinghub/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:212: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
-- Control frame information -----------------------------------------------
c:0013 p:0273 s:0053 b:0053 l:000052 d:000052 METHOD /.rvm/gems/ruby-1.9.3-p0@buildinghub/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:212
c:0012 p:0043 s:0047 b:0047 l:000046 d:000046 METHOD /.rvm/gems/ruby-1.9.3-p0@buildinghub/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:263
c:0011 p:0050 s:0042 b:0042 l:000033 d:000041 BLOCK /.rvm/gems/ruby-1.9.3-p0@buildinghub/gems/rspec-core-2.7.1/lib/rspec/core/configuration_options.rb:19
c:0010 p:---- s:0039 b:0039 l:000038 d:000038 FINISH
c:0009 p:---- s:0037 b:0037 l:000036 d:000036 CFUNC :each