similar to: Should ActiveRecord::RecordNotSaved attach the record in question?

Displaying 20 results from an estimated 2000 matches similar to: "Should ActiveRecord::RecordNotSaved attach the record in question?"

2013 Jul 17
5
Why last doesn't return an ActiveRecord::Relation
Hello, Sorry if this has been still answered, I haven''t found nothing on it. I would love to know why ActiveRecord::Base#last doesn''t return an ActiveRecord::Relation just like all or where since an ActiveRecord::Relation can act more or less like an array (as specified here<https://github.com/rails/rails/commit/0a6833b6f701c8c8febadfe2f45e25df29493602> )? Thanks, have
2007 Mar 26
2
Strange Record not saved errors
I have a site with an acts_as_authenticated based login which has started throwing up some strange errors. Until a few days ago everything worked fine but all of a sudden ''RecordNotSaved'' errors are popping up in my logs. When I check the database, it looks like the record _is_ saved but I think users get an error so I''m starting to see a lot of double/triple entries
2006 Jul 19
6
ActiveRecord::RecordNotSaved - bizarre behaviour.
Hi. I get a RecordNotSaved exception when trying to create a user record. The error: User Columns (0.005930) SHOW FIELDS FROM users SQL (0.000465) BEGIN SQL (0.000466) COMMIT ActiveRecord::RecordNotSaved (ActiveRecord::RecordNotSaved): ... As you can see, there''s no INSERT SQL generated, which is the root cause of the problem. In my user model, I have the following
2006 Aug 17
2
validates_associated bug?
i seem to be experiencing a bug where rails tells me that my organization object''s associated credit card is invalid (activerecord validation-wise invalid), when i know it to be valid. this happens only if i tell the organization to validate_associated :credit_card. i know the associated credit card is valid, because a) that credit_card object itself throws no validation errors, and b)
2011 Aug 02
1
Rspec teting API.
Hi! Guys, I wanna test an API built in Rails 3.0.3. So, my question is... What''s the better way to test my own api? I guess that a requests specs like these: describe ''POST /client'' it ''works'' do assert_difference post ''/clients'', :client => {...} end end can be appropriate... Someone just tested an API? I mean... simulate
2007 Oct 26
5
specing rescue, ensure and else blocks of an Exception
Greetings, I''m using rspec with rcov for my applications and there is one issue which I cannot solve nor can find any proper information regarding it: specing what is in a rescue block in case of an exception. I''m using Ruby on Rails and I usually make use of exceptions in my controllers, like the following example: def action @foo = Foo.find(1)
2012 Jul 27
3
Rspec: How to mock class method
Hi, I have two model: Message, User message.rb ``` class Message < ActiveRecord::Base class << self def method_a(args) [1,2] end end end ``` user.rb ``` class User < ActiveRecord::Base def method_user if Message.method_a(''anythings'') #... some code end end end ``` I want to test method_user,but I don''t want to test
2011 Sep 09
3
Missing Content-Length header breaks ActiveResource 3.1 on create
Hi, I''ve recently moved a 3.0 app ta 3.1 and am finding that ActiveResource breaks after a successful post because we now check for the presence of the Content-Length header[1] after a successful create (basically whenever the API returns a 201). The API is also on 3.1, and this only happens on staging/pre-prod/prod. I''m still investigating, but one thing that is clear is that
2012 Nov 28
1
Help setting optimization problem to include more constraints
Dear R-helpers, I am struggling with an optimization problem at the moment and decided to write the list looking for some help. I will use a very small example to explain what I would like to. Thanks in advance for your help. We would like to distribute resources from 4 warehouses to 3 destinations. The costs associated are as follows: Destination >From 1 2 3 Total
2018 Jul 24
1
Re: [PATCH] v2v: rhv plugin - fix DC search string
On Tue, Jul 24, 2018 at 7:27 PM Richard W.M. Jones <rjones@redhat.com> wrote: > On Tue, Jul 24, 2018 at 07:16:10PM +0300, Daniel Erez wrote: > > Search for DC by 'storage.name=' to make it explicit. > > I.e. "storage=" uses regex, so similar names can be > > found in the search query. For example, searching for > > a domain named FCSD, will find
2019 May 24
2
FW: Weird Samba/CIFS behavior: client hangs
I think a network trace would tell us for use whether the server is responding or not. You can follow the instruction here to make one: https://wiki.samba.org/index.php/Bug_Reporting#cifs.ko -- Aurélien Aptel / SUSE Labs Samba Team GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3 SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
2008 Mar 14
15
Is anyone running Rails 2.x against a MS SQL Server DB?
I am unable to get ActiveRecord session support to work under 2.x against a SQL Server database. I''m starting to wonder if anyone is running 2.x against SQL Server? Is anyone running under the following configuration: Rails 2.x SQL Server 2000 DB (using AR adapter in ODBC mode) AR store for ActionController session store. I''d like to chat with you if you are. Thanks, Wes --
2011 Sep 07
4
rspec testing inheritance
Hello, Is there any way to test model inheritance in spec? something like.. it { ChildModel.should < ParentModel } thanks.
2009 Feb 10
2
rescue_from for NoMethodError
Hi everyone, I was just trying to catch some exceptions in my app, for "Record Not Found" I used this in my application.rb file rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found rescue_from ActionController::NoMethodError, :with => :show_error private def record_not_found render :text => "404 Not Found", :status =>
2009 Mar 17
4
Preventing a submitted hash from ActiveRecord DB store
Hi all, I have a multi model form (Project with many tasks) and I want to prevent a task from being saved to the DB if it is empty ie. if there is no i/p for that task from the user. I tried the following class Task < ActiveRecord::Base before_save :check_if_empty ... def check_if_empty self.destroy if description.blank? end but i get this TypeError in ProjectsController#create
2007 Nov 01
0
attach database in active record with sqlite3
Sqlite3 is capable of attaching multiple databases together so two or more can be accessed with a single SQL query. Do AR and sqlite3-ruby support this functionality? If not, is there a way to achieve similar functionality? Thanks, Earle -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2008 Sep 02
7
Deploying My Rails App
I have just finished my first Rails application following the lynda.com tutorial, but I am not sure how to get my application on the internet. I have an ftp account through the applemachine server, but from what I have read, I''m afraid I will not be able to host my application there. What I am looking for is step by step directions on how to get from a working Ruby on Rails application
2007 Aug 31
48
Deprecating the mocking framework?
I saw in one of Dave C.''s comments to a ticket that "our current plan is to deprecate the mocking framework." I hadn''t heard anything about that, but then again I haven''t paid super close attention to the list. Are we planning on dumping the mock framework in favor of using Mocha (or any other framework one might want to plug in?). Pat
2002 Feb 08
5
Smp kernel on up machine???
Can anyone tell me if there has been testing of using an SMP kernel on a UP machine and if that is bad? I have an ext3 filesystem that keeps getting corrupt. Certain directories only get I/O errors, trying to access beyond the end of the device. Thanks, Gabe
2018 Jul 07
6
Testing for vectors
On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker <becker.gabe at gene.com> wrote: > Hadley, > >> >> I was thinking primarily of completing the set of is.matrix() and >> is.array(), or generally, how do you say: is `x` a 1d dimensional >> thing? > > > Can you clarify what you mean by dimensionality sense and specifically 1d > here? What do we call a