Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Ruby
- ```ruby
- base_class.metadata.sorted_tables
- .each_value
- .select do |value|
- models.any? { |model| value.description.include?(model.__tablename__) }
- end
- ```
- # Python
- ```python
- tables = [
- base_class.metadata.sorted_tables[i]
- for i, obj in enumerate(base_class.metadata.sorted_tables)
- for model in models
- if model.__tablename__ in obj.description
- ]
- ```
Add Comment
Please, Sign In to add comment