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

DRY up selectize users helpers #2074

Merged
merged 1 commit into from
Jul 15, 2018
Merged

Conversation

bear454
Copy link
Contributor

@bear454 bear454 commented Jun 14, 2018

(cherry picked from commit eb38ddc)

Checklist

Short description of what this resolves/which issues does this fix?:

  • selectize... helpers had duplicate code.

Changes proposed in this pull request:

  • DRY up selectize... helpers.

@bear454 bear454 requested review from ChrisBr and Ana06 June 14, 2018 02:27
@bear454 bear454 force-pushed the selectize-user-helpers branch from bb29162 to d655247 Compare June 14, 2018 02:36
@codecov
Copy link

codecov bot commented Jun 14, 2018

Codecov Report

Merging #2074 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2074      +/-   ##
==========================================
+ Coverage   83.86%   83.87%   +<.01%     
==========================================
  Files         141      141              
  Lines        4698     4700       +2     
==========================================
+ Hits         3940     3942       +2     
  Misses        758      758
Impacted Files Coverage Δ
app/helpers/application_helper.rb 95.65% <100%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d40f4b4...d286191. Read the comment docs.

@bear454
Copy link
Contributor Author

bear454 commented Jun 15, 2018

This may make #2008 easier to resolve ;-)

@@ -24,7 +24,6 @@
:javascript
$(document).ready(function() {
$('#booth_responsible_ids').selectize({
plugins: ['remove_button'],
minItems: 2
Copy link
Member

Choose a reason for hiding this comment

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

how is that related? 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thanks!

form.input :speakers, as: :select,
collection: options_for_select(users.map {|user| ["#{user[1]} (#{user[2]}) #{user[3]}", user[0]]}, @event.speakers.map(&:id)),
include_blank: false, label: 'Speakers', input_html: { class: 'select-help-toggle', multiple: 'true' }
# users = User.active.pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase }
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't those comments be removed as well? 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes... sorry I forgot to remove those.

(cherry picked from commit eb38ddc)
@bear454 bear454 force-pushed the selectize-user-helpers branch from d655247 to d286191 Compare June 16, 2018 00:14
@bear454 bear454 requested a review from differentreality July 13, 2018 16:10
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

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

😉

@Ana06 Ana06 merged commit ebdb5ca into openSUSE:master Jul 15, 2018
@bear454
Copy link
Contributor Author

bear454 commented Jul 16, 2018

Thanks!

@bear454 bear454 deleted the selectize-user-helpers branch July 16, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants