handle is unique within the scope of a site
This commit is contained in:
parent
14596a5443
commit
63fd77f950
@ -47,7 +47,7 @@ module Locomotive
|
|||||||
end
|
end
|
||||||
|
|
||||||
# It returns a pretty output of the fullpath. The "*" characters
|
# It returns a pretty output of the fullpath. The "*" characters
|
||||||
# are replaced by the following pattern ":<slug>" like you can find
|
# are replaced by the following pattern ":<slug>" like the ones you can find
|
||||||
# in the Ruby on Rails routes.
|
# in the Ruby on Rails routes.
|
||||||
#
|
#
|
||||||
def pretty_fullpath
|
def pretty_fullpath
|
||||||
|
@ -40,7 +40,7 @@ module Locomotive
|
|||||||
## validations ##
|
## validations ##
|
||||||
validates_presence_of :site, :title, :slug
|
validates_presence_of :site, :title, :slug
|
||||||
validates_uniqueness_of :slug, :scope => [:site_id, :parent_id]
|
validates_uniqueness_of :slug, :scope => [:site_id, :parent_id]
|
||||||
validates_uniqueness_of :handle, :allow_blank => true
|
validates_uniqueness_of :handle, :allow_blank => true, :scope => [:site_id]
|
||||||
validates_exclusion_of :slug, :in => Locomotive.config.reserved_slugs, :if => Proc.new { |p| p.depth <= 1 }
|
validates_exclusion_of :slug, :in => Locomotive.config.reserved_slugs, :if => Proc.new { |p| p.depth <= 1 }
|
||||||
|
|
||||||
## named scopes ##
|
## named scopes ##
|
||||||
|
Loading…
Reference in New Issue
Block a user