unread 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c07c4e81aedbb9145c7ce1ca8da208037dba8866
4
- data.tar.gz: 8b970b45fb9c988c09938fe62e4b17afaf9a6a30
3
+ metadata.gz: de3df2e59a6b6f3a9526ff9e5fa922c110ef8be3
4
+ data.tar.gz: d5978503df223116016aeb6295d75c9ff3cf5183
5
5
  SHA512:
6
- metadata.gz: 4b77bad5fa155eea207bb5787368674883b3d4d148bb23dc63e69fd29c1ada9bb470b4fba0d922a3319e34940d96067cd1e80757ad430184bc557f2670658446
7
- data.tar.gz: 7bb4ac0a6820ef38c680805e72c218f440c689efa5439abeb0d33a7b0181bd3842093a7f12a7944c2f418a0a441cf6ac4c2f85b8dc19e7dd3d55eb0e7bdec1d9
6
+ metadata.gz: 52db71810adf1939ebf35bd0aedf2ce6f9f546190ec35719dc3dfc6a190132585b49dbd5fa0e44ef47ebb2b0bb5a06832bde7c9073c8b80066a0de3ff9b98dee
7
+ data.tar.gz: 6178164de3a46bb4c40a1a0e7ab5c0d9eef3a3dd71a8ee642701a19555f38f026ca6f28018967b96b982e1281d225f3a8aeed81d2343567d8c0ca4955aa1e165
@@ -2,10 +2,11 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 2.1.10
5
- - 2.2.6
5
+ - 2.2.7
6
6
  - 2.3.3
7
- - 2.4.0
7
+ - 2.4.1
8
8
  gemfile:
9
+ - gemfiles/rails_5_1.gemfile
9
10
  - gemfiles/rails_5_0.gemfile
10
11
  - gemfiles/rails_4_2.gemfile
11
12
  - gemfiles/rails_4_1.gemfile
@@ -15,6 +16,10 @@ gemfile:
15
16
  - gemfiles/rails_3_0.gemfile
16
17
  matrix:
17
18
  exclude:
19
+ - rvm: 2.0.0
20
+ gemfile: gemfiles/rails_5_1.gemfile
21
+ - rvm: 2.1.10
22
+ gemfile: gemfiles/rails_5_1.gemfile
18
23
  - rvm: 2.0.0
19
24
  gemfile: gemfiles/rails_5_0.gemfile
20
25
  - rvm: 2.1.10
@@ -25,15 +30,15 @@ matrix:
25
30
  gemfile: gemfiles/rails_3_1.gemfile
26
31
  - rvm: 2.3.3
27
32
  gemfile: gemfiles/rails_3_2.gemfile
28
- - rvm: 2.4.0
33
+ - rvm: 2.4.1
29
34
  gemfile: gemfiles/rails_3_0.gemfile
30
- - rvm: 2.4.0
35
+ - rvm: 2.4.1
31
36
  gemfile: gemfiles/rails_3_1.gemfile
32
- - rvm: 2.4.0
37
+ - rvm: 2.4.1
33
38
  gemfile: gemfiles/rails_3_2.gemfile
34
- - rvm: 2.4.0
39
+ - rvm: 2.4.1
35
40
  gemfile: gemfiles/rails_4_0.gemfile
36
- - rvm: 2.4.0
41
+ - rvm: 2.4.1
37
42
  gemfile: gemfiles/rails_4_1.gemfile
38
43
  before_install: gem update bundler
39
44
  sudo: false
data/Appraisals CHANGED
@@ -1,3 +1,8 @@
1
+ appraise "rails-5-1" do
2
+ gem "activerecord", "~> 5.1.0"
3
+ gem 'mysql2', '>= 0.3.18', '< 0.5'
4
+ end
5
+
1
6
  appraise "rails-5-0" do
2
7
  gem "activerecord", "~> 5.0.0"
3
8
  gem 'mysql2', '>= 0.3.18', '< 0.5'
data/README.md CHANGED
@@ -20,7 +20,7 @@ Ruby gem to manage read/unread status of ActiveRecord objects - and it's fast.
20
20
  ## Requirements
21
21
 
22
22
  * Ruby 2.0.0 or newer
23
- * Rails 3.0 or newer (including Rails 4.x and Rails 5.0)
23
+ * Rails 3.0 or newer (including Rails 4.x and Rails 5.x)
24
24
  * MySQL, PostgreSQL or SQLite
25
25
  * Needs a timestamp field in your models (like created_at or updated_at) with a database index on it
26
26
 
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 3.0.20"
6
6
  gem "activerecord-mysql2-adapter"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 3.1.12"
6
6
  gem "mysql2", "~> 0.3.10"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 3.2.22"
6
6
  gem "mysql2", "~> 0.3.10"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.0.13"
6
6
  gem "mysql2", "~> 0.3.10"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.1.14"
6
6
  gem "mysql2", "~> 0.3.13"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.2.5"
6
6
  gem "mysql2", ">= 0.3.13", "< 0.5"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 5.0.0"
6
6
  gem "mysql2", ">= 0.3.18", "< 0.5"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.1.0"
6
+ gem "mysql2", ">= 0.3.18", "< 0.5"
7
+
8
+ gemspec path: "../"
@@ -1,6 +1,6 @@
1
- class UnreadMigration < ActiveRecord::Migration
1
+ class UnreadMigration < Unread::MIGRATION_BASE_CLASS
2
2
  def self.up
3
- create_table ReadMark, force: true do |t|
3
+ create_table ReadMark, force: true, options: create_options do |t|
4
4
  t.references :readable, polymorphic: { null: false }
5
5
  t.references :reader, polymorphic: { null: false }
6
6
  t.datetime :timestamp
@@ -12,4 +12,13 @@ class UnreadMigration < ActiveRecord::Migration
12
12
  def self.down
13
13
  drop_table ReadMark
14
14
  end
15
+
16
+ def self.create_options
17
+ options = ''
18
+ if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) \
19
+ && ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
20
+ options = 'DEFAULT CHARSET=latin1'
21
+ end
22
+ options
23
+ end
15
24
  end
@@ -1,4 +1,4 @@
1
- class UnreadPolymorphicReaderMigration < ActiveRecord::Migration
1
+ class UnreadPolymorphicReaderMigration < Unread::MIGRATION_BASE_CLASS
2
2
  def self.up
3
3
  remove_index :read_marks, [:user_id, :readable_type, :readable_id]
4
4
  rename_column :read_marks, :user_id, :reader_id
@@ -10,3 +10,9 @@ require 'unread/garbage_collector'
10
10
  require 'unread/version'
11
11
 
12
12
  ActiveRecord::Base.send :include, Unread
13
+
14
+ Unread::MIGRATION_BASE_CLASS = if ActiveRecord::VERSION::MAJOR >= 5
15
+ ActiveRecord::Migration[5.0]
16
+ else
17
+ ActiveRecord::Migration
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Unread
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
@@ -1,4 +1,4 @@
1
- class SpecMigration < ActiveRecord::Migration
1
+ class SpecMigration < Unread::MIGRATION_BASE_CLASS
2
2
  def self.up
3
3
  create_table Reader, :primary_key => 'number', :force => true do |t|
4
4
  t.string :name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unread
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Ledermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-25 00:00:00.000000000 Z
11
+ date: 2017-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -189,6 +189,7 @@ files:
189
189
  - gemfiles/rails_4_1.gemfile
190
190
  - gemfiles/rails_4_2.gemfile
191
191
  - gemfiles/rails_5_0.gemfile
192
+ - gemfiles/rails_5_1.gemfile
192
193
  - lib/generators/unread/migration/migration_generator.rb
193
194
  - lib/generators/unread/migration/templates/migration.rb
194
195
  - lib/generators/unread/polymorphic_reader_migration/polymorphic_reader_migration_generator.rb