Last active
          December 25, 2015 07:59 
        
      - 
      
- 
        Save workmaster2n/6942912 to your computer and use it in GitHub Desktop. 
    sanitize custom sql
  
        
  
    
      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
    
  
  
    
  | ActiveRecord::Base.connection.execute("SELECT * FROM tracked_points, rules WHERE (tracked_points.id = 1 AND rules.id = 1) OR (tracked_points.id = 1 AND rules.id = 2)") | 
  
    
      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
    
  
  
    
  | def search(tp_id1, rule_id1, tp_id2, rule_id2) | |
| ActiveRecord::Base.connection.execute("SELECT * FROM tracked_points, rules WHERE (tracked_points.id = #{tp_id1} AND rules.id = #{rule_id1}) OR (tracked_points.id = #{tp_id2} AND rules.id = #{rule_id2})") | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment