lib/acfs/model/locatable.rb in acfs-0.30.0.1.b261 vs lib/acfs/model/locatable.rb in acfs-0.30.0.1.b262
- old
+ new
@@ -81,17 +81,18 @@
def location(opts = {})
service.location(self, opts)
end
# @api private
- def path_defaults
- {
- list: '/:path',
- create: '/:path',
- read: '/:path/:id',
- update: '/:path/:id',
- delete: '/:path/:id'
- }
+ def location_default_path(action, path)
+ case action
+ when :list, :create
+ return path
+ when :read, :update, :delete
+ return "#{path}/:id"
+ else
+ nil
+ end
end
end
# Return URL for this resource. Resource if will be appended
# as suffix if present.