similar to: call activerecords private methods

Displaying 20 results from an estimated 40000 matches similar to: "call activerecords private methods"

2008 Jan 31
4
reby-debug and rspec
How do I use the ruby debugger with a specific test (not the whole spec file)? I want to do something like this. $ rdebug spec/models/user_spec.rb -s "should error if not new_record" ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search.
2007 Jan 18
4
problems testing a rails controller
I''m trying to test a rails controller, but my mock isn''t working. Everything looks right to me. Can someone take a look at it and see if I''m missing something obvious http://pastie.caboo.se/33883 Domain.should_receive(:find_domain).once.and_return(domain) That line in the spec is failing but I don''t see why. If I comment out that line the test passes so it is
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in ActionView::Helpers::TagHelper to do some generalized error handling similar to the way scaffolding puts a red border around fields that fail validation. I''ve created a file lib/rails_patches/tag_helper.rb which contains the following. module ActionView module Helpers module TagHelper alias_method :orig_tag, :tag
2008 Jan 28
6
client first, top down, outside in, etc with rails
I''m starting a new project and I want to try writing the client first. I.e. I want to write my ''views'' first and I would like to mock out all the models in such a way that I can run the site and browse it with the mocked out models. Is it easy to use rspec''s mocking for this sort of thing and has anyone done it before? Does anyone know of a tutorial out there
2008 Jan 11
13
Role of stories vs specs, revisited
A couple months ago I asked how stories and specs might impact each other. [1] If you look at Dan North''s example of what''s in a story [2], and you imagine using the spec framework to drive the design, you can probably imagine a significant bit of overlap in the two. Is that a bad thing? I''m not sure. It has made me a bit uncomfortable though, and I''ve
2012 Feb 22
3
Parent id for find_or_create method
Rails 3.1.3 I have tables, Video and Script having association, Video 1 --- n Script So, every Script needs the parent id, in this case, video_id. If I simply create a new Script instance, the view renders as follows. <%= render :partial => "new_script", :locals => { :script => Script.new(:video_id => @video.id)} %> which works fine. Now I would like to
2013 Apr 19
2
R 3.0, Rtools3.0,l Windows7 64-bit, and permission agony
Having finally found some free time, I was going to use it to update a bunch of R packages from 2.15 to 3.0. I am running Windows 7, 64-bit professional. This is on a brand-new laptop using vanilla settings when installing the operating system. Problem 1: I installed R3.0 to the default location (C:\Program FIles\R\R-3.0.0). The first thing I tried to do was install BioConductor. This
2006 Feb 16
2
fixtures outside of rails
Is there an easy way to use fixtures outside of a rails app? I''m using activerecord for a project and would love to use fixtures as well, but I haven''t found any info on doing this. I''m hoping it''s something quick and simple someone can explain to me so I don''t have to dig through the rails source :) -- Posted via http://www.ruby-forum.com/.
2012 Aug 14
1
NoMethodError: undefined method `accept' for nil:NilClass
Here''s the trace, NoMethodError: undefined method `accept'' for nil:NilClass from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `to_sql'' from
2007 Oct 07
10
Rails to English
I am currently using the book "Agile Web Development With Rails" (2005). I am working on a fully function web application that has a shopping cart. The web page displays this, ActiveRecord::StatementInvalid in AdminController#create Mysql::Error: #23000Column ''date_available'' cannot be null: INSERT INTO products (`image_url`, `date_available`, `price`, `title`,
2005 Aug 24
1
public/private email accounts
Hi, I am running FC4 with postfix/dovecot/amavisd-new etc on my box with 50 staff email accounts (say 10 per 5 departments)... everything is working ok... I want to create 5 more accounts for each department (to be redirected to respective staffs, e.g. sales at xyz.com) as well one for everyone... that can be easily done by creating an account and modifying the .forward file in the
2010 Sep 27
0
problem with set_sequence_name please help
I''m building rails 3 with legacy oracle 10g db. which it''s sequence is non rails convension. I have try this. class AdCourt < ActiveRecord::Base set_sequence_name ''COURT_SEQ'' end with rails console : AdCourt.sequence_name I have got "COURT_SEQ" which look ok. When AdCourt.create!(:caption => ''AAAA'', :code =>
2019 Jan 03
1
idmap problems
> On Wed, 2 Jan 2019 14:42:39 +0000 > Rob Mason <rob at acasta.co.uk<mailto:rob at acasta.co.uk>>> wrote: > >> Many thanks Rowland. Yes, I don't understand idmaps, but I _think_ >> I'm getting it. I have added the gid of 60002 for Domain Admins and >> undertaken some 'chgrp' tasks. I've now got a domain member with >>
2006 Jun 21
1
ActiveRecord has_one default value
My apologies if this is a dumb question, but I''ve searched around and haven''t been able to come up with a solution. Is there a way when specifying a has_one association to specify a default value for an object if data is missing in the child table. For instance: class Student has_one :university end if no university is associated to the student in the database, I would
2007 Sep 14
4
Refactoring ActiveRecord's private methods
As it currently stands, ActiveRecord has alot of private and protected methods in the Base class. >> ActiveRecord::Base.methods.size => 427 >> ActiveRecord::Base.protected_methods.size => 32 >> ActiveRecord::Base.private_methods.size => 193 I really loved the suggestion by Courtenay in Refactoring AR::Base.find (http://groups.google.com/group/rubyonrails-core/
2011 Jul 06
3
finding the intersection of two vectors
Hi, Suppose I have two vectors, not necessarily the same length (in fact, they usually are different lengths): y.1 that has increasing values between 0 and 1; y.2 that has decreasing values between 1.0 and 0. You can picture these as being supply (= y.1) and demand (= y.2) curves from economics. I typically plot these vectors on the same graph against a common x variable, which happens to
2019 Jan 04
1
idmap problems
<snip> > > > I do hope you are not thinking of using GPO's, you have just stopped > > > > > Domain Admins from owning things in Sysvol. > > > > > > > > > > Rowland > > > > <facepalm/> Thanks Rowland - you must be getting pretty tired of my > > dumb questions... > > The only dumb question is the one
2009 Sep 09
0
Rails 2.3.4 ActiveRecord association problem
Upgraded our app from Rails 2.2.2 to 2.3.4, and I''m now encountering an error when adding a child to a parent. Top of the stack: wrong number of arguments (1 for 0) /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/ associations/has_many_association.rb:61:in `save'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
2006 Mar 08
5
ActiveRecord returning Strings with find_by_sql?
Hello, I''m new to Ruby & Rails, and I''m trying to figure out if this behavior by ActiveRecord is by design, or if I''m doing something incorrectly. Here''s the deal: I have a class based on ActiveRecord::Base that defines a method that creates a query using find_by_sql(). The fields retrieved by joins with other tables are being returned as Strings,
2006 Jan 16
0
Methods for clearing page caches?
Here''s what I use, in a crontab entry: */30 * * * * find /var/www/html/rails/public/categories/ -mmin +60 -exec rm {} \; I''d also like to remove empty directories, which are easy enough to find with the ''-empty'' param, but rmdir trips on non-empty parent directories which it finds before children, and I''m not sure if I want to use ''rm