Skip to content

Commit

Permalink
Support upgrade to Ruby v2.3.8: skip when klass.name is nil
Browse files Browse the repository at this point in the history
Task 8701
  • Loading branch information
baburdick committed Nov 29, 2018
1 parent 9ac9785 commit 862087e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions spec/support/moribus_spec_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
module MoribusSpecModel
def self.cleanup!
ObjectSpace.each_object(MoribusSpecModel) do |klass|
if Object.const_defined? klass.name.to_sym
conn, table_name = klass.connection, klass.table_name
conn.drop_table(table_name) if conn.tables.include?(table_name)
Object.send :remove_const, klass.name.to_sym
unless klass.name.nil?
if Object.const_defined? klass.name.to_sym
conn, table_name = klass.connection, klass.table_name
conn.drop_table(table_name) if conn.tables.include?(table_name)
Object.send :remove_const, klass.name.to_sym
end
end
end
ActiveSupport::Dependencies::Reference.clear!
Expand Down
2 changes: 1 addition & 1 deletion tags
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Moribus lib/moribus/extensions/has_current_extension.rb 1;" m line:1
Moribus lib/moribus/macros.rb 1;" m line:1
Moribus lib/moribus/tracked_behavior.rb 1;" m line:1
Moribus lib/moribus/version.rb 1;" m line:1
MoribusSpecModel spec/support/moribus_spec_model.rb 26;" f line:26
MoribusSpecModel spec/support/moribus_spec_model.rb 28;" f line:28
MoribusSpecModel spec/support/moribus_spec_model.rb 2;" m line:2
SpecAuthor spec/moribus/alias_association_spec.rb 15;" c line:15
SpecComment spec/moribus/alias_association_spec.rb 23;" c line:23
Expand Down

0 comments on commit 862087e

Please sign in to comment.