draftsman 0.7.0 → 0.7.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: 8b81db1f80bb1d8742793931418a05f425f4574d
4
- data.tar.gz: 40e32fd2383a15cc1e8e96552e63220faf0c4784
3
+ metadata.gz: 0354f5b470dbf046ad2a67b53ee7c5cb38b2f56f
4
+ data.tar.gz: '02991570b7c9f925f6ccf3dd753b55111ef883bd'
5
5
  SHA512:
6
- metadata.gz: 6b3e3e7a21e4078e32d66726366674d1bc0af4eb68fdb7aeec02d82dcb8d0c96f09be4366d3239dbee20b3363758507fbb608b5e5b2c3b04da510a0a003c4a2c
7
- data.tar.gz: c97dd6e0a81c69d5c5d83ba034b8fceb6db7fee0fa54da1c8b62bc73ee5550c9812e74754910796172d338bdc0549e1cd1afa8708d696c74900136dfe0278bf9
6
+ metadata.gz: cb447f51ca4d0f28041119d789c3b2100590da7db8f2f54dfe305c30bc446ed02b7c75af32cacd9e23769f9f40dcb0bdd278f592493df223de935232900519f3
7
+ data.tar.gz: 2668c0c599f3c9439931b06e82ed00edb385abfbb3d5f09052af6afdcec7107009cc2c22cee5a1788798e8ffe972f1616950a993bff37cf43dfe087ab982730d
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.7.1 - December 24, 2017
4
+
5
+ ### Bug Fixes
6
+
7
+ - [@jmfederico](https://github.com/jmfederico)
8
+ [fixed](https://github.com/jmfederico/draftsman/commit/ff46e510c7d82331fcad7ea1eb2d2d2728ed1bd5)
9
+ [#73](https://github.com/jmfederico/draftsman/issues/73)
10
+ Rails 5 migration error
11
+
12
+
3
13
  ## 0.7.0 - June 12, 2017
4
14
 
5
15
  ### Enhancements
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Draftsman v0.7.0
1
+ # Draftsman v0.7.1
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/liveeditor/draftsman.svg?branch=master)](http://travis-ci.org/liveeditor/draftsman)
3
+ [![Build Status](https://travis-ci.org/jmfederico/draftsman.svg?branch=0.7-stable)](https://travis-ci.org/jmfederico/draftsman)
4
4
 
5
5
  Draftsman is a Ruby gem that lets you create draft versions of your database
6
6
  records. If you're developing a system in need of simple drafts or a publishing
@@ -64,13 +64,13 @@ ActiveRecord.
64
64
  Add Draftsman to your `Gemfile`.
65
65
 
66
66
  ```ruby
67
- gem 'draftsman', '~> 0.7.0'
67
+ gem 'draftsman', '~> 0.7.1'
68
68
  ```
69
69
 
70
70
  Or if you want to grab the latest from `master`:
71
71
 
72
72
  ```ruby
73
- gem 'draftsman', github: 'liveeditor/draftsman'
73
+ gem 'draftsman', github: 'jmfederico/draftsman'
74
74
  ```
75
75
 
76
76
  Generate a migration which will add a `drafts` table to your database.
@@ -120,7 +120,7 @@ your app with Draftsman will look something like this:
120
120
  Add Draftsman to your `Gemfile`.
121
121
 
122
122
  ```ruby
123
- gem 'draftsman', github: 'liveeditor/draftsman'
123
+ gem 'draftsman', github: 'jmfederico/draftsman'
124
124
  ```
125
125
 
126
126
  Generate a migration to add a `drafts` table to your database.
@@ -144,7 +144,7 @@ Draftsman provides a helper extension that acts similarly to the controller
144
144
  mixin it provides for Rails applications.
145
145
 
146
146
  It will set `Draftsman::Draft#whodunnit` to whatever is returned by a method
147
- named `user_for_paper_trail`, which you can define inside your Sinatra
147
+ named `user_for_draftsman`, which you can define inside your Sinatra
148
148
  application. (By default, it attempts to invoke a method named `current_user`.)
149
149
 
150
150
  If you're using the modular [`Sinatra::Base`][8] style of application, you will
@@ -611,8 +611,8 @@ included, please do the following:
611
611
 
612
612
  2. Run `bundle install`.
613
613
 
614
- 3. Run `RAILS_ENV=test bundle exec rake -f spec/dummy/
615
- Rakefile db:schema:load` to load test database schema.
614
+ 3. Run `RAILS_ENV=test bundle exec rake -f spec/dummy/Rakefile db:schema:load`
615
+ to load test database schema.
616
616
 
617
617
  4. Add at least one test for your change. Only refactoring and documentation
618
618
  changes require no new tests. If you are adding functionality or fixing a
@@ -648,7 +648,7 @@ Draftsman is released under the [MIT License][9].
648
648
  [4]: http://railscasts.com/episodes/416-form-objects
649
649
  [5]: http://www.sinatrarb.com/
650
650
  [6]: https://github.com/janko-m/sinatra-activerecord
651
- [7]: https://raw.github.com/liveeditor/draftsman/master/lib/generators/draftsman/templates/create_drafts.rb
651
+ [7]: https://raw.github.com/jmfederico/draftsman/master/lib/generators/draftsman/templates/create_drafts.rb
652
652
  [8]: http://www.sinatrarb.com/intro.html#Modular%20vs.%20Classic%20Style
653
653
  [9]: http://www.opensource.org/licenses/MIT
654
654
  [10]: http://semver.org/
@@ -6,9 +6,9 @@ Gem::Specification.new do |s|
6
6
  s.version = Draftsman::VERSION
7
7
  s.summary = 'Create draft versions of your database records.'
8
8
  s.description = "Stores draft versions of your ActiveRecord models' data in a single table or split up into separate tables. Works with Ruby on Rails and Sinatra."
9
- s.homepage = 'https://github.com/liveeditor/draftsman'
10
- s.authors = ['Chris Peters']
11
- s.email = 'chris@minimalorange.com'
9
+ s.homepage = 'https://github.com/jmfederico/draftsman'
10
+ s.authors = ['Chris Peters', 'Federico Jaramillo']
11
+ s.email = ['chris@minimalorange.com', 'federicojaramillom@gmail.com']
12
12
  s.license = 'MIT'
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
@@ -1,3 +1,3 @@
1
1
  module Draftsman
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -2,6 +2,8 @@ require 'rails/generators'
2
2
  require 'rails/generators/migration'
3
3
  require 'rails/generators/active_record'
4
4
 
5
+ require 'support/feature_detection'
6
+
5
7
  module Draftsman
6
8
  class InstallGenerator < ::Rails::Generators::Base
7
9
  include ::Rails::Generators::Migration
@@ -13,19 +15,26 @@ module Draftsman
13
15
  class_option :with_pg_json, :type => :boolean, :default => false, :desc => 'Use PostgreSQL JSON data type for serialized data.'
14
16
 
15
17
  def create_migration_file
18
+
19
+ config = {
20
+ api_version: activerecord_migrations_versioned? ? '[4.2]' : ''
21
+ }
22
+
16
23
  if options.with_pg_json?
17
- migration_template 'create_drafts_json.rb', 'db/migrate/create_drafts.rb'
24
+ migration_template 'create_drafts_json.rb', 'db/migrate/create_drafts.rb', config
18
25
 
19
26
  if options.with_changes?
20
27
  migration_template 'add_object_changes_column_to_drafts_json.rb',
21
- 'db/migrate/add_object_changes_column_to_drafts.rb'
28
+ 'db/migrate/add_object_changes_column_to_drafts.rb',
29
+ config
22
30
  end
23
31
  else
24
- migration_template 'create_drafts.rb', 'db/migrate/create_drafts.rb'
32
+ migration_template 'create_drafts.rb', 'db/migrate/create_drafts.rb', config
25
33
 
26
34
  if options.with_changes?
27
35
  migration_template 'add_object_changes_column_to_drafts.rb',
28
- 'db/migrate/add_object_changes_column_to_drafts.rb'
36
+ 'db/migrate/add_object_changes_column_to_drafts.rb',
37
+ config
29
38
  end
30
39
  end
31
40
  end
@@ -1,4 +1,4 @@
1
- class AddObjectChangesColumnToDrafts < ActiveRecord::Migration
1
+ class AddObjectChangesColumnToDrafts < ActiveRecord::Migration<%= config[:api_version] %>
2
2
  def self.up
3
3
  add_column :drafts, :object_changes, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddObjectChangesColumnToDrafts < ActiveRecord::Migration
1
+ class AddObjectChangesColumnToDrafts < ActiveRecord::Migration<%= config[:api_version] %>
2
2
  def self.up
3
3
  add_column :drafts, :object_changes, :json
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateDrafts < ActiveRecord::Migration
1
+ class CreateDrafts < ActiveRecord::Migration<%= config[:api_version] %>
2
2
  def change
3
3
  create_table :drafts do |t|
4
4
  t.string :item_type, :null => false
@@ -1,4 +1,4 @@
1
- class CreateDrafts < ActiveRecord::Migration
1
+ class CreateDrafts < ActiveRecord::Migration<%= config[:api_version] %>
2
2
  def change
3
3
  create_table :drafts do |t|
4
4
  t.string :item_type, :null => false
@@ -0,0 +1,4 @@
1
+ # Returns whether migrations need to be versioned.
2
+ def activerecord_migrations_versioned?
3
+ ActiveRecord::VERSION::MAJOR >= 5
4
+ end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draftsman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Peters
8
+ - Federico Jaramillo
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
12
+ date: 2017-12-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activerecord
@@ -108,7 +109,9 @@ dependencies:
108
109
  version: '1.2'
109
110
  description: Stores draft versions of your ActiveRecord models' data in a single table
110
111
  or split up into separate tables. Works with Ruby on Rails and Sinatra.
111
- email: chris@minimalorange.com
112
+ email:
113
+ - chris@minimalorange.com
114
+ - federicojaramillom@gmail.com
112
115
  executables: []
113
116
  extensions: []
114
117
  extra_rdoc_files: []
@@ -143,6 +146,7 @@ files:
143
146
  - lib/generators/draftsman/templates/config/initializers/draftsman.rb
144
147
  - lib/generators/draftsman/templates/create_drafts.rb
145
148
  - lib/generators/draftsman/templates/create_drafts_json.rb
149
+ - lib/support/feature_detection.rb
146
150
  - spec/controllers/informants_controller_spec.rb
147
151
  - spec/controllers/users_controller_spec.rb
148
152
  - spec/controllers/whodunnits_controller_spec.rb
@@ -208,7 +212,7 @@ files:
208
212
  - spec/models/whitelister_spec.rb
209
213
  - spec/spec_helper.rb
210
214
  - spec/support/feature_detection.rb
211
- homepage: https://github.com/liveeditor/draftsman
215
+ homepage: https://github.com/jmfederico/draftsman
212
216
  licenses:
213
217
  - MIT
214
218
  metadata: {}
@@ -228,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
232
  version: '0'
229
233
  requirements: []
230
234
  rubyforge_project:
231
- rubygems_version: 2.6.11
235
+ rubygems_version: 2.6.14
232
236
  signing_key:
233
237
  specification_version: 4
234
238
  summary: Create draft versions of your database records.