Skip to content

Commit

Permalink
new_batch_create_record expects created_by record as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
vhochstein committed Mar 7, 2011
1 parent 6b2f1dc commit 20229a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/active_scaffold/actions/batch_create.rb
Expand Up @@ -117,22 +117,22 @@ def batch_create_marked
end
end

def new_batch_create_record
def new_batch_create_record(created_by)
new_model
end

def create_record(batch_record)
def create_record(created_by)
@successful = nil
@record = new_batch_create_record
@record.send("#{batch_create_by_column.to_s}=", batch_record)
@record = new_batch_create_record(created_by)
@record.send("#{batch_create_by_column.to_s}=", created_by)
batch_create_values.each do |attribute, value|
set_record_attribute(value[:column], attribute, value[:value])
end

if authorized_for_job?(@record)
create_save
if successful?
marked_records_parent.delete(batch_record.id) if batch_scope == 'MARKED' && marked_records_parent
marked_records_parent.delete(created_by.id) if batch_scope == 'MARKED' && marked_records_parent
else
error_records << @record
end
Expand Down

0 comments on commit 20229a9

Please sign in to comment.