mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make sure habtm use class variable to list association valid keys
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1310 state:committed]
This commit is contained in:
parent
5110a8e05b
commit
5229fc4cc0
2 changed files with 14 additions and 10 deletions
|
@ -1227,7 +1227,8 @@ module ActionController #:nodoc:
|
||||||
if logger && logger.info?
|
if logger && logger.info?
|
||||||
logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
|
logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
|
||||||
|
|
||||||
if @_session && @_session.respond_to?(:session_id) && !@_session.dbman.is_a?(CGI::Session::CookieStore)
|
if @_session && @_session.respond_to?(:session_id) &&
|
||||||
|
!(@_session.respond_to?(:dbman) && @_session.is_a?(CGI::Session::CookieStore))
|
||||||
logger.info " Session ID: #{@_session.session_id}"
|
logger.info " Session ID: #{@_session.session_id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1596,8 +1596,8 @@ module ActiveRecord
|
||||||
reflection
|
reflection
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_has_and_belongs_to_many_reflection(association_id, options, &extension)
|
mattr_accessor :valid_keys_for_has_and_belongs_to_many_association
|
||||||
options.assert_valid_keys(
|
@@valid_keys_for_has_and_belongs_to_many_association = [
|
||||||
:class_name, :table_name, :join_table, :foreign_key, :association_foreign_key,
|
:class_name, :table_name, :join_table, :foreign_key, :association_foreign_key,
|
||||||
:select, :conditions, :include, :order, :group, :limit, :offset,
|
:select, :conditions, :include, :order, :group, :limit, :offset,
|
||||||
:uniq,
|
:uniq,
|
||||||
|
@ -1605,7 +1605,10 @@ module ActiveRecord
|
||||||
:before_add, :after_add, :before_remove, :after_remove,
|
:before_add, :after_add, :before_remove, :after_remove,
|
||||||
:extend, :readonly,
|
:extend, :readonly,
|
||||||
:validate
|
:validate
|
||||||
)
|
]
|
||||||
|
|
||||||
|
def create_has_and_belongs_to_many_reflection(association_id, options, &extension)
|
||||||
|
options.assert_valid_keys(valid_keys_for_has_and_belongs_to_many_association)
|
||||||
|
|
||||||
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue