wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2008-Feb-22 13:20 UTC
this works on windows but not linux
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2008-Feb-22 19:04 UTC
Re: this works on windows but not linux
never mind, user error on this, I had a bug in one of my models and I figured it out --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org wrote:> never mind, user error on this, I had a bug in one of my models and I > figured it outI hope that you discovered that setting @@admin will never work in production when you have more than one user on your system.. :) ilan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---