Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10740: find_conditions_field_with_array_rdoc_patch.diff

File find_conditions_field_with_array_rdoc_patch.diff, 1.2 kB (added by kris_chambers, 9 months ago)
  • activerecord/lib/active_record/base.rb

    old new  
    191191  # 
    192192  #   Student.find(:all, :conditions => { :grade => 9..12 }) 
    193193  # 
     194  # An array may be used in the hash to use the SQL IN operator: 
     195  # 
     196  #       Student.find(:all, :conditions => { :grade => [9,11,12] }) 
     197  # 
    194198  # == Overwriting default accessors 
    195199  # 
    196200  # All column values are automatically available through basic accessors on the Active Record object, but sometimes you 
     
    478482      # Examples for find all: 
    479483      #   Person.find(:all) # returns an array of objects for all the rows fetched by SELECT * FROM people 
    480484      #   Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50) 
    481       #   Person.find(:all, :offset => 10, :limit => 10) 
     485      #   Person.find(:all, :conditions => { :friends => ["Bob", "Steve", "Fred"] } 
     486      #   Person.find(:all, :offset => 10, :limit => 10) 
    482487      #   Person.find(:all, :include => [ :account, :friends ]) 
    483488      #   Person.find(:all, :group => "category") 
    484489      #