similar to: Custom Active Record Callbacks?

Displaying 20 results from an estimated 60000 matches similar to: "Custom Active Record Callbacks?"

2010 Apr 16
1
Active Record observers broken: can't be used for "before" callbacks
I was just wondering what about a report that I made almost 2 months ago: Active Record observers broken<https://rails.lighthouseapp.com/projects/8994/tickets/4087-activerecord-observers-cant-be-used-for-before-callbacks> I think it''s a pretty big bug. In Rails 3, creating an observer with a "before_save" callback (for instance) will result in all observed models being
2006 Sep 06
4
Setting Product Env
When I am using my rails models in my worker class, it appears the background worker class is always using development no matter what I do. I set background.yml to production. I even have ENV[''RAILS_ENV''] ||= ''production uncommented in environment.rb. I don''t have the development db even created on my production box, so not sure where it is getting development
2006 May 03
7
Business Logic and where to place with rails
I am having an issue of deciding where I should put the business code for example the more complex code coming off the controller. Right now, I am just thinking to put it in the ''lib'' directory and the do something along these lines: require_dependency "system_process" class SystemMessageController < ApplicationController include SystemProcess ... ... Where
2014 Oct 14
0
[PATCH v4 04/25] virtio: defer config changed notifications
"Michael S. Tsirkin" <mst at redhat.com> writes: > Defer config changed notifications that arrive during > probe/scan/freeze/restore. > > This will allow drivers to set DRIVER_OK earlier, without worrying about > racing with config change interrupts. > > This change will also benefit old hypervisors (before 2009) > that send interrupts without checking
2006 May 04
22
Should controllers be "smart"?
I''m working on a small project with a friend, and one of the things we needed to do was send off an email whenever someone signs up an account. His implementation was pretty simple - throw a deliver_welcome call inside the controller after the signup. I''m sure that this is a pretty common thing to do. The problem, in my mind, was that the app now became tied to two places -
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
An upcoming patch to add callbacks for aio completion notification wants to expose Int64 as a callback parameter. It's time to wire that up. --- generator/generator | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/generator/generator b/generator/generator index 45a030f..c5988e2 100755 --- a/generator/generator +++ b/generator/generator @@ -3508,7
2010 Dec 22
2
Callbacks, log messages etc.
Inspired by but not completely related to: https://bugzilla.redhat.com/show_bug.cgi?id=664558 "RFE: Allow to set log callback in Ruby bindings" How can we make callbacks useful? First off what are we talking about? There are several callbacks that can be registered through the C API: (a) error callback http://libguestfs.org/guestfs.3.html#guestfs_set_error_handler (b) out
2006 Jun 08
3
MVC and Pagination
Just wondering how to best integrate with pagination and still stick to MVC... Say I have a Post model that has a published attribute. I want to show all the recent published posts on a page. My first instinct is to create a method in the Post model called recent that does the find with proper conditions and order, but the problem I have is how do I use that with pagination (which definitely
2005 Sep 16
1
recent and planned changes
* I committed into CVS the gendb patch that I sent to the mailing list on September 12. Arnaud, I hope you approve of this patch; it is more reliable than the previous method in tracking the correct dependencies. * This, together with some other minor recent changes on the Development branch, is between the "before_PSE_3" and "after_PSE_3" tags. Arnaud: if you
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2012 Apr 19
1
active admin undefined method `' for nil:NilClass
im working with active admin i have collection_select or dropdown box that populates the packages and crews im just wondering i why this undefined method `[]'' for nil:NilClass` i dont know what happened but it run few days ago and tested it once but now it raises this error are there possible way to solve this? def create @package = Package.find(params[:package_crew][:package_id])
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a list of projects: page.replace_html ''results'', ''<div>'' @projects.each do |p| page.insert_html :bottom, ''results'', p.name + "<br/>" end page.insert_html :bottom, ''searchresults'', ''</div>'' page.show
2006 Mar 16
4
problems with latest and greatest ?
I just did the following: 1) checked out latest rails from svn. 2) built project using the /bin/rails with the latest rails binary. 3) did a "rake freeze_edge" within the project Now, script/server is failing =========================== ./script/../config/../vendor/rails/railties/lib/commands/../tasks/tmp.rake:1: undefined method `namespace'' for #<Object:0x401ce970>
2015 Dec 22
0
FWD: Syslinux post from localpart@domain.tld requires approval
Hello, Usually is it easy to identify a valid non-subscriber-posting. Example given: the four postings about "bugzilla is back" in last day. Today there is a posting from the data plane development kit project, http://dpdk.org/ DPDK is a set of libraries and drivers for fast packet processing. Packets being network packets. That posting is not spam, but it should not go to this
2019 Jul 22
0
Re: [libnbd] More thoughts on callbacks and more
On 7/22/19 6:50 AM, Richard W.M. Jones wrote: > On Mon, Jul 22, 2019 at 10:08:25AM +0100, Richard W.M. Jones wrote: >> On Sat, Jul 20, 2019 at 07:38:45AM +0100, Richard W.M. Jones wrote: >>> More thoughts on callbacks, etc. following on from: >>> https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00184 >>> >>> Closure lifetimes
2019 Dec 03
3
Adding custom callback function before/after passes
Hello all, Is there a way to register callback that runs before/after passes? PassTimingInfo seems to do a similar thing by calling PassInstrumentationCallbacks::registerBeforePassCallback / registerAfterPassCallback, but it is hard-wired with StandardInstrumentations class. Do we have something similar to RegisterStandardPasses, so custom callbacks can be added from somewhere outside LLVM?
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)
2017 Jun 22
0
[PATCH v2 14/14] drm: remove unused and redundant callbacks
Drivers no longer have any need for these callbacks, and there are no users. Zap. Zap-zap-zzzap-p-pp-p. Signed-off-by: Peter Rosin <peda at axentia.se> --- include/drm/drm_fb_helper.h | 32 -------------------------------- include/drm/drm_modeset_helper_vtables.h | 16 ---------------- 2 files changed, 48 deletions(-) diff --git a/include/drm/drm_fb_helper.h
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
An upcoming patch to add callbacks during structured reads wants to expose Int as a callback parameter. It's time to wire that up. --- generator/generator | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/generator/generator b/generator/generator index e1a97a5..2d1a4e5 100755 --- a/generator/generator +++ b/generator/generator @@ -3260,7 +3260,8