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