2012-04-10 19:57:18 +00:00
|
|
|
class GettingStartedController < ApplicationController
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
|
|
|
# check if first user already exists
|
|
|
|
master_user = 0
|
|
|
|
count = User.all.count()
|
2012-07-14 07:11:24 +00:00
|
|
|
if count >= 2
|
2012-04-10 19:57:18 +00:00
|
|
|
master_user = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
# get all groups
|
|
|
|
@groups = Group.where( :active => true )
|
|
|
|
|
|
|
|
# return result
|
2012-04-11 06:34:56 +00:00
|
|
|
render :json => {
|
|
|
|
:master_user => master_user,
|
|
|
|
:groups => @groups,
|
|
|
|
}
|
2012-04-10 19:57:18 +00:00
|
|
|
end
|
|
|
|
end
|