Displaying 10 results from an estimated 10 matches for "after_commit".
2011 Jan 14
4
Rails 3 / RSpec 2 use_transactional_fixtures and after_commit
We''re migrating a Rails 2.3.x application to Rails 3 and RSpec 2.x.
In Rails 2.3.x we were using
https://github.com/freelancing-god/after_commit to provide
after_commit functionality (now provided by Rails 3).
The plugin version of after_commit came with some helpers to make
testing with `use_transactional_fixtures = true` work.
From: https://github.com/freelancing-god/after_commit
"Keep in mind that transactions are finicky at best...
2012 Aug 01
0
Testable after_commit hooks for rails 4?
https://groups.google.com/d/topic/rubyonrails-core/i2k7dn-jRVg/discussion
What do you think about bringing the possibility to test after_commit hooks
while also using transactional fixtures to rails 4? Would the approach used
here https://gist.github.com/1169763 be acceptable?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit http...
2010 Aug 24
0
Rails 3 Observer: No support for after_commit?
Rails 3 adds after_commit and after_rollback callbacks, but it appears
they are not available as methods in an Observer. Is that the way it''s
supposed to be, an oversight, or am I doing it wrong?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2008 Jul 28
1
callback executed like after_save but after transaction
I''m trying to add some code for my ActiveRecord class so that it is
executed whenever an object is updated, this code is a seperate
process that reads from the same table represented by my model class
so when it runs it needs the database to be up to date.
In the following situation this is fine:
# MyModel
def after_save
`/usr/local/bin/update_models -i #{self.id}`
end
# controller
2012 Nov 10
6
Suggestion: `before_save on: :create` should either work or raise an exception
...fore create **and**
before update. This isn''t really something an application''s tests would
catch, I don''t think.
I propose one of the following changes:
1. `before_save on: :create` and `before_save on: :update` could be
supported (and the same for `after_save` and `after_commit`)
2. Using `before_save on: :create` and the like could raise an exception
saying either "this isn''t supported" or "this isn''t supported but will be
eventually"
3. The `before_validation on: :create` syntax could be dropped in favor of
`before_save_validatio...
2008 Sep 15
2
not finding activerecord data in worker
Hey guys,
Firstly, I''m new to the list and great work with backgroundrb, it''s
sweet!!! I''ve just started noticing an issue and i''m wondering if
there is a standard fix. The situation is as follows:
1. In my model''s after_save I call my worker asynchronously with the
active record object''s id as a parameter (the record that has just
2013 Oct 10
12
What's the best way to approach reading and parse large XLSX files?
...help is welcome)
*What i was trying to do here, was to process the files and create the new
XLS file after both of the XLSX files were uploaded:*
require ''roo''
require ''spreadsheet''
require ''creek''
class UploadFiles < ActiveRecord::Base
after_commit :process_files
attr_accessible :inventory, :material_list
has_one :inventory
has_one :material_list
has_attached_file :inventory, :url=>"/:current_user/inventory",
:path=>":rails_root/tmp/users/uploaded_files/inventory/inventory.:extension"
has_attached_file :ma...
2010 Aug 18
11
When after_save isn't after the save....
I have a Production model, which represents a farmer''s crop. After
create (via after_save) I call a method that creates one or more
Supply models, which represent a week of anticipated product harvest.
After each of those are created, a class method gets called that tries
to match each new Supply with outstanding orders for the same time
period. If a match is made, a transaction (an
2010 Dec 07
0
A couple of patches
...where the code need to use the cache interface, but
actually caching data is not desired.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6128
Reduce memory bloat in ActiveRecord transactions
This patch reduces memory bloat in ActiveRecord transactions. With the
introduction after_commit and after_rollback callbacks references are
kept to all records updated in a transaction until the transaction
completes. This can lead to memory bloat with large transactions.
The code change replaces the references to weak references unless the
objects implement these callbacks. This allows the...
2011 Feb 19
1
undefined method `map' for nil:NilClass for rails 2.3.2
...#39;'1.1.0''
config.gem ''ean13'', :version => ''1.4.0''
config.gem ''htmldoc'', :version => ''0.2.3''
config.gem ''flog'', :version => ''2.2.0''
config.gem ''after_commit'', :version => ''1.0.7''
config.gem ''riddle'', :version => ''1.0.12''
Thanks and Regards,
Dhamodharan.N
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post...