ahoy_matey 1.5.5 → 1.6.0

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: fb739af8b0e101e97b738d5839b438da101fc41f
4
- data.tar.gz: 5c202d2758f9fe5b33a6aa142e8a2c7520ff1f92
3
+ metadata.gz: d545b42712d52ad3ea16cca410ad316cce728578
4
+ data.tar.gz: 648e7131dd89915177c8b9f37a4640d5029bacce
5
5
  SHA512:
6
- metadata.gz: 7d65012b0f13dc8c79bc0efed4ef4c0f5618fa5356eab36881cd44ebcf74029b9ab8820a6b160cf4d4713e8a910bb17e6f57391e0add52804855dd8963c7a58c
7
- data.tar.gz: a16fb236d50969a9a3ba95ca28f2f1f6e4ffa4c6715eedb854bec2cb7f57257a4812d4b46c94ae0fdfd44146b9e60f336faf3944976e3d0dbf221ade9c6d3088
6
+ metadata.gz: 87557bbaf04bdf41dbe0e9eb72c74885d917bbe49cadd977b02fef1a46f351492a07e57e7d10e765af1dff0a9ac3ee6b310bb3ec321fbbba2b93efff42eb897c
7
+ data.tar.gz: cc9b9a7dbed329de70c98b0e3f4f27927f1889e60c3adcb88eadbd4ae84f18de4ec591df98253043609a53f349cfd0b1e1e642cd8d7a0916c939d9e1648699cb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.0
2
+
3
+ - Added support for Rails 5.1
4
+
1
5
  ## 1.5.5
2
6
 
3
7
  - Added support for Rails API
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in ahoy.gemspec
4
4
  gemspec
5
5
 
6
- gem "rails", "~> 5.0.0.rc1"
6
+ gem "rails", "~> 5.1.0"
data/lib/ahoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ahoy
2
- VERSION = "1.5.5"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -28,7 +28,7 @@ module Ahoy
28
28
  unless @database.in?([nil, "postgresql", "postgresql-jsonb", "mysql", "sqlite"])
29
29
  raise Thor::Error, "Unknown database option"
30
30
  end
31
- migration_template "active_record_events_migration.rb", "db/migrate/create_ahoy_events.rb"
31
+ migration_template "active_record_events_migration.rb", "db/migrate/create_ahoy_events.rb", migration_version: migration_version
32
32
  end
33
33
 
34
34
  def generate_model
@@ -47,6 +47,12 @@ module Ahoy
47
47
  "postgresql"
48
48
  end
49
49
  end
50
+
51
+ def migration_version
52
+ if ActiveRecord::VERSION::MAJOR >= 5
53
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
54
+ end
55
+ end
50
56
  end
51
57
  end
52
58
  end
@@ -27,7 +27,7 @@ module Ahoy
27
27
  unless options["database"].in?([nil, "postgresql", "postgresql-jsonb"])
28
28
  raise Thor::Error, "Unknown database option"
29
29
  end
30
- migration_template "active_record_visits_migration.rb", "db/migrate/create_visits.rb"
30
+ migration_template "active_record_visits_migration.rb", "db/migrate/create_visits.rb", migration_version: migration_version
31
31
  end
32
32
 
33
33
  def generate_model
@@ -37,6 +37,12 @@ module Ahoy
37
37
  def create_initializer
38
38
  template "active_record_initializer.rb", "config/initializers/ahoy.rb"
39
39
  end
40
+
41
+ def migration_version
42
+ if ActiveRecord::VERSION::MAJOR >= 5
43
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
44
+ end
45
+ end
40
46
  end
41
47
  end
42
48
  end
@@ -1,4 +1,4 @@
1
- class <%= migration_class_name %> < ActiveRecord::Migration
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :ahoy_events do |t|
4
4
  t.integer :visit_id
@@ -1,4 +1,4 @@
1
- class <%= migration_class_name %> < ActiveRecord::Migration
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :visits do |t|
4
4
  t.string :visit_token
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_matey
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.5
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  version: '0'
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.6.8
344
+ rubygems_version: 2.5.1
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: Simple, powerful visit tracking for Rails