Module: Groupdate
- Defined in:
- lib/groupdate.rb,
lib/groupdate/magic.rb,
lib/groupdate/version.rb,
lib/groupdate/relation.rb,
lib/groupdate/query_methods.rb,
lib/groupdate/series_builder.rb,
lib/groupdate/adapters/base_adapter.rb,
lib/groupdate/adapters/mysql_adapter.rb,
lib/groupdate/adapters/sqlite_adapter.rb,
lib/groupdate/adapters/postgresql_adapter.rb
Defined Under Namespace
Modules: Adapters, QueryMethods, Relation Classes: Error, Magic, SeriesBuilder
Constant Summary collapse
- PERIODS =
[:second, :minute, :hour, :day, :week, :month, :quarter, :year, :day_of_week, :hour_of_day, :minute_of_hour, :day_of_month, :day_of_year, :month_of_year]
- METHODS =
PERIODS.map { |v| :"group_by_#{v}" } + [:group_by_period]
- VERSION =
"6.5.1"
Class Method Summary collapse
- .adapters ⇒ Object
-
.process_result(relation, result, **options) ⇒ Object
api for gems like ActiveMedian.
- .register_adapter(name, adapter) ⇒ Object
Class Method Details
.adapters ⇒ Object
35 36 37 |
# File 'lib/groupdate.rb', line 35 def self.adapters @adapters ||= {} end |
.process_result(relation, result, **options) ⇒ Object
api for gems like ActiveMedian
28 29 30 31 32 33 |
# File 'lib/groupdate.rb', line 28 def self.process_result(relation, result, **) if relation.groupdate_values result = Groupdate::Magic::Relation.process_result(relation, result, **) end result end |
.register_adapter(name, adapter) ⇒ Object
39 40 41 42 43 |
# File 'lib/groupdate.rb', line 39 def self.register_adapter(name, adapter) Array(name).each do |n| adapters[n] = adapter end end |