Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/plate/creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def can_create_plates?(source_plate, plate_purposes)
plate_purposes.include?(r.plate_purpose)
end.map(&:parent_purpose).uniq.compact

parent_purposes.empty? || parent_purposes.all? {|p| p==source_plate.purpose}
parent_purposes.empty? || parent_purposes.any? {|p| p==source_plate.purpose}
end

# Executes the plate creation so that the appropriate child plates are built.
Expand Down Expand Up @@ -68,7 +68,7 @@ def create_plates(source_plate_barcodes, current_user)

def create_child_plates_from(plate, current_user)
stock_well_picker = plate.plate_purpose.can_be_considered_a_stock_plate? ? lambda { |w| [w] } : lambda { |w| w.stock_wells }
plate_purposes.map do |target_plate_purpose|
plate_purposes.select{|p| p.parent_purpose==plate.purpose}.map do |target_plate_purpose|
target_plate_purpose.target_plate_type.constantize.create_with_barcode!(plate.barcode) do |child_plate|
child_plate.plate_purpose = target_plate_purpose
child_plate.size = plate.size
Expand Down
14 changes: 14 additions & 0 deletions db/migrate/20150629112016_add_wd_ch_to_pd_plate_creation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class AddWdChToPdPlateCreation < ActiveRecord::Migration
def self.up
ActiveRecord::Base.transaction do
Plate::Creator::PurposeRelationship.create!({
:plate_creator => Plate::Creator.find_by_name!("Pico Dilution"),
:plate_purpose => Purpose.find_by_name!("Pico Dilution"),
:parent_purpose => Purpose.find_by_name!("Cherrypicked Working Dilution")
})
end
end

def self.down
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is auto-generated from the current state of the database. Instead of editing this file,
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
Expand All @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20150623152205) do
ActiveRecord::Schema.define(:version => 20150629112016) do

create_table "aliquots", :force => true do |t|
t.integer "receptacle_id", :null => false
Expand Down
10 changes: 10 additions & 0 deletions db/seeds/0001_snp_plate_purposes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,13 @@
:asset_shape => Map::AssetShape.find_by_name('Standard'),
:barcode_for_tecan => 'ean13_barcode'
)
PlatePurpose.create!(
:name=>'Cherrypicked Working Dilution',
:default_state=>'pending',
:barcode_printer_type=>BarcodePrinterType.find_by_name('96 Well Plate'),
:cherrypickable_target => true,
:cherrypickable_source => false,
:size => 96,
:asset_shape => Map::AssetShape.find_by_name('Standard'),
:barcode_for_tecan => 'ean13_barcode'
)
9 changes: 5 additions & 4 deletions features/create_plates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ Feature: Printing new plate barcodes
And I should be on the new plate page

Examples:
| plate_purpose | parent_plate_purpose |
| Working dilution | Stock Plate |
| Pico dilution | Working dilution |
| Pico Assay Plates | Pico dilution |
| plate_purpose | parent_plate_purpose |
| Working dilution | Stock Plate |
| Pico dilution | Working dilution |
| Pico dilution | Cherrypicked Working Dilution |
| Pico Assay Plates | Pico dilution |

@xml @qc_event
Scenario: Create all QC plates for SLF
Expand Down