Cross Reference: logic.rb
xref
: /
ontohub
/
app
/
models
/
logic.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
logic.rb revision 040c1d8fca47a84f09d96ca3c21caa0a2ed91e05
class
Logic
<
ActiveRecord
::
Base
has_many
:
ontologies
attr_accessible
:
name
, :
uri
, :
extension
, :
mimetype
validates_presence_of
:
name
validates_uniqueness_of
:
name
,
if
: :
name_changed
?
validates_presence_of
:
uri
validates_uniqueness_of
:
uri
,
if
: :
uri_changed
?
validates_format_of
:
uri
,
with
:
URI
::
regexp
(
ALLOWED_URI_SCHEMAS
)
validates
:
extension
,
length
:
{
minimum
:
1
,
maximum
:
10
}
validates_format_of
:
mimetype
,
with
: /.*\/.*/
def
to_s
name
end
end