- Class name "Missions_user" should match pattern /^[A-Z][a-zA-Z0-9]*$/ » roodi
|
1class Missions_user <ActiveRecord:: Base
|
|
|
|
3 validates :mission_id, presence: true
|
|
4 validates :user_id, presence: true
|
|
|
|
6 validate :mission_exist, on: :create
|
|
7 validate :user_exist, on: :create
|
|
|
|
|
- Complexity 2 » saikuro
- NilCheck - performs a nil-check » reek
|
|
|
|
|
12 mission = Mission.find_by(id: mission_id)
|
|
|
|
14 errors[:mission] = "mission belong to Missions_user is not exist"
|
|
|
|
|
|
|
|
|
|
|
- Complexity 2 » saikuro
- NilCheck - performs a nil-check » reek
|
|
|
|
|
22 user = User.find_by(id: user_id)
|
|
|
|
24 errors[:user] = "user belong to Missions_user is not exist"
|
|
|
|
|
|
|
|
|
|
|
|
|