Permalink
Browse files

Fixes Mailing#copy and Mailing#create. Closes #21

  • Loading branch information...
1 parent fabc7f1 commit 55b6bea056486ed63259963aeb849ba56395aa8b Thomas von Deyen committed Mar 28, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/models/alchemy_crm/mailing.rb
@@ -55,9 +55,9 @@ def contacts_from_additional_email_addresses
# Makes a copy of another mailing.
def self.copy(id)
source = self.find(id)
- clone = source.clone
- clone.name = "#{source.name} (#{::I18n.t(:copy, :scope => :alchemy_crm, :default => 'Copy')})"
- clone
+ new(source.attributes.merge(
+ "name" => "#{source.name} (#{::I18n.t(:copy, :scope => :alchemy_crm, :default => 'Copy')})"
+ ).except("id", "updated_at", "created_at", "sha1", "salt", "page_id"))
end
def next_pending_delivery
@@ -72,7 +72,7 @@ def create_page
mailing_page = Alchemy::Page.new(
:name => "Mailing #{self.name}",
:sitemap => false,
- :page_layout => MAILING_PAGE_LAYOUT_PREFIX + self.newsletter.layout,
+ :page_layout => newsletter.layout,
:language => Alchemy::Language.get_default,
:parent_id => mailing_root.id
)

0 comments on commit 55b6bea

Please sign in to comment.