Cross Reference:
xref
: /
ontohub
/
app
/
models
/
entity.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
entity.rb revision b2dbef8c73faa240d208f3ff9fb49b21d9a894a5
class
Entity
<
ActiveRecord
::
Base
include
Metadatable
include
Entity
::
Searching
belongs_to
:
ontology_version
has_and_belongs_to_many
:
sentences
scope
:
kind
, ->
(
kind
)
{
where
:
kind
=>
kind
}
delegate
:
ontology
, :
to
=> :
ontology_version
def
self.grouped
_by_kind
select
(
'kind, count(*) AS count'
)
.
group
(:
kind
)
.
order
(
'count DESC, kind'
)
.
all
end
end