0
@@ -1509,28 +1509,36 @@ module ActiveRecord
0
+ mattr_accessor :valid_keys_for_has_many_association
0
+ @@valid_keys_for_has_many_association = [
0
+ :class_name, :table_name, :foreign_key, :primary_key,
0
+ :select, :conditions, :include, :order, :group, :limit, :offset,
0
+ :as, :through, :source, :source_type,
0
+ :finder_sql, :counter_sql,
0
+ :before_add, :after_add, :before_remove, :after_remove,
0
+ :validate, :accessible
0
def create_has_many_reflection(association_id, options, &extension)
0
- options.assert_valid_keys(
0
- :class_name, :table_name, :foreign_key, :primary_key,
0
- :select, :conditions, :include, :order, :group, :limit, :offset,
0
- :as, :through, :source, :source_type,
0
- :finder_sql, :counter_sql,
0
- :before_add, :after_add, :before_remove, :after_remove,
0
- :validate, :accessible
0
+ options.assert_valid_keys(valid_keys_for_has_many_association)
0
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
0
create_reflection(:has_many, association_id, options, self)
0
+ mattr_accessor :valid_keys_for_has_one_association
0
+ @@valid_keys_for_has_one_association = [
0
+ :class_name, :foreign_key, :remote, :select, :conditions, :order,
0
+ :include, :dependent, :counter_cache, :extend, :as, :readonly,
0
+ :validate, :primary_key, :accessible
0
def create_has_one_reflection(association_id, options)
0
- options.assert_valid_keys(
0
- :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :readonly, :validate, :primary_key, :accessible
0
+ options.assert_valid_keys(valid_keys_for_has_one_association)
0
create_reflection(:has_one, association_id, options, self)
0
@@ -1542,11 +1550,15 @@ module ActiveRecord
0
create_reflection(:has_one, association_id, options, self)
0
+ mattr_accessor :valid_keys_for_belongs_to_association
0
+ @@valid_keys_for_belongs_to_association = [
0
+ :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions,
0
+ :include, :dependent, :counter_cache, :extend, :polymorphic, :readonly,
0
+ :validate, :accessible
0
def create_belongs_to_reflection(association_id, options)
0
- options.assert_valid_keys(
0
- :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, :include, :dependent,
0
- :counter_cache, :extend, :polymorphic, :readonly, :validate, :accessible
0
+ options.assert_valid_keys(valid_keys_for_belongs_to_association)
0
reflection = create_reflection(:belongs_to, association_id, options, self)