Class: ElasticsearchRecord::SchemaMigration
- Inherits:
-
ActiveRecord::SchemaMigration
- Object
- ActiveRecord::SchemaMigration
- ElasticsearchRecord::SchemaMigration
- Defined in:
- lib/elasticsearch_record/schema_migration.rb
Instance Method Summary collapse
- #table_name ⇒ Object
-
#versions ⇒ Object
overwrite method to fix the default limit (= 10) to support returning more than 10 migrations.
Instance Method Details
#table_name ⇒ Object
8 9 10 |
# File 'lib/elasticsearch_record/schema_migration.rb', line 8 def table_name "#{ElasticsearchRecord::Base.table_name_prefix}#{ElasticsearchRecord::Base.schema_migrations_table_name}#{ElasticsearchRecord::Base.table_name_suffix}" end |
#versions ⇒ Object
overwrite method to fix the default limit (= 10) to support returning more than 10 migrations
13 14 15 16 17 18 19 20 |
# File 'lib/elasticsearch_record/schema_migration.rb', line 13 def versions sm = Arel::SelectManager.new(arel_table) sm.project(arel_table[primary_key]) sm.order(arel_table[primary_key].asc) sm.take(connection.max_result_window(table_name)) connection.select_values(sm, "#{self.class} Load") end |