I have this app where if I am logged in as admin, I set the Group
model so that when it saves a record it will automatically set
the approved field to true. That field has a default value of false
in mysql. This works fine in windows, but when I setup the app
to run on hostingrails.com which is linux, it doesn’t work. Any
ideas ?
=================================
class Admin::BaseController < ApplicationController
layout ‘admin’
before_filter :set_admin, :authorize, :except =>
[“login”,“admin_login”, ‘logout’]
…
def set_admin
Group.set_admin()
end
======================================
class Group < ActiveRecord::Base
before_create :set_fields
def Group.set_admin
@@admin = true
end
def set_fields
if defined? @@admin
self.approved = true
end
end
end
end