similar to: ActiveRecord outside of rails

Displaying 20 results from an estimated 20000 matches similar to: "ActiveRecord outside of rails"

2006 Jan 13
1
How to disconnect to a database????
Hi, We have experienced some problems with ActiveRecord::Base class of Ruby-Rails. We are building a web-application based on the Ruby-rails framework and the web-application needs to access to difference databases, so we do not pre-define our database accesses in the database.yml file. In fact, we are using the ActiveRecord::Base.establish_connection() to connect to our database, the function
2006 Dec 01
4
uninitialized constant error in app but not when using console
I''ve got a wierd issue here and maybe someone can assist i created a module in my apps lib directory which i use for authenticating against an external source (among other things). lib/myapp.rb ----------------- require ''rubygems'' require_gem ''activerecord'' # uses activerecord odbc adapter by openlink module MyApp module ExternalSource class
2008 Jul 08
6
Show SQL request without issuing it
Hi all, I saw that some object.save is causing the SQL request to crash, but I don''t see the SQL request in the logs (only ruby code that''s showing an error during the .save method). Is there any way to show the SQL request before it''s issued to the database ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on this. I''ve nearly got my plugin finished but I can''t seem to get this to work. The method is in ActionController::Base but it is protected. -- Posted via http://www.ruby-forum.com/.
2006 Jan 11
1
logger in my classes
Hi, I wrote a class which is not an AR extension, nor a controller. I''d like to use logger.* methods there too. My class is in lib/ dir. I include it in environment.rb with the line require ''lib/localization'' just after the line require File.join(File.dirname(__FILE__), ''boot'') I tried many ways to reuse the logger class. The cleaner way seemed to
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/
2006 Apr 20
5
How to find the last SQL statement executed in ActiveRecord
Is there a method for retrieving the last SQL statement executed by ActiveRecord? I realize I can open the log file, but I''m looking for a programmatic way. -- Posted via http://www.ruby-forum.com/.
2006 Jul 14
18
ActiveRecord Love While We''re At It
I am working on and will be publicly showing ActiveRecord some love around the time of the RubyConf*MI [1] in late August. My main focus is getting AR to better handle inserts, updates and merges when working large sets of data. It can improve improve performance by 400% to 600% in preliminary benchmarks. I am coding this in a way so it can be patched to AR easily, and with that in mind
2006 Feb 02
3
Strange SQL Server error
Hi, In an app I''m developing I''ve run into a strange problem. I''ve created some controllers and models using the scaffolding generator and everything seemed to work fine. However I''ve noticed that a particular model I''ve created always fails its tests and I can''t test it out in a browser due to the same error I''m getting which is:
2005 Dec 16
2
Using logger from rails cron jobs
Hi. I''m trying to use logger from a rails cron job. It works fine, but I''d like the standard ruby behavior of stamping each log with date and time. How do I do this? I''m trying: # Set up out logging require ''logger'' logger = Logger.new(STDERR) logger.level = Logger::INFO RAILS_DEFAULT_LOGGER = logger # Tell rails to log to our logger also The
2005 Dec 16
6
active record outside of rails
I really like how Active Record logs the SQL that is executed inside of rails. Is there a way to get the SQL output when using Active Record outside of rails? Thanks, phil _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
2002 Oct 30
1
RODBC update
There is a new version of RODBC, 0.9-1, with a new maintainer (me) now on CRAN (Vienna) which works with R 1.6.x. The Windows binary will be there tomorrow, and both will then propagate around CRAN. This has been tested on Linux under unixODBC against MySQL and Postgresql (thanks to Dirk Edelbuettel), and on Windows against Access, MySQL and Excel. The CRAN compilation checks were against
2002 Oct 30
1
RODBC update
There is a new version of RODBC, 0.9-1, with a new maintainer (me) now on CRAN (Vienna) which works with R 1.6.x. The Windows binary will be there tomorrow, and both will then propagate around CRAN. This has been tested on Linux under unixODBC against MySQL and Postgresql (thanks to Dirk Edelbuettel), and on Windows against Access, MySQL and Excel. The CRAN compilation checks were against
2006 Jun 27
3
Weird ActiveRecord Foreign Key Problem
Hello to all, I ran into a weird problem with an ActivRecord. I have a table named "build_order" with a column named "type" that is a foreign key to a table called "building_type". In a controller I try to read all the build_orders with "BuildOrder.find :all" and get the following error and stack trace: (eval):1:in `instance_eval'': compile
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
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.
2006 Dec 14
3
Problem with ActiveRecord and Associations
Hi, I''m having what I believe to be a typecast problem with ActiveRecord and Associations. In the code below, I need to flag a contact record for deletion if the contact doesn''t have any addresses or books records: sql = "select id, delete_flag from contacts where id = #{params[:id]}" contact = Contact.find_by_sql(sql) if (contact[0].addresses.count +
2011 Jun 02
10
Application Error!!!!!!!!!!!!!!!!!!!!!!!
Hi everybody, Please any one help me, Previous two day''s I am googling, Still not find solution. this really frustrating. I had deploy my app on heroku http://radiationn.heroku.com/. it is working fine on localhost but i got APPLICATION ERROR. IN log wht i find that in photo.rb model not able to find "has_attached_file", I am not able to shout out this proble. It working
2006 May 03
6
ActiveRecord and Lost Connection
This isnt totally a rails question; I am using ActiveRecord for storing some simple values into a database. My problem; I keep gettign MySQL Errors. On the Win32 machine it was off and on. Now on the linux machine (ubuntu) I can'' t connect at all. I have all the password settings correct. My only thought, I am working with Threads and thought that might cause the issue, but I