Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Contact cart fixes

  • Loading branch information...
commit 011bce57625165a826efd264d3abe3afe561f915 1 parent 00c9625
@djcp authored
View
3  app/controllers/admin/bulk_action_controller.rb
@@ -78,8 +78,7 @@ def bulk_create_campaign
@campaign.save
@session_user.active_campaign = @campaign
@session_user.save
- flash[:notice] = 'Campaign created. Now just fill in the rest!'
- redirect_to edit_freemailer_campaign_url @campaign and return
+ flash[:notice] = (@campaign.new_record?) ? 'Campaign created.' : 'Campaign updated.'
else
flash[:error] = "We couldn't create the campaign. Please select some contacts and ensure that the title of this campaign is unique."
end
View
2  app/models/contact_cart.rb
@@ -6,8 +6,6 @@ class ContactCart < ActiveRecord::Base
has_many :contact_cart_entries, :dependent => :destroy
has_many :contacts, :through => :contact_cart_entries
- validates_presence_of :contact_ids
-
# Provides a list of contacts in the cart joined by ", " or " -- None Added -- " if there are no contacts.
def contact_names
contacts.count == 0 ? ' -- None Added -- ' : contacts.map(&:name_for_display).join(', ').squeeze(' ')
View
2  app/models/freemailer_campaign.rb
@@ -4,8 +4,6 @@ class FreemailerCampaign < ActiveRecord::Base
has_many :freemailer_campaign_contacts, :dependent => :destroy
has_many :contacts, :through => :freemailer_campaign_contacts
- validates_presence_of :contact_ids
-
validates_uniqueness_of :title, :scope => :sender_id, :on => :create, :message => "must be unique" #JS me
before_destroy :remove_active_campaign
Please sign in to comment.
Something went wrong with that request. Please try again.