Cross Reference: logic_adjoint.rb
xref
: /
ontohub
/
app
/
models
/
logic_adjoint.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
logic_adjoint.rb revision ca68055161f6beb2ec248e789ab787e6de69bd18
class
LogicAdjoint
<
ActiveRecord
::
Base
include
Resourcable
include
Permissionable
belongs_to
:
translation
,
class_name
:
'LogicMapping'
belongs_to
:
projection
,
class_name
:
'LogicMapping'
belongs_to
:
user
validates_presence_of
:
translation
, :
projection
, :
iri
after_create
:
add_permission
attr_accessible
:
iri
, :
translation
, :
projection
, :
translation_id
, :
projection_id
def
to_s
"#{iri}: #{translation} ADJOINTS #{projection}"
end
private
def
add_permission
permissions.create
! :
subject
=>
self.user
, :
role
=>
'owner'
if
self.user
end
end