Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Rails version to create_shops generator template #423

Merged
merged 1 commit into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
7.2.10
-----
* Fix an issue with the create_shops generator template
[[#423]](https://github.com/Shopify/shopify_app/pull/423)

7.2.9
-----
* Remove support for Rails 4
Expand Down
10 changes: 3 additions & 7 deletions lib/generators/shopify_app/shop_model/shop_model_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create_shop_model
end

def create_shop_migration
copy_migration 'create_shops.rb'
migration_template "db/migrate/create_shops.erb", "db/migrate/create_shops.rb"
end

def create_session_storage_initializer
Expand All @@ -25,12 +25,8 @@ def create_shop_fixtures

private

def copy_migration(migration_name, config = {})
migration_template(
"db/migrate/#{migration_name}",
"db/migrate/#{migration_name}",
config
)
def rails_migration_version
Rails.version.match(/\d\.\d/)[0]
end

# for generating a timestamp when using `create_migration`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateShops < ActiveRecord::Migration
class CreateShops < ActiveRecord::Migration[<%= rails_migration_version %>]
def self.up
create_table :shops do |t|
t.string :shopify_domain, null: false
Expand Down
2 changes: 1 addition & 1 deletion lib/shopify_app/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ShopifyApp
VERSION = '7.2.9'
VERSION = '7.2.10'
end