Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/generators/zuul/permission_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class PermissionGenerator < ActiveRecord::Generators::Base

def copy_zuul_migration
if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(:permission, table_name))
migration_template "permission_existing.rb", "db/migrate/add_zuul_permission_to_#{table_name}"
migration_template "permission_existing.rb", "db/migrate/add_zuul_permission_to_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [109/80]

else
migration_template "permission.rb", "db/migrate/zuul_permission_create_#{table_name}"
migration_template "permission.rb", "db/migrate/zuul_permission_create_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [100/80]

end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/generators/zuul/permission_role_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ class PermissionRoleGenerator < ActiveRecord::Generators::Base
def name
[permission_model, role_model].sort.map(&:to_s).map(&:camelize).map(&:singularize).join("")
end

def copy_permission_role_migration
attributes << Rails::Generators::GeneratedAttribute.new("#{permission_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("#{role_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("context_type", :string)
attributes << Rails::Generators::GeneratedAttribute.new("context_id", :integer)

if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(:permission_role, table_name))
migration_template "permission_role_existing.rb", "db/migrate/add_zuul_permission_role_to_#{table_name}"
migration_template "permission_role_existing.rb", "db/migrate/add_zuul_permission_role_to_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [119/80]

else
migration_template "permission_role.rb", "db/migrate/zuul_permission_role_create_#{table_name}"
migration_template "permission_role.rb", "db/migrate/zuul_permission_role_create_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [110/80]

end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/generators/zuul/permission_subject_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ class PermissionSubjectGenerator < ActiveRecord::Generators::Base
def name
[permission_model, subject_model].sort.map(&:to_s).map(&:camelize).map(&:singularize).join("")
end

def copy_permission_subject_migration
attributes << Rails::Generators::GeneratedAttribute.new("#{permission_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("#{subject_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("context_type", :string)
attributes << Rails::Generators::GeneratedAttribute.new("context_id", :integer)

if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(:permission_subject, table_name))
migration_template "permission_subject_existing.rb", "db/migrate/add_zuul_permission_subject_to_#{table_name}"
migration_template "permission_subject_existing.rb", "db/migrate/add_zuul_permission_subject_to_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [125/80]

else
migration_template "permission_subject.rb", "db/migrate/zuul_permission_subject_create_#{table_name}"
migration_template "permission_subject.rb", "db/migrate/zuul_permission_subject_create_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [116/80]

end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/generators/zuul/role_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class RoleGenerator < ActiveRecord::Generators::Base

include ::Zuul::Generators::OrmHelpers
source_root File.expand_path("../templates", __FILE__)

def copy_role_migration
if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(:role, table_name))
migration_template "role_existing.rb", "db/migrate/add_zuul_role_to_#{table_name}"
migration_template "role_existing.rb", "db/migrate/add_zuul_role_to_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [97/80]

else
migration_template "role.rb", "db/migrate/zuul_role_create_#{table_name}"
migration_template "role.rb", "db/migrate/zuul_role_create_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [88/80]

end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/generators/zuul/role_subject_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ class RoleSubjectGenerator < ActiveRecord::Generators::Base
def name
[role_model, subject_model].sort.map(&:to_s).map(&:camelize).map(&:singularize).join("")
end

def copy_role_subject_migration
attributes << Rails::Generators::GeneratedAttribute.new("#{role_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("#{subject_model.to_s.underscore.singularize}_id", :integer)
attributes << Rails::Generators::GeneratedAttribute.new("context_type", :string)
attributes << Rails::Generators::GeneratedAttribute.new("context_id", :integer)

if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(:role_subject, table_name))
migration_template "role_subject_existing.rb", "db/migrate/add_zuul_role_subject_to_#{table_name}"
migration_template "role_subject_existing.rb", "db/migrate/add_zuul_role_subject_to_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [113/80]

else
migration_template "role_subject.rb", "db/migrate/zuul_role_subject_create_#{table_name}"
migration_template "role_subject.rb", "db/migrate/zuul_role_subject_create_#{table_name}.rb"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [104/80]

end
end

Expand Down