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

Added validation for user_id and event_id in event_organizer #98

Merged
merged 1 commit into from Aug 17, 2017

Conversation

Projects
None yet
3 participants
@nikhilgupta1211
Contributor

nikhilgupta1211 commented Aug 17, 2017

As an event organizer cannot be created without a user and event. Added tests for these validations

Added validation for user_id and event_id in event_organizer
As an event organizer cannot be created without a user and event. Added tests for these validations
@coveralls

This comment has been minimized.

coveralls commented Aug 17, 2017

Coverage Status

Coverage increased (+0.004%) to 92.722% when pulling 21c8879 on nikhilgupta1211:createevntorg into c12fe46 on openSUSE:master.

@@ -4,6 +4,7 @@ class EventOrganizer < ActiveRecord::Base
attr_accessor(:user_email)
validates :user_email, presence: true
validates :user_email, :event_id, presence: true
validates :user_id, presence: { message: 'No such user exist' }
validates :user_id, uniqueness: { scope: :event_id, message: 'Already an event organizer for this event' }

This comment has been minimized.

@bgeuken

bgeuken Aug 17, 2017

Member

How about 'There already is an event organizer for this event'?

@bgeuken

Nice 👍

Just have one nitpick. See my comment.

@bgeuken bgeuken merged commit bad8a51 into openSUSE:master Aug 17, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.004%) to 92.722%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment