Cross Reference: key.rb
xref
: /
ontohub
/
app
/
models
/
key.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
key.rb revision 560baaad7d614c8aa6b7871e3a99ce33a137d93b
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
# A users SSH Key
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
class
Key
<
ActiveRecord
::
Base
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
include
Key
::
Fingerprint
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
belongs_to
:
user
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
attr_accessible
:
key
, :
name
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
strip_attributes
:
only
=> [:
key
, :
name
]
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
validates
:
name
,
presence
:
true
,
length
:
{
within
:
0
..
50
}
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
validates
:
key
,
presence
:
true
,
length
:
{
within
:
0
..
5000
},
format
:
{
with
: /\A
(
ssh
|
ecdsa
)
-.*\Z/ },
uniqueness
:
true
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
def
shell_id
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
"key-#{id}"
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
end
d1de19abd0067f38bc08a4a3357de701a4e5571d
dlezcano
end