Displaying 13 results from an estimated 13 matches for "user_observ".
Did you mean:
user_observer
2006 Jul 18
7
Observer not working
Help please.
I''m trying to observe a User class, but I can''t get this to work, the
after_create method never gets called... (the breakpoint never gets
called)
app/models/user_observer.rb:
class UserObserver < ActiveRecord::Observer
def after_create(user)
breakpoint
setting = get_setting(''sys_notify_enable_user_create'')
if setting? then
AdminMailer.deliver_simple_monitor_alert('...
2008 Sep 18
1
user_observer (restful_authentication) causes failure in loading rails
I have restful_authentication in use on an app and it has been working
fine, but I recently was changing the account creation flow and needed
to enable the UserObserver. I did so by including it in the
environment.rb (config.active_record.observers = :user_observer) and
Rails wouldn''t start.
I got the following error;
source/communitysites/vendor/rails/activerecord/lib/active_record/
base.rb:1672:in `method_missing_without_paginate'': undefined method
`format_attribute'' for #<Class:0x2256a14> (NoMethodError)
from /source/co...
2007 Aug 30
8
experimental rails story adapter in trunk
For those of you interested in getting a jump on learning about and
using the new Story Runner in a Rails app, I''ve added an experimental
Rails-Story adapter to trunk.
You can see how to use it here:
http://pastie.caboo.se/92320
This is PURELY EXPERIMENTAL, however it actually works and will likely
not change much in the way that it does work.
Happy hacking!
David
2010 Oct 03
1
Rails 3 observers
Rails Guides says:
...the UserObserver ... would be saved as app/models/user_observer.rb
and registered in config/environment.rb this way:
config.active_record.observers = :user_observer
But the observer registration above doesn''t work because there is no
''config''. For now, I''ve put it in the config/environments/[APP_ENV].rb
but that seems real...
2006 Mar 04
2
Declaring ActiveRecord observers
...clare the observer in the
config/environment.rb file under the ''config.active_record.observers =
:comment_observer, :signup_observer''.
But reading the generated source code, the plugin author recommends
declaring the observer in my ApplicationController with a ''observer
:user_observer'' clause.
The observer gets triggered in both cases, but I am curious about this,
So, what is the "Rails way" of activating observers?
1. http://rubyonrails.org/api/classes/ActiveRecord/Observer.html
--
----------------------------------------------------
http://www.sobrera...
2007 Jan 22
1
Observed models cause failures with DRBSpec ?
...:order => "projects.title"
def active_projects(force=false)
@active_projects = nil if force
@active_projects ||= self.projects.active
end
end
The observer is loaded in config/environment.rb like this:
Rails::Initializer.run do |config|
config.active_record.observers = :user_observer
end
There''s nothing very interesting about this, except that if I comment
the user observer in the configuration, I can run drbspec spec
multiple times in a row without failures. If I add the observer, I
can run drbspec without failures once, then I get failures like the
one above for...
2008 Apr 25
6
ActionMailer
Hi all,
I need a help. I have got a user registration form, where the user signs
up and then an activation link is sent to the user email id for
activating his/her account. Now I need to send an another email to the
user, only after he logs in for the first time in my site, then the
second email should be sent. Can anybody give me some suggestion on how
to do it ??
NB: When the user clicks on
2006 May 22
0
acts_as_authenticated mailing for activation problem
...mail sent.
My mail setup in config/environment.rb works with other notifiers, so I
was wondering if there''s anything I''m not adding to the signup method in
the account controller?
At the moment I''ve got:
class AccountController < ApplicationController
observer :user_observer
...
def signup
@user = User.new(params[:user])
return unless request.post?
if @user.save
redirect_back_or_default(:controller => ''/account'', :action =>
''index'')
flash[:notice] = "Thanks for signing up!"
end
end...
2007 Oct 24
1
Attachment_fu and observers/emailing
...site where a user can upload their CV/resume with a
profile, and am using restful_authentication for this with
attachment_fu to handle the file uploading.
When a user creates their profile/user account, I''ve got an observer
that will email the site admin with a copy of the uploaded CV. My
user_observer looks something like:
class UserObserver < ActiveRecord::Observer
def after_create(user)
UserMailer.deliver_signup(user) unless user.activation_code.blank?
UserMailer.deliver_notification(user)
end
end
The problem I''m having is when the deliver_notification method is
cal...
2008 Feb 05
0
adding observers outside environment.rb
I need to add an ActiveRecord observer and thought I should follow
Rails 2 intent by not changing the base environment.rb
I create a file config/initializers/observers.rb but don''t know what
to add to it.
I can''t add: config.active_record.observers = :user_observer
Since "config" isn''t defined in the scope of the initializer file and
I don''t know if it would be harmful to add a "Rails::Initializer.run
do |config| " block.
So, is there a method to add an observer outside the environment.rb
initializer block?
Or is it ok...
2009 Apr 04
11
rake aborted! undefined method `empty?' for nil:NilClass
Hi,
I''m getting the next errors, would anyone have any suggestions?
Thanks.
[~/rails/hip]# rake --trace db:migrate RAILS_ENV="production"
(in /home/domain/rails/hip)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `empty?'' for nil:NilClass
/usr/lib/ruby/1.8/erb.rb:469:in `scan''
2006 Mar 04
6
Can''t get Fast CGI working.
Well, after many hours of tinkering and internet browsing I just can''t
get Fast CGI to work with Rails and Apache 1.3 on FreeBSD 5.4 Normal CGI
works fine, but as soon as I enable FastCGI in .htaccess I get the
message:
Application error
Rails application failed to start properly
Here''s what I''ve done so far:
- I''ve installed all the necessary software for
2008 Apr 09
5
intermittent BJ errors
hi all
I''m running background tasks using BJ 1.0.1 (gem version). On some
requests, the tasks are executed as expected. On others, I get the
following error:
RuntimeError (no bj found in ["/u/apps/igniter/releases/20080408205801/
script", "/bin", "/usr/bin", "/sbin", "/usr/sbin"]):
when it runs, it runs fine but does anyone know what