Created
March 18, 2010 14:59
-
-
Save ehlyzov/336432 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"log" | |
[["1811504200009947", "1811504200007535", "9165", :update, :no, :ok, #<MicrotiterPlate id: 2119993678, name: nil, number: "9947", created_at: "2010-02-28 10:55:03", updated_at: "2010-02-28 10:55:03", spotted_plate_id: nil, position: 14, barcode: "1811504200009947", parent_id: 2119993679, deleted_at: nil>], ["1811504200009992", "1811504200009302", "9163", :update, "20090401_gesell_4831-9301-9302-9303_Tof9163", :ok, #<MicrotiterPlate id: 2119993680, name: nil, number: "9992", created_at: "2010-02-28 10:55:12", updated_at: "2010-02-28 10:55:12", spotted_plate_id: nil, position: 16, barcode: "1811504200009992", parent_id: 116103490, deleted_at: nil>]] | |
[["1811504200009947", "1811504200007535", "9165", :update, :no, :ok, #<MicrotiterPlate id: 2119993678, name: nil, number: "9947", created_at: "2010-02-28 10:55:03", updated_at: "2010-02-28 10:55:03", spotted_plate_id: nil, position: 14, barcode: "1811504200009947", parent_id: 2119993679, deleted_at: nil>], ["1811504200009992", "1811504200009302", "9163", :update, "20090401_gesell_4831-9301-9302-9303_Tof9163", :ok, #<MicrotiterPlate id: 2119993680, name: nil, number: "9992", created_at: "2010-02-28 10:55:12", updated_at: "2010-02-28 10:55:12", spotted_plate_id: nil, position: 16, barcode: "1811504200009992", parent_id: 116103490, deleted_at: nil>]] | |
[["1811504200009947", "1811504200007535", "9165", :update, :no, :ok], ["1811504200009992", "1811504200009302", "9163", :update, "20090401_gesell_4831-9301-9302-9303_Tof9163", :ok]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log_and_yield obj, log_type = :comment | |
p "log" | |
cloned_obj = obj.clone | |
p cloned_obj | |
log_msg = case log_type | |
when :summary | |
# get rid of stored mtp | |
p obj | |
cloned_obj.each &:pop | |
p obj | |
else | |
cloned_obj | |
end | |
@session_log.add_message log_type, log_msg | |
@session_log.save! | |
p obj | |
obj | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment