similar to: rake db:migrate

Displaying 20 results from an estimated 3000 matches similar to: "rake db:migrate"

2006 Mar 01
5
single transaction migrations
Hi! It seems that migration doesn''t use single transcation to execute the needed migrations for the database upgrade, so if I have database at version 5, and I wrote some migrations 6..10, and error occurs while executing migration 7, the database stays in state 6? I also think that migration taks could use some more verbosity, for example if migration fails, there''s no
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 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/.
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
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
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/.
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 May 07
1
rake test without database
Hi! Is it possible to run unit tests when no database is configured? Rails recipes mentions putting following piece of code in a file within lib/tasks/ [:test_units,:test_functional,:recent].each do |name| Rake::Task.lookup(name).prerequisites.clear end However this seem to be out-of-date, as task lookup in rake according to RDoc is now done using Rake:Task[name]. But after I updated the
2009 Aug 19
2
Create! Syntax
Hey All, Two questions. Firstly, what is the difference between create and create! I see that create is document in the api http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002269 What is the difference between the two of these functions and where is the create! function defined. Also, What are the differences between these two calls? a) SomeModel.create!{ :property_a =>
2008 Mar 03
1
Rspec and plugins
I have a question regarding best practices around module and plugin testing for rails applications. In our application we have created several plugins that extend ActiveRecord::Base with class methods, that when invoked in a model add behavior to that model. For example ... class SomeModel < ActiveRecord::Base adds_some_cool_behavior adds_another_wicked_sweet_behavior end My
2009 Mar 17
3
How to truncate a table from a rake file
I am new to rails and want to figure out the syntax for truncating a table using a rake file. Any ideas? thanks in advance! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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
2006 Jan 11
2
How to execute an SQL statement in rails?
Hello, This is probably a silly question but looking at "api.rubyonrails.org", I can''t seem to figure out which method I should be using ... I want to execute an sql statement, like "truncate table BLAH" from within one of my rails app ... What''s the "right" way to do this? Thanks, /B -- Bruno Mattarollo <bruno.mattarollo@gmail.com>
2006 Jul 05
10
Scalable alternative to #find_all
Is there any scalable alternative to iterating all the records of a certain model? #find_all seems to load everything into memory. With 500.000 records it will be a swap storm. Pedro.
2006 Feb 07
4
Ruby, Rails & Inheritance
Hi! I am looking for a solution for the following problem: Some of my models share some attributes and also was in need for some extra features, so I created a class "RecordWithFeatures": ----------------------------------------------------------------- class RecordWithFeatures < ActiveRecord::Base # @Override def self.descends_from_active_record? superclass ==
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex class. Now that backgroundrb has allow_concurrency = true there is no need to synchronize database calls in threads. The question I have is lets say I have a simple method in my worker as follows: def some_method SomeModel.find_all each do |obj| obj.some_count += 1 obj.save! end end It accesses the database, but
2013 Feb 02
2
rake db:migrate problem
mini@mini:~/Sites/music_library$ rake db:migrate rake aborted! couldn''t parse YAML at line 28 column 6 /home/mini/my_gems/gems/railties-3.2.9/lib/rails/application/configuration.rb:115:in `database_configuration'' /home/mini/my_gems/gems/activerecord-3.2.9/lib/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>''