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
|
||||
|
||||
# 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.
|
||||
#
|
||||
def pretty_fullpath
|
||||
|
@ -40,7 +40,7 @@ module Locomotive
|
||||
## validations ##
|
||||
validates_presence_of :site, :title, :slug
|
||||
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 }
|
||||
|
||||
## named scopes ##
|
||||
|
Loading…
Reference in New Issue
Block a user