-
-
Save jwo/f95ee034ab1418c9c9c6 to your computer and use it in GitHub Desktop.
BAD CODE. BAD!
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
<script> | |
screenWidth= screen.width; | |
screenHeight = screen.height; | |
function openThis(passedID) { | |
window.open("/coders/coder_form?surg_id=" + passedID,"mywindow","width=" + screenWidth + ",height=675,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,top=0,left=0,resizable=no") | |
} | |
</script> | |
<% | |
@mydocs = SurgeonCoder.find(:all, :conditions => ["coder_id=?", params[:userId]) | |
if @mydocs.size > 0 | |
@mydocs.each do |doc| | |
doctorid = doc.surgeon_id | |
@reports = PermanentSurgery.find(:all, :conditions => "id in (select permanent_surgery_id from permanent_attributes where attribute_desc='Surgeon' and user_id=#{doctorid}) and coded=0") | |
if @reports.size > 0 %> | |
<table border=0 cellpadding=0 cellspacing=0><% | |
@reports.each do |surg| %> | |
<tr> | |
<td width="150"><%= surg.patient_first_name %> <%= surg.patient_last_name %></td> | |
<td width="250"><%= surg.created_at %></td> | |
<td>[<a href="javascript:openThis(<%= surg.id %>)">create form</a>]</td> | |
</tr><% | |
end %> | |
</table><% | |
else %> | |
No Surgeries Available for Coding<% | |
end | |
end | |
else %> | |
No doctors assigned<% | |
end %> |
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 create_lambdas(attrs) | |
attrs.map do |attr| | |
lambda{|model| model.send(attr.to_sym).present? if model.respond_to? attr.to_sym} | |
end | |
end | |
page_calls = create_lambdas ["title_tag", "description", "meta_keywords" ] | |
post_calls = create_lambdas ["meta_title", "meta_description", "keywords" ] | |
empty_post = Post.all.reject do |model| | |
post_calls.all? {|c| c.call(model)} | |
end | |
empty_page = Page.all.reject do |model| | |
page_calls.all? {|c| c.call(model)} | |
end | |
puts "Posts" | |
empty_post.map(&:title).map{|t| puts t}; nil | |
puts "\n\n\npages" | |
empty_page.map(&:title).map{|t| puts t}; nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment