summaryrefslogtreecommitdiffstats
path: root/app/views/enumerations/index.api.rsb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-17 17:29:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-17 17:29:27 +0000
commitd62b90db7327be488007d382f84c469f9fbe4ffe (patch)
tree153cfe41553b040154ecc89605b797864a76f3c1 /app/views/enumerations/index.api.rsb
parentfcb22595d0e87a2d04fb0210c775efdab6cfffa6 (diff)
downloadredmine-d62b90db7327be488007d382f84c469f9fbe4ffe.tar.gz
redmine-d62b90db7327be488007d382f84c469f9fbe4ffe.zip
Makes enumerations available through the REST API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10664 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/enumerations/index.api.rsb')
-rw-r--r--app/views/enumerations/index.api.rsb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/views/enumerations/index.api.rsb b/app/views/enumerations/index.api.rsb
new file mode 100644
index 000000000..2fc70b987
--- /dev/null
+++ b/app/views/enumerations/index.api.rsb
@@ -0,0 +1,9 @@
+api.array @klass.name.underscore.pluralize do
+ @enumerations.each do |enumeration|
+ api.__send__ @klass.name.underscore do
+ api.id enumeration.id
+ api.name enumeration.name
+ api.is_default enumeration.is_default
+ end
+ end
+end