Add helper function for speaker selection
The line '@users = User.all.order(:name)' is replicated a lot of times in EventsController and ProposalsController. So, this commit removes it and adds a helper function 'speaker_selector_input' that generates the field where the @users variable was used. Also, it makes the query more specific. Fix #1455 Other changes: * Include the username in the drop down menu * Add .active scope to User and corresponding tests * Add :disabled trait to User factory
This commit is contained in:
parent
36b8088726
commit
fa56ff7f6d
7 changed files with 25 additions and 9 deletions
|
|
@ -29,6 +29,7 @@ FactoryGirl.define do
|
|||
Quisque cursus facilisis consequat. Etiam volutpat ligula turpis, at
|
||||
gravida.
|
||||
EOS
|
||||
is_disabled false
|
||||
|
||||
after(:create) do |user|
|
||||
user.is_admin = false
|
||||
|
|
@ -44,6 +45,10 @@ FactoryGirl.define do
|
|||
user.save!
|
||||
end
|
||||
end
|
||||
|
||||
trait :disabled do
|
||||
is_disabled true
|
||||
end
|
||||
end
|
||||
|
||||
factory :user_xss, parent: :user do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue