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

Ticket #2836: valid_options_r2.diff

File valid_options_r2.diff, 1.0 kB (added by Lucas Carlson <lucas@rufy.com>, 3 years ago)

A little better abstraction and variable naming

  • activerecord/lib/active_record/base.rb

    old new  
    349349    # adapters for, e.g., your development and test environments. 
    350350    cattr_accessor :schema_format  
    351351    @@schema_format = :sql 
     352     
     353    # Specifies what options ActiveRecord#find accepts as valid. 
     354    cattr_accessor :valid_find_options 
     355    @@valid_find_options = [:conditions, :include, :joins, :limit, :offset, :order, :select, :readonly, :group] 
    352356 
    353357    class << self # Class methods 
    354358      # Find operates with three different retrieval approaches: 
     
    11811185        end 
    11821186 
    11831187        def validate_find_options(options) 
    1184           options.assert_valid_keys [:conditions, :include, :joins, :limit, :offset, :order, :select, :readonly, :group] 
     1188          options.assert_valid_keys valid_find_options 
    11851189        end 
    11861190 
    11871191        def encode_quoted_value(value)