Cross Reference: logic.rb
xref
: /
ontohub
/
app
/
models
/
logic.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
logic.rb revision 9b39a422a5bbbd4550a9c30b66c5c289dcdca849
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
,
allow_blank
:
true
}
validates_format_of
:
mimetype
,
with
: /[
0
-
9
a-z+-]+\/[
0
-
9
a-z+-]+/,
allow_blank
:
true
def
to_s
name
end
end