Displaying 20 results from an estimated 10000 matches similar to: "observer doesn''t react"
2008 Jul 21
1
Re: Observer
eh, like so?
def after_create(model)
generate_hotel_param_files(model.id)
generate_hotel_setup_files(model.id)
end
def after_update(model)
generate_hotel_param_files(model.id)
generate_hotel_setup_files(model.id)
end
On Jul 21, 9:59 am, David Nguyen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> Hi,
> I have to make an observer if a
2006 Nov 21
0
Observer + acts_as_taggable plugin = dead app
so i have found that if i try to place an observer on a model that is
using the acts_as_taggable plugin, my app will not start up. this is
what i get in the mongrel startup log
/Applications/Locomotive2/Bundles/rmagickRailsSept2006_ppc.locobundle/framework/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1129:in
`method_missing'': undefined local variable or method
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 =
2005 Dec 07
3
ActiveRecord::Observer problem
Hi all,
I have a problem with an observer. I have a simple observer...
class ActivityObserver < ActiveRecord::Observer
observe Customer
def after_create(model)
bind_params(model)
@al.action = "create"
@al.save
logger "#{model.id} : created"
end
private
def bind_params(model)
@al = ActivityLog.new
@al.user_id = User.current.id
2007 Dec 14
0
async-observer rails plugin
I''m pleased to announce the existence of async-observer.
This is the very first public release. In the future I''ll confine
announcements to the beanstalk-talk mailing list.
WHAT IS ASYNC OBSERVER?
-----------------------
Async Observer is a Rails plugin that provides deep integration with
Beanstalk.
beanstalkd is a fast, distributed, in-memory work-queue service. Its
2006 May 24
1
Observer behavior differences between DEV and TEST environments ?
Hi all !
I''m having an issue and I can''t seem to make heads or tails of it.
I am attempting to add an observer to a model object. I created
app/models/greenback_transaction_observer.rb, inherited from
AR::Observer, defined methods, registered in config/environment.rb,
but things don''t work...
So, I took a step back and put in the following code:
class
2006 Jun 01
0
question about observer callbacks
I''m not sure how to implement this so I''ll describe what I currently have
done then what I wish to have happen
currently, I have a generic observer for several models
class AuditObserver < ActiveRecord::Observer
observe Foo, Bar
def after_update(model)
model.log("UPDATED " + Time.now.strftime("%m-%d-%Y %H:%M"))
end
def after_create(model)
2006 Mar 31
0
acts_as_taggable doesn''t work with uniqueidentifier
Hi all,
it seems like the acts_as_taggable is not capable to work with
uniqueidentifier as the datatype of the primary key in the tags table.
however, it works like a charm with int and autoincrement. could that be
fixed any time soon?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 26
0
Observer method names
I haven''t seen it documented anywhere, but can observer methods be given
a prefix in their name like ''after_'' followed by my controller''s method
name?
For instance I have a couple of methods called ''create'' and
''create_reply''. Can I have ''after_create'' and ''after_create_reply'' in
my
2006 Feb 12
6
habtm doesn''t save old IDs
I''m sure I''m not getting something. I have Users, and I have Groups.
Each User has_and_belongs_to_many :groups and each Group
has_and_belongs_to_many :users.
When I add a user, I want to apply a bunch of groups (like tags) to the
user (manually, without acts_as_taggable).
Here''s User#create:
@user = User.new(params[:user])
@user.groups =
2006 Jan 20
47
SQL Server datetime error
i have a problem with the datetime format of rails. i am unable to save
a dataset to the db. here''s the error message -- the original error
message was in german, so i translated it -- i get:
DBI::DatabaseError: Execute
OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server
Couldn''t convert a char-Datatype to datetime
HRESULT error code:0x80020009
2006 Apr 13
0
Model with file uploads
I''m working on a model for a videos table that include the video info
(title, description) and a couple of uploads (video file, thumb image)
I was going to use the file_column plugin but I dont like the idea of
storing the file names in the database when I dont need to, plus I dont
think it is very flexible.
Here''s what I done. What do you think of this? Any suggestions?
2007 Oct 24
1
Attachment_fu and observers/emailing
Hi all,
I''m developing a 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 <
2006 Apr 26
1
Observer best practices
I''ve seen two ways of connecting observers:
1) In the observer class put
observe MyModel
2) In the controller class put
observer :my_observer
What is the difference between these two? Also, is it necessary to put
in the observer class the following?
MyObserver.instance
Jose
--
Posted via http://www.ruby-forum.com/.
2006 Aug 16
1
Active Record Observers causing 404''s and other weird issues
Hi all. I''ve got a simple AR Observer:
class NewOrderObserver < ActiveRecord::Observer
observe NewOrder
def after_create(object)
Note.create(...)
end
end
In environment.rb I have the following line:
config.active_record.observers = :new_order_observer
And in application.rb I have:
NewOrderObserver.instance
Aside from simply not working, it''s causing
2006 Mar 07
12
Edge Rails doesn''t work for my app
My app was fine before "rake freeze_edge" but after, I can no longer boot up
webrick.
I''m on Win Xp MySql backend and this is what I get
=> Booting WEBrick...
./script/../config/../vendor/rails/activesupport/lib/active_support/core_ext/ker
nel/agnostics.rb:7:in ``'': Exec format error - rake tmp:create
(Errno::ENOEXEC)
from
2006 Nov 14
1
transaction support in ferret
I have a model called "Business". Each object say @business can be
tagged by any user. When i do ferret update for this object(on adding a
new tag or editing it), there always a possibility that another user is
also tagging it. I am using the std rails pluggin for tagging
''acts_as_taggable''.
So is the indexing done properly. Or would there be any problem?
Thanks
2009 Sep 27
1
Switchboard - Easy to use global ActiveRecord event listeners
Switchboard is a simple, event-observing framework for ActiveRecord.
It''s designed to make it easy to add observers for all models in your
app, and to easily turn them on and off selectively.
Intallation
gem sources -a http://gems.github.com
sudo gem install zilkey-switchboard
Usage
First, require switchboard above your rails initializer:
# environment.rb
require
2008 May 21
1
Callback method for field
Is there callback method for field level?
Generally, after_create and after_save will fire at object level.
I need to fire some code when the value for the field is changed. I need
to call the call back method from observer
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2007 Feb 05
1
long jumping out of code in specs
I wrote this abomination just now, and wonder if anyone else has had
experience with the pattern behind it. In short, I''m specing an
after_create hook on an ActiveRecord model, that calls a bunch of
private methods. Instead of stubbing all those private methods (which
is verboten anyway, as well as impossible because creating the object
which owns those methods is what I''m