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
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
c3d334f6
Commit
c3d334f6
authored
8 years ago
by
Mauricio Giacomini Girardello
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.c3sl.ufpr.br:portalmec/portalmec
parents
c5fc6c7d
acd5b301
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/concerns/reputationable.rb
+6
-6
6 additions, 6 deletions
app/models/concerns/reputationable.rb
with
6 additions
and
6 deletions
app/models/concerns/reputationable.rb
+
6
−
6
View file @
c3d334f6
module
Reputationable
extend
ActiveSupport
::
Concern
included
do
delegate
:count
,
to: :followers
,
prefix:
true
end
def
submitted_objects
learning_objects
.
count
end
...
...
@@ -8,7 +12,7 @@ module Reputationable
def
reviews_score_average
scores
=
learning_objects
.
map
(
&
:review_ratings_average
)
return
0.0
if
scores
.
size
==
0
return
0.0
if
scores
.
empty?
scores
.
inject
(
0.0
)
{
|
a
,
e
|
a
+
e
}.
to_f
/
scores
.
size
.
to_f
end
...
...
@@ -35,14 +39,10 @@ module Reputationable
array
.
inject
(
0.0
)
{
|
a
,
e
|
a
+
e
}
/
array
.
size
end
def
followers_count
followers
.
count
end
def
learning_objects_recently_submitted
return
0.0
if
learning_objects
.
nil?
learning_objects
.
where
(
'created_at >= ?'
,
(
Time
.
now
-
2
.
months
)).
count
learning_objects
.
where
(
'created_at >= ?'
,
(
Time
.
current
-
2
.
months
)).
count
end
def
collections_score_average
...
...
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