Skip to content

Commit

Permalink
tables hash
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Oct 19, 2024
1 parent cf5e555 commit fd99e04
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/rails_com/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ def migrate_tables_hash
tables
end

def unbound_tables_hash
#tables - models.map(&:table_name) - ['schema_migrations', 'ar_internal_metadata']
tables = {}
tables_hash.each do |table_name, cols|

end
end

def migrate_modules_hash
tables = ActiveRecord::Base.connection.tables
@modules = {}

models.group_by(&:module_parent).each do |module_name, record_classes|
Expand All @@ -110,10 +119,6 @@ def migrate_modules_hash
@modules
end

def unbound_tables
tables - models.map(&:table_name) - ['schema_migrations', 'ar_internal_metadata']
end

def ignore_models
models.group_by(&->(i){ i.pending_attributes.size }).transform_values!(&->(i) { i.map(&:to_s) })
end
Expand All @@ -128,10 +133,6 @@ def attachments
@attachments
end

def tables
ActiveRecord::Base.connection.tables
end

def model_names
models.map(&:to_s)
end
Expand Down

0 comments on commit fd99e04

Please sign in to comment.