Displaying 20 results from an estimated 3000 matches similar to: "single transaction migrations"
2006 Jan 06
4
Are migrations executed within a transaction?
Hi all,
Can I safely assume that each migration is excuted within a
transaction, so that''s it''s safe to have migrations executing failing
statements?
Thanks,
- Rowan
--
Morality is usually taught by the immoral.
2007 Feb 13
3
"should.be_in [values]" and "each_should_satisfy"
Hi!
I just started using RSpec and have some question that I couldn''t find
answers to.
If I have a result that can have two valid values, is there a better way
of writing
the following assertion?
[value1,value2].should_include actual
Is there a more elegant way of performing should_satisfy on a
collection, for
example I currently use something like collection.each {|x|
2007 Apr 04
1
pontential bug in rspec_on_rails and ActiveRecord transactions
Hello rspec-users,
I''ve encountered a strange bug in rspec, but it may be me who is wrong.
I''m running latest version from the trunk (r1678) of both rspec and
rspec_on_rails.
Please consider the following model:
class Url < ActiveRecord::Base
def after_save
Contact.create!(:primary_email => ''user at example.com'')
raise
2007 Jul 19
1
stopping on first failure
Hi!
Is there an option that I could provide to the spec runner that would
make it stop after it
encounters the first spec that fails?
Esad
2007 Feb 20
1
having should_receive expectation for things that happen in setup
Hi!
The following example doesn''t work for me: http://pastie.caboo.se/41732
However, if the call to msg() happens in the specify block after the
expecation and not in the setup, it will pass.
Why is this? I thought the setup method was there to actually
''construct'' the context and the specifications are some kind of
"postconditions" that only need to be
2006 Feb 17
1
foreign key support in mysql adapter
Hi!
I''m using Migration to define my database schema and these "ALTER TABLE
t ADD FOREIGN KEY..." look really ugly - that''s why I wanted to ask it
would be possible to simply add add_foreign_key method to ActiveRecord?
Are there any reasons this isn''t yet implemented?
Greetings,
Esad
--
Posted via http://www.ruby-forum.com/.
2006 May 08
4
rake db:migrate
Would it make sense for rake db:migrate to support creating databases if
it is not found, with blessing from user to prevent typos, or as an
additional command line switch.
Or am I just being too lazy?
--
Posted via http://www.ruby-forum.com/.
2007 Apr 13
1
File.should be_exist?
Hi!
Is there a nicer way of writing
File.should be_exist(''filename'')?
File.should exist(''foo'') throws NoMethodError in ''specification''
undefined method `exist'' for #<#<Class:0x3ec1c30>:0x3ebc308>
(I''m using rspec from the trunk)
Esad
2006 Mar 07
1
decorators for models?
Hi!
I''m thinking of implementing datagrid like functionality for showing
data (models) in grids so that I don''t have to re-invent the
view/controller for each table I need. There are number of parameters
that need to be customizable: column titles, row style depending on the
data (i.e. showing all rows with balance<0 in red), is column sortable,
sort-algorithm etc.
To
2006 May 11
1
rendering in after_filter
Hi!
Is it possible to render the action within the after_filter method, or
is the rendering performed before?
I have something like this:
class FooController
after_filter :send
def a
@content=...
end
def b
@content=..
end
protected
def send
send_data(@content,...)
end
end
However, when calling the action a or b, the @content doesn''t get sent,
but instead
2006 Mar 21
1
including templates/views in plugins
Hi!
I''m writing a datagrid plugin and would like to render the datagrid
using a .rhtml template. However, I''d like to avoid placing this
template in app/views/shared, but it should reside somewhere within
vendor/plugins/datagrid/...
Any ideas?
--
Posted via http://www.ruby-forum.com/.
2006 May 10
6
Migrations don''t really support transactions
I read in various places that although migrations aren''t transactional, all
you need to do is wrap you migration method in "ActiveRecord::
Base.connection.transaction do"
to make the self.up or self.down transactional. In my experience (Rails +
PostgreSQL), this doesn''t work very well. If my migration hits an
exception, any tables that were touched remain modified.
2007 Apr 17
7
rspec with CI
I am a bit of a rails and rspec noob.
I am trying to use rspec in conjunction with CruiseControlrb.
When I run a cruise build having spec errors, the build does not
indicate a failure. I have tried to track down why this is the case,
and my best guess is that the spec task is kicking off the spec via a
ruby() method in rake, and that ruby method does not propagate my spec
failure back to
2006 Aug 17
3
Migrations for migrating data across databases - is it possible?
Hi All
I am trying to understand if I can use migrations to migrate data under the
following conditions
1. Across 2 different databases (Oracle/DB2) with same schemas.
2. Across 2 different databases (Oracle/DB2) with different schemas.
I am trying to avoid writing DBI/OCI8 scripts.
Can somone please shed some light if this is even possible?
thanks
-daya
-------------- next part
2006 Feb 11
3
Intial data in Migrations
One thing I found annoying about Migrations, besides that you have a
very limited ways to define your data, is that it will overwrite
EVERYTHING in your schema file. So if you spend hours customizing your
initial schema file, to get it work, exactly like you''ll need it, that
work immediately becomes for nothing once you run a migration. Your
entire schema will get rewritten, not appended
2006 Aug 16
14
Migrations: only one table per migration file?
Hi all
I have a new migration file created that adds some tables and fills one
with some data:
create_table :sound_styles do |t|
t.column :name, :string, :null => false
end
create_table :show_types do |t|
t.column :name, :string, :null => false
end
create_table :countries do |t|
t.column :name, :string, :null => false
end
ActionView::Helpers::FormOptionsHelper::COUNTRIES.each
2006 Jan 14
11
accessing models from migrations
Ok, so now Users need to be associated with Organizations. I''ve
created a migration and added a ''organization_id'' column to the users
table. I want the default organization_id to be the first
Organization. So I have :default => Organization.find(:first). But
it''s complaining about not being able to find the constant
''Organization''.
Any
2006 Mar 04
2
Using Migrations to Build a MySQL FULLTEXT index?
Can anyone point me to the proper syntax to build a FULLTEXT MySQL
index via migrations?
I''m really liking these things, and don''t want to step back into the
world of manual intervention.
2006 Jul 10
2
Problem with migrations, postgresql, AWDwR
Hi all,
Rails 1.1.4
Rake 0.7.1
PostgreSQL 8.1.4
Windows XP Pro
I checked for errata on pragmaticprogrammer.com, but didn''t see any
explicit mention of this issue.
I''m going over the depot example in AWDwR, 2nd ed, and I can''t get the
migration to work on p. 82. Specifically, the AddTestData example (with
reduced description text to save my fingers some typing):
2006 Feb 26
1
Migrations: column option "offset"?
Hi,
On the wiki
http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations it says:
Valid column options are:
- limit
- offset
- null (i.e. ? :null => false? implies NOT NULL)
- default (to specify default values)
I was wondering what the purpose of the "offset" option is. And after
looking at the API at