Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
66c80712
Commit
66c80712
authored
9 years ago
by
Matheus Agio Nerone
Browse files
Options
Downloads
Patches
Plain Diff
adding new validations and new tests to languages model
Signed-off-by:
man13
<
man13@inf.ufpr.br
>
parent
380f680c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/language.rb
+2
-1
2 additions, 1 deletion
app/models/language.rb
test/models/language_test.rb
+10
-0
10 additions, 0 deletions
test/models/language_test.rb
with
12 additions
and
1 deletion
app/models/language.rb
+
2
−
1
View file @
66c80712
class
Language
<
ActiveRecord
::
Base
has_many
:learning_object
has_many
:learning_object
s
validates_uniqueness_of
:code
validates_presence_of
:name
,
:code
end
This diff is collapsed.
Click to expand it.
test/models/language_test.rb
0 → 100644
+
10
−
0
View file @
66c80712
require
'test_helper'
class
LanguageTest
<
ActiveSupport
::
TestCase
should
have_many
:learning_objects
should
validate_presence_of
(
:name
)
should
validate_presence_of
(
:code
)
should
validate_uniqueness_of
(
:code
)
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment