Displaying 20 results from an estimated 200 matches similar to: "Rails 3 / RSpec 2 use_transactional_fixtures and after_commit"
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" group.
To post to this group, send email to
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.
2010 Mar 09
1
db:migrate fails after upgrade to Rails 2.3.5
Hi -- I''m upgrading an app from Rails 2.0.2 to 2.3.5 in development on
a Mac OS/X Leopard. I unfroze the old Rails files, froze the 2.3.5
gem on the machine into the app, and some quick tests of the app
showed no problems.
However, after trying to run rake db:migrate, it fails silently. Run
with trace I get the output below. I gather it might be related to
plugin initialization or
2012 Nov 10
6
Suggestion: `before_save on: :create` should either work or raise an exception
There''s a small inconsistency in ActiveRecord''s callback syntax that has
tripped me up before. It wouldn''t be a big deal, but it can lead to a
silent failure. I''d like to suggest that it either be made consistent or be
made to fail loudly.
The issue is that to do something before validating, but only when
creating, you use `before_validation on: :create`,
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
2007 Aug 31
3
Setting use_transactional_fixtures=false for a single spec - a bad idea?
Hi!
I would really like to find a way to allow me to write RSpec
specifications for code that use database transactions. I know I can set
config.use_transactional_fixtures = false
in my spec_helper.rb. That works, and that''s great, but it will (I
think) slow down my specs quite a bit. I would like to turn off
transactional fixtures for just a single spec (describe), or even
2007 Jan 10
1
Solution for undefined method `use_transactional_fixtures=' ... problem
If you see this error message:
undefined method `use_transactional_fixtures='' for
Test::Unit::TestCase:Class (NoMethodError)
You should check all your dependencies, all the lines containing
require and especially require_dependency.
You have probably done a refactoring "Rename" a class and forgot to
propagate the change everywhere!
More details on
2006 Nov 04
0
use_transactional_fixtures= and Test::Rails
With a normal test_helper, everything works just fine. However, if I change
test_helper.rb to include test/rails and the class from Test::Unit::TestCase
to Test::Rails::TestCase, I get this:
./test/functional/../test_helper.rb:19: undefined method
`use_transactional_fixtures='' for Test::Rails::TestCase:Class
(NoMethodError)
from ./test/functional/contact_controller_test.rb:1
2006 Jun 28
2
undefined method `use_transactional_fixtures=''
Folks,
I checked my test_helper.rb and it has
self.use_transactional_fixtures = true
My code was generated with 1.1.2 and I''m using 1.1.3 right now after
but the error persists.
I googled for this issue and it appears that a require is missing or
something like that. I can''t figure it out, please help!
/opt/local/bin/ruby -Ilib:test
2008 Mar 14
2
Lib Specs and config.use_transactional_fixtures = true
Hi
We have specs in our rails project other than model/view/controller ..
we have interests and lib ...
using use_transactional_fixtures = true seems fine in a spec in the m/
v/c and interests directories but not in lib
Just wondered if anyone had any quick thoughts as to why that may be???
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568
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?
Hello, I''m developing an app that basically, receives a 10MB or less XLSX
files with +30000 rows or so, and another XLSX file with about 200rows, I
have to read one row of the smallest file, look it up on the largest file
and write data from both files to a new one.
I just did a test reading a few rows from the largest file using ROO
(Spreadsheet doesn''t support XSLX and
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
I''ve submitted a couple of patches in Ligththouse.
Provide NoStore implementation of ActiveSupport::Cache::Store
This patch provides a NoStore implementation of
ActiveSupport::Cache::Store suitable for use in development and test
environments where the code need to use the cache interface, but
actually caching data is not desired.
2011 Feb 19
1
undefined method `map' for nil:NilClass for rails 2.3.2
Hai guys!
When i try to do rake gems:install and rake gems:refresh_specs in my app
below error is occurred. please give some solution for this.
config.gem: Unpacked gem authlogic-2.1.3 in vendor/gems has no specification
file. Run ''rake gems:refresh_specs'' to fix this.
rake aborted!
undefined method `map'' for nil:NilClass
enivorment.rb
RAILS_GEM_VERSION =
2010 Nov 30
2
db migration fails
I''m deploying new rails applications. Everything works well
except when it comes to the db migration:
* executing "cd /var/rails/benefits_test/releases/20101129190121 &&
/opt/ruby-enterprise-1.8.7-2010.02/bin/rake RAILS_ENV=production
db:util:migrate"
servers: ["ps-test-app1"]
[ps-test-app1] executing command
** [out :: ps-test-app1] (in
2009 Jul 31
6
Background daemon
It''s sending e-mail every hour, but I changed to sleep for a day, but
keep send the e-mail by hour. I don''t know what to do to send daily.
Could somebody help me?
thanks
############
# mailer.rb
###############
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"] ||= "production"
require File.dirname(__FILE__) +
2006 Apr 16
7
Problem running unit tests
I am running Rails 1.1.2 with Ruby 1.82-15. My database is Postgresql. I
haven''t had any problems generating models, migrations, using scaffolds, and
generally building and using my application, but I haven''t been able to get
testing to work. I initially just ignored the problem and kept developing,
but would like to add proper testing from here on out.
Currently when I type
2009 Nov 19
3
Log File Location
This may be a dumb question, but where can I see the error logs that
are usually displayed when unicorn is not daemonized? The
production.log file is empty in my app. Everything is currently
running as root.
2010 Nov 20
6
unicorn 3.0.0 - disable rewindable input!
Changes:
Rewindable "rack.input" may be disabled via the
"rewindable_input false" directive in the configuration file.
This will violate Rack::Lint for Rack 1.x applications, but can
reduce I/O for applications that do not need a rewindable
input.
This release updates us to the Kgio 2.x series which should play
more nicely with other libraries and applications. There are