Permalink
Browse files

Removed email optional config setting. Auth.net needs it, I think.

  • Loading branch information...
Matt Fordham
Matt Fordham committed May 9, 2011
1 parent 9633600 commit d52c5c3b41b95164ca70373a92e8b26b73eaa788
View
Binary file not shown.
View
@@ -2,11 +2,8 @@ class ContactInfo < ActiveRecord::Base
belongs_to :subscription, :dependent => :destroy
validates_presence_of :first_name, :last_name
-
- with_options :if => :require_email? do |contact_info|
- contact_info.validates_format_of :email, :with => ::Authlogic::Regex.email
- contact_info.validates_presence_of :email
- end
+ validates_format_of :email, :with => ::Authlogic::Regex.email
+ validates_presence_of :email
with_options :if => :require_billing_address? do |contact_info|
contact_info.validates_presence_of :address
@@ -58,9 +55,6 @@ def to_hash
:phone_number => phone_number}
end
- def require_email?
- Saasaparilla::CONFIG["require_email"] == true
- end
def require_billing_address?
Saasaparilla::CONFIG["require_billing_address"] == true
@@ -1,7 +1,6 @@
= f.input :first_name
= f.input :last_name
-- if @subscription.contact_info.require_email?
- = f.input :email
+= f.input :email
- if @subscription.contact_info.require_billing_address?
= f.input :address
= f.input :city
@@ -23,9 +23,8 @@
%p
= "#{@subscription.contact_info.first_name} #{@subscription.contact_info.last_name}"
%br
- - if @subscription.contact_info.require_email?
- = @subscription.contact_info.email
- %br
+ = @subscription.contact_info.email
+ %br
- if @subscription.contact_info.require_billing_address?
= @subscription.contact_info.address
%br
@@ -8,7 +8,6 @@ development:
authorization: cancan
require_billing_address: true
require_phone_number: true
- require_email: true
test:
grace_period: 10
@@ -20,7 +19,6 @@ test:
authorization: none
require_billing_address: true
require_phone_number: true
- require_email: true
production:
grace_period: 10
@@ -32,4 +30,3 @@ production:
authorization: cancan
require_billing_address: true
require_phone_number: true
- require_email: true
@@ -8,7 +8,6 @@ development:
authorization: none
require_billing_address: false
require_phone_number: false
- require_email: false
test:
grace_period: 10
@@ -20,7 +19,6 @@ test:
authorization: none
require_billing_address: true
require_phone_number: true
- require_email: true
production:
grace_period: 10
@@ -32,4 +30,3 @@ production:
authorization: cancan
require_billing_address: false
require_phone_number: false
- require_email: false

0 comments on commit d52c5c3

Please sign in to comment.