mirror of
https://github.com/github/rails.git
synced 2026-01-26 23:08:58 -05:00
Allow ARStore::Session to indicate that it should not be reloaded in dev mode
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -46,6 +46,11 @@ class CGI
|
||||
|
||||
class << self
|
||||
|
||||
# Don't try to reload ARStore::Session in dev mode.
|
||||
def reloadable? #:nodoc:
|
||||
false
|
||||
end
|
||||
|
||||
def data_column_size_limit
|
||||
connection.columns(table_name).find {|column| column.name == 'data'}.limit
|
||||
end
|
||||
|
||||
@@ -256,13 +256,27 @@ module ActiveRecord #:nodoc:
|
||||
@@subclasses[self] << child
|
||||
super
|
||||
end
|
||||
|
||||
# Allow all subclasses of AR::Base to be reloaded in dev mode, unless they
|
||||
# explicitly decline the honor. USE WITH CAUTION. Only AR subclasses kept
|
||||
# in the framework should use the flag, so #reset_subclasses and so forth
|
||||
# leave it alone.
|
||||
def self.reloadable? #:nodoc:
|
||||
true
|
||||
end
|
||||
|
||||
def self.reset_subclasses
|
||||
nonreloadables = []
|
||||
subclasses.each do |klass|
|
||||
unless klass.reloadable?
|
||||
nonreloadables << klass
|
||||
next
|
||||
end
|
||||
klass.instance_variables.each { |var| klass.send(:remove_instance_variable, var) }
|
||||
klass.instance_methods(false).each { |m| klass.send :undef_method, m }
|
||||
end
|
||||
@@subclasses.clear
|
||||
@@subclasses = {}
|
||||
nonreloadables.each { |klass| (@@subclasses[klass.superclass] ||= []) << klass }
|
||||
end
|
||||
|
||||
@@subclasses = {}
|
||||
|
||||
Reference in New Issue
Block a user