good_migrations 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 300eaa36799b25cbfd31a71d5402f341b0ce5092
4
- data.tar.gz: 120d0e6a21210da185e386ab9a3413e59fa36048
3
+ metadata.gz: 05eb20b7481ddae6720347b0c84275997ff53e72
4
+ data.tar.gz: b7c85f764f8f2c22a3988517f2c272cdb59d0016
5
5
  SHA512:
6
- metadata.gz: 973fd6176fb703e45a5fa1ebcd33691a7ab2ca03d89a3f7764472f91928aebfd49b9535a4a8519f9620150d9dc868cd7283d916f2c9a85f3be2959a8c6bff7ab
7
- data.tar.gz: 1590102bea210bd1f4edaf8f1dfd6c1d94cad99720c4da13d89f6416191857a1e830059bfdbb01ed76aaf8e6b33217bef22b08fa27f72206b0213c8423236872
6
+ metadata.gz: b79f08edebb75e97c2358064c31d8c5d2de7e4cb483b5e4f7e61a4fe04b6550156c271995249af7327a66b1f5767269830ec0fe01b7144a4fcaa6a257d244689
7
+ data.tar.gz: 285bfb5be43c16860c0e6bff42c5e024d24199d4a9a84e9de1f946d04a979bbac87156c0603124c87aac80aecef81f0cd47690daf699bf27c73f2770ad0465fc
@@ -2,6 +2,8 @@ language: ruby
2
2
  sudo: false
3
3
  rvm:
4
4
  - 2.2.3
5
+ before_script:
6
+ - cd example && bundle install
5
7
  env:
6
8
  - RAILS_ENV=3.1.0
7
9
  - RAILS_ENV=4.0.0
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # good_migrations
2
2
 
3
- **tl;dr: prevent loading app code from migrations by adding `good_migrations` to
4
- your Gemfile**
3
+ [![Build Status](https://travis-ci.org/testdouble/good-migrations.svg?branch=master)](https://travis-ci.org/testdouble/good-migrations)
4
+
5
+ This gem prevents Rails from auto-loading app code while it's running migrations,
6
+ preventing the common mistake of referencing ActiveRecord models from migration
7
+ code.
5
8
 
6
9
  ## Usage
7
10
 
@@ -30,12 +33,12 @@ That means that if your migrations reference the ActiveRecord model objects
30
33
  you've defined in `app/models`, your old migrations are likely to break. That's
31
34
  not good.
32
35
 
33
- By adding this gem to your project's `Gemfile`, autoloading paths inside 'app/`
36
+ By adding this gem to your project's `Gemfile`, autoloading paths inside `'app/'`
34
37
  while running any of the `db:migrate` Rake tasks will raise an error, explaining
35
38
  the dangers inherent.
36
39
 
37
40
  Some will reply, "who cares if old migrations are broken? I can still run `rake
38
- db:setup` because I have a `db/schema.rb file". The problem with this approach
41
+ db:setup` because I have a `db/schema.rb` file". The problem with this approach
39
42
  is that, so long as some migrations aren't runnable, the `db/schema.rb` can't
40
43
  be regenerated from scratch and its veracity can no longer be trusted. In
41
44
  practice, we've seen numerous projects accumulate cruft in `db/schema.rb` as the
@@ -43,6 +46,9 @@ result of erroneous commits to work-in-progress migrations, leading to the
43
46
  development and test databases falling out of sync with production. That's not
44
47
  good!
45
48
 
49
+ For more background, see the last section of this blog post on [healthy migration
50
+ habits](http://blog.testdouble.com/posts/2014-11-04-healthy-migration-habits.html)
51
+
46
52
  ## Options
47
53
 
48
54
  There's no public API to this gem. If you want to work around its behavior, you
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "railties", ">= 3.1"
22
+ spec.add_dependency "activerecord", ">= 3.1"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.10"
24
25
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,3 +1,3 @@
1
1
  module GoodMigrations
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '3.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: activerecord
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '3.1'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '3.1'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: bundler
30
44
  requirement: !ruby/object:Gem::Requirement