Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Need to require rails/generators explicitly for custom generators #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Require `rails/generators` in custom generators to fix `uninitialized constant Generators::Base`

## [2.1.1] - 2017-02-11
### Fixed
- Stop trying to retrieve user from empty payload when no token is given
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/knock/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'rails/generators'

module Knock
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/knock/token_controller_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'rails/generators'

module Knock
class TokenControllerGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20150713101607_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateUsers < ActiveRecord::Migration
class CreateUsers < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|
t.string :email, unique: true, null: false
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20160519075733_create_admins.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateAdmins < ActiveRecord::Migration
class CreateAdmins < ActiveRecord::Migration[4.2]
def change
create_table :admins do |t|
t.string :email
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20160522051816_create_vendors.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateVendors < ActiveRecord::Migration
class CreateVendors < ActiveRecord::Migration[4.2]
def change
create_table :vendors do |t|
t.string :email
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateCompositeNameEntities < ActiveRecord::Migration
class CreateCompositeNameEntities < ActiveRecord::Migration[4.2]
def change
create_table :composite_name_entities do |t|
t.string :email
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20161127203222_create_v1_users.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateV1Users < ActiveRecord::Migration
class CreateV1Users < ActiveRecord::Migration[4.2]
def change
create_table :v1_users do |t|

Expand Down