This file contains hidden or 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
    
  
  
    
  | scope :for_region, lambda { |region| | |
| joins("LEFT OUTER JOIN blog_post_shared_regions ON blog_post_shared_regions.blog_post_id = blog_posts.id") | |
| .where("blog_posts.region_id = ? OR (blog_post_shared_regions.region_id = ? AND blog_post_shared_regions.visible = true)", region.id, region.id) | |
| .order( "CASE WHEN blog_post_shared_regions.shared_at IS NULL THEN blog_posts.updated_at WHEN blog_post_shared_regions.shared_at > blog_posts.updated_at THEN blog_post_shared_regions.shared_at ELSE blog_posts.updated_at END DESC") | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <div class="btn-group"> | |
| <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> | |
| Please select | |
| </a> | |
| <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> | |
| <li><input type="checkbox" name="option1" id="option1" value="option1"/><label for="option1">Option 1</label</li> | |
| <li><input type="checkbox" name="option2" id="option2" value="option2"/><label for="option2">Option 2</label</li> | |
| <li><input type="checkbox" name="option3" id="option3" value="option3"/><label for="option3">Option 3</label</li> | |
| </ul> | |
| </div> | 
  
    
      This file contains hidden or 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
    
  
  
    
  | require 'spec_helper' | |
| describe "artifact routes" do | |
| it "routes post /artifacts to artifacts#create" do | |
| {post: "/artifacts"}.should route_to(controller: "artifacts", action: "create") | |
| end | |
| it "routes delete /artifacts/:id to artifacts#create" do | |
| artifact = FactoryGirl.build(:artifact) | |
| {delete: "/artifacts/#{artifact._id}"}.should route_to(controller: "artifacts", action: "destroy", id: artifact._id) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | module MultiParameterAttributes | |
| def filter_time(attributes, name) | |
| attrs = attributes.collect do |key, value| | |
| if key =~ /^#{Regexp.escape(name.to_s)}\((\d+)(\w)\)$/ | |
| [$1.to_i, value.send("to_#$2")] | |
| end | |
| end.compact.sort_by(&:first).map(&:last) | |
| attributes.reject! {|key,value| key =~ /^#{Regexp.escape(name.to_s)}\((\d+)(\w)\)$/ } | |
| attributes[name] = Time.zone.local(*attrs) unless attrs.empty? |