Skip to content

Commit

Permalink
chore: fix intendation in role model (#495)
Browse files Browse the repository at this point in the history
Add proper indentation in role model's template
  • Loading branch information
Neznauy authored and EppO committed Mar 1, 2019
1 parent bb3d445 commit e6d59b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
27 changes: 13 additions & 14 deletions lib/generators/active_record/templates/model.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
has_and_belongs_to_many :<%= user_class.table_name %>, :join_table => :<%= join_table %>
has_and_belongs_to_many :<%= user_class.table_name %>, :join_table => :<%= join_table %>
<% if Rails::VERSION::MAJOR < 5 %>
belongs_to :resource,
:polymorphic => true
<% else %>
belongs_to :resource,
:polymorphic => true,
:optional => true
<% end %>

<% if Rails::VERSION::MAJOR < 5 %>
belongs_to :resource,
:polymorphic => true
<% else %>
belongs_to :resource,
:polymorphic => true,
:optional => true
<% end %>
validates :resource_type,
:inclusion => { :in => Rolify.resource_types },
:allow_nil => true

validates :resource_type,
:inclusion => { :in => Rolify.resource_types },
:allow_nil => true

scopify
scopify
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class User < ActiveRecord::Base
it { should contain "validates :resource_type,\n"
" :inclusion => { :in => Rolify.resource_types },\n"
" :allow_nil => true" }
it { should contain "scopify" }
end

describe 'app/models/user.rb' do
Expand Down

0 comments on commit e6d59b0

Please sign in to comment.