engine_migration_initializer 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: 506ea881267f96bf0163d4b59dbe524efe33bea3
4
- data.tar.gz: 4216644d6a45d1b4569f183a3ce9a0e1cacffaa1
3
+ metadata.gz: e5f8d2dc7c2519e3a9b7073158398d7c856de1b5
4
+ data.tar.gz: 37959cbb65283efb4b8b0344dc5df3962b120c40
5
5
  SHA512:
6
- metadata.gz: ccb8a67b35d2910cf959955c39ca04364cdb1becabccb19c3ef918d4cb1a1dafd11c387d5bfd27457f2bb20f500c3805ff69f2865827f2689aac7ea0ea836cdc
7
- data.tar.gz: abf4f9735484d5182b99834542c293e3396e750052e7d6c8a0296b674d90e05e1f02159c368f7166ed0e714abad11f4508a5d05677fea0c40db05688a36a9482
6
+ metadata.gz: 6c10a379f2b2637b91c07fd7eaa6f5cc524c39a51cd60ef73754c824de64e29abdc91828f3881269351bf86990449017cd0edccc8df314f38996bfd44db09c37
7
+ data.tar.gz: 9270e619b67cd89a4a4fa9c18026e9730b99ed187c7fd70d6765ed4c07cb6c3fcf9b4848ebaba6a64a99293b2728205037b2b2a114b6cbbfd2a191612536fefb
@@ -3,21 +3,23 @@ require "engine_migration_initializer/version"
3
3
  # `extend` your engine's engine.rb with this module to
4
4
  # have your host app load your engine's migrations
5
5
  module EngineMigrationInitializer
6
- initializer :append_migrations do |app|
7
- case Rails::VERSION::MAJOR
8
- when 3
9
- unless app.root.to_s.match root.to_s
10
- app.config.paths["db/migrate"] += config.paths["db/migrate"].expanded
11
- end
12
- else # Tested w/ Rails 4
13
- begin
6
+ def self.extended(base)
7
+ base.initializer :append_migrations do |app|
8
+ case Rails::VERSION::MAJOR
9
+ when 3
14
10
  unless app.root.to_s.match root.to_s
15
- config.paths["db/migrate"].expanded.each do |expanded_path|
16
- app.config.paths["db/migrate"] << expanded_path
11
+ app.config.paths["db/migrate"] += config.paths["db/migrate"].expanded
12
+ end
13
+ else # Tested w/ Rails 4
14
+ begin
15
+ unless app.root.to_s.match root.to_s
16
+ config.paths["db/migrate"].expanded.each do |expanded_path|
17
+ app.config.paths["db/migrate"] << expanded_path
18
+ end
17
19
  end
20
+ rescue => e
21
+ raise "EngineMigrationInitializer did not know how to append_migrations for Rails v#{Rails::VERSION::MAJOR}\nError was: #{e.class} #{e.message}"
18
22
  end
19
- rescue => e
20
- raise "EngineMigrationInitializer did not know how to append_migrations for Rails v#{Rails::VERSION::MAJOR}\nError was: #{e.class} #{e.message}"
21
23
  end
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module EngineMigrationInitializer
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: engine_migration_initializer
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
  - Diego Salazar