-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/add event models #34
base: master
Are you sure you want to change the base?
Conversation
@event = Event.find(params[:id]) | ||
end | ||
|
||
def update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar code found in events_controller.rb:34, users_controller.rb:35 (mass = 56) [flay:warning]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore
redirect_to edit_user_path | ||
end | ||
end | ||
def update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar code found in events_controller.rb:34, users_controller.rb:35 (mass = 56) [flay:warning]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore
app/views/events/_form.html.erb
Outdated
@@ -0,0 +1,45 @@ | |||
<%= form_for @event do |form| %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :title, 'Título' %> | ||
<%= form.text_field :title, class: 'form-control', :value => @event.title %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :semester, 'Tipo' %> | ||
<%= form.text_field :semester, class: 'form-control', :value => @event.semester %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :url, 'URL' %> | ||
<%= form.text_field :url, class: 'form-control', :value => @event.url %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :start, 'Data início' %> | ||
<%= form.text_field :start, id: 'datepickerstart', class: 'form-control', :value => @event.start %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :end, 'Data fim' %> | ||
<%= form.text_field :end, id: 'datepickerend', class: 'form-control', :value => @event.end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
app/views/events/_form.html.erb
Outdated
|
||
<div class="field"> | ||
<%= form.label :repeating, 'Repetindo' %> | ||
<%= form.text_field :repeating, class: 'form-control', :value => @event.repeating %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<div class="alert alert-danger"> | ||
The form contains <%= pluralize(@user.errors.count, "error") %>. | ||
<% @select = yield(:modelo) %> | ||
<% puts @select %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
The form contains <%= pluralize(@user.errors.count, "error") %>. | ||
<% @select = yield(:modelo) %> | ||
<% puts @select %> | ||
<% if @select == "user" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<% @select = yield(:modelo) %> | ||
<% puts @select %> | ||
<% if @select == "user" %> | ||
<% if @user.errors.any? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<% if @user.errors.any? %> | ||
<div id="error_explanation"> | ||
<div class="alert alert-danger"> | ||
The form contains <%= pluralize(@user.errors.count, "error") %>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
The form contains <%= pluralize(@user.errors.count, "error") %>. | ||
</div> | ||
<ul> | ||
<% @user.errors.full_messages.each do |msg| %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<% end %> | ||
<% elsif @select == 'event' %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<% end %> | ||
<% elsif @select == 'event' %> | ||
<% puts @event.errors.any? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
<% elsif @select == 'event' %> | ||
<% puts @event.errors.any? %> | ||
<% if @event.errors.any? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace instance variable with local variable [rails_best_practices:warning]
Dangerfile
Outdated
markdown(message) | ||
|
||
warn "Still Work in Progress" if github.pr_title.include? "WIP" | ||
if (git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an if
. [rubocop:warning]
Dangerfile
Outdated
markdown(message) | ||
|
||
warn "Still Work in Progress" if github.pr_title.include? "WIP" | ||
if (git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [84/80] [rubocop:warning]
Dangerfile
Outdated
|
||
warn "Still Work in Progress" if github.pr_title.include? "WIP" | ||
if (git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?) | ||
warn "What is the point of this PR if you have not changed anything?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. [rubocop:warning]
Dangerfile
Outdated
warn "What is the point of this PR if you have not changed anything?" | ||
end | ||
|
||
if git.added_files.include?('db/migrate/*.rb') && !git.modified_files.include?('db/schema.rb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [94/80] [rubocop:warning]
Dangerfile
Outdated
|
||
markdown(message) | ||
|
||
warn "Still Work in Progress" if github.pr_title.include? "WIP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. [rubocop:warning]
Dangerfile
Outdated
|
||
warn "Still Work in Progress" if github.pr_title.include? "WIP" | ||
|
||
if git.added_files.include?('db/migrate/*.rb') && !git.modified_files.include?('db/schema.rb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [94/80] [rubocop:warning]
…iles that don't have allowed characters
Dangerfile
Outdated
|
||
markdown(message) | ||
|
||
<!-- warn "Still Work in Progress" if github.pr_title.include? "WIP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tLT
(Using Ruby 2.4 parser; configure using TargetRubyVersion
parameter, under AllCops
) [rubocop:error]
Dangerfile
Outdated
|
||
markdown(message) | ||
|
||
<!-- warn "Still Work in Progress" if github.pr_title.include? "WIP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tSTRING
(Using Ruby 2.4 parser; configure using TargetRubyVersion
parameter, under AllCops
) [rubocop:error]
Dangerfile
Outdated
|
||
if git.added_files.include?('db/migrate/*.rb') && !git.modified_files.include?('db/schema.rb') | ||
warn('Run `db:migrate` and commit `schema.rb` file') | ||
end --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tNL
(Using Ruby 2.4 parser; configure using TargetRubyVersion
parameter, under AllCops
) [rubocop:error]
Dangerfile
Outdated
|
||
# TESTS | ||
|
||
<!-- has_app_changes = !git.modified_files.grep(/(lib|app)/).empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tLT
(Using Ruby 2.4 parser; configure using TargetRubyVersion
parameter, under AllCops
) [rubocop:error]
Dangerfile
Outdated
MESSAGE | ||
|
||
warn(message.strip) | ||
end --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tNL
(Using Ruby 2.4 parser; configure using TargetRubyVersion
parameter, under AllCops
) [rubocop:error]
@event = Event.find(params[:id]) | ||
end | ||
|
||
def update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar code found in events_controller.rb:37, users_controller.rb:35 (mass = 56) [flay:warning]
redirect_to edit_user_path | ||
end | ||
end | ||
def update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar code found in events_controller.rb:37, users_controller.rb:35 (mass = 56) [flay:warning]
resources :users | ||
resources :events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restrict auto-generated routes events (only: []) [rails_best_practices:warning]
flash[:notice] = "Email enviado com sucesso!" | ||
redirect_to contact_path | ||
end | ||
nome = parametros['name'].to_s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refers to 'parametros' more than self (maybe move it to another class?) (FeatureEnvy) [reek:info]
create_table "events", force: :cascade do |t| | ||
t.string "title" | ||
t.integer "semester" | ||
t.datetime "start" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [86/80] [rubocop:warning]
t.datetime "start" | ||
t.datetime "end" | ||
t.boolean "allday" | ||
t.integer "repeating" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [86/80] [rubocop:warning]
t.boolean "allday" | ||
t.integer "repeating" | ||
t.string "url" | ||
t.datetime "created_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/NumericLiterals: Use underscores(_) as decimal mark and separate every 3 digits with them. [rubocop:warning]
t.integer "repeating" | ||
t.string "url" | ||
t.datetime "created_at", null: false | ||
t.datetime "updated_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. [rubocop:warning]
t.datetime "created_at", null: false | ||
t.datetime "updated_at", null: false | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. [rubocop:warning]
Still working on it, but basically what I did was:
I'll add more information here later
This fixes #10 , #8 , #19