Class: Partitioned::ByMonthlyTimeField
- Inherits:
-
ByTimeField
- Object
- ActiveRecord::Base
- PartitionedBase
- ByTimeField
- Partitioned::ByMonthlyTimeField
- Defined in:
- lib/partitioned/by_monthly_time_field.rb
Overview
Partition tables by a time field grouping them by week, with a week defined as seven days starting on Monday.
Class Method Summary collapse
-
.partition_normalize_key_value(time_value) ⇒ Time
Normalize a partition key value by month.
-
.partition_table_size ⇒ Integer
The size of the partition table, a month.
Methods inherited from ByTimeField
partition_generate_range, partition_time_field
Methods inherited from PartitionedBase
add_parent_table_rules, add_partition_table_index, add_references_to_partition_table, archive_old_partition, archive_old_partitions, arel_table_from_key_values, configurator, configurator_dsl, create_infrastructure, create_new_partition, create_new_partition_tables, create_new_partitions, create_partition_schema, create_partition_table, delete_infrastructure, drop_old_partition, drop_old_partitions, drop_partition_table, dynamic_arel_table, #dynamic_arel_table, from_partition, from_partition_without_alias, partition_generate_range, partition_key_values, partition_keys, partition_manager, partition_name, partition_table_alias_name, #partition_table_name, partition_table_name, partitioned, sql_adapter
Methods included from ActiveRecordOverrides
#arel_attributes_values, #delete
Class Method Details
.partition_normalize_key_value(time_value) ⇒ Time
Normalize a partition key value by month.
13 14 15 |
# File 'lib/partitioned/by_monthly_time_field.rb', line 13 def self.partition_normalize_key_value(time_value) return time_value.at_beginning_of_month end |
.partition_table_size ⇒ Integer
The size of the partition table, a month
20 21 22 |
# File 'lib/partitioned/by_monthly_time_field.rb', line 20 def self.partition_table_size return 1.month end |