Commit f31c95067b64a4ac4ef95c57443ebf472763bfa5

Authored by Andrew Kane
2 parents d86920a5 0f2b3ee6
Exists in sqlite

Merge branch 'master' into sqlite

Showing 2 changed files with 23 additions and 1 deletions   Show diff stats
README.md
... ... @@ -13,6 +13,8 @@ The simplest way to group by:
13 13  
14 14 Supports PostgreSQL, MySQL, and Redshift, plus arrays and hashes
15 15  
  16 +Experimental support for [SQLite](#sqlite-experimental)
  17 +
16 18 [![Build Status](https://travis-ci.org/ankane/groupdate.svg?branch=master)](https://travis-ci.org/ankane/groupdate)
17 19  
18 20 :cupid: Goes hand in hand with [Chartkick](http://ankane.github.io/chartkick/)
... ... @@ -242,6 +244,26 @@ SELECT CONVERT_TZ(NOW(), '+00:00', 'Etc/UTC');
242 244  
243 245 It should return the time instead of `NULL`.
244 246  
  247 +## SQLite [experimental]
  248 +
  249 +Groupdate has limited support for SQLite.
  250 +
  251 +- No time zone support
  252 +- No `day_start` or `week_start` options
  253 +- No `group_by_quarter` method
  254 +
  255 +To install, add this line to your application’s Gemfile:
  256 +
  257 +```ruby
  258 +gem 'groupdate', github: 'ankane/groupdate', branch: 'sqlite'
  259 +```
  260 +
  261 +If your application’s time zone is set to something other than `Etc/UTC`, create an initializer with:
  262 +
  263 +```ruby
  264 +Groupdate.time_zone = false
  265 +```
  266 +
245 267 ## Upgrading
246 268  
247 269 ### 3.0
... ...
test/test_helper.rb
... ... @@ -354,7 +354,7 @@ module TestDatabase
354 354  
355 355 def test_default_timezone_local
356 356 User.default_timezone = :local
357   - assert_raises(RuntimeError) { User.group_by_day(:created_at).count }
  357 + assert_raises(Groupdate::Error) { User.group_by_day(:created_at).count }
358 358 ensure
359 359 User.default_timezone = :utc
360 360 end
... ...