similar to: How can I improve a Ruby on Rails code that hast a lot of SQL as strings?

Displaying 10 results from an estimated 10 matches similar to: "How can I improve a Ruby on Rails code that hast a lot of SQL as strings?"

2006 May 13
4
undesireable lazy loading
Hi, My work with Rails has been fairly straightforward, until yesterday... I''ve encountered rather a peculiar problem that I''m not able to solve myself as a rails-newbie. The model code looks like this: class Link < ActiveRecord::Base has_one :user_vote end class UserVote < ActiveRecord::Base belongs_to :user belongs_to :link end I have a SQL query that is
2010 Jun 11
5
Issues creating tables in mysql tests
Hello, I''m a beginner, so any hints are appreciated; I''m still trying to find my way around Rails code. For a bug I''ve found I need to create a table called "values" so I added this: create_table :values do |t| t.integer :value end among the other table creations in activerecord/test/cases/migration_test.rb. Is that ok? But then, when I run the tests
2010 Jun 15
8
Allow blank on should validate_uniqueness_of
Hello, Using shoulda, any ideas how to allow blank when having this test: should validate_uniqueness_of(:email) Thanks. -- J. Pablo Fernández <pupeno-GAtDADarczzQT0dZR+AlfA@public.gmane.org> (http://pupeno.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
2007 Nov 25
5
Can't find rails after re-installing/upgrading Kubuntu
Hello Railers (?), I have just re-installed my machine with the lattest Kubuntu, which brings with Rails 1.2.4 instead of 1.2.3. Now my Rail project doesn''t start anymore. At first I''ve got this message: Cannot find gem for Rails ~>1.2.3.0: Install the missing gem with ''gem install -v=1.2.3 rails'', or change environment.rb to define
2007 Dec 20
3
ActiveRecords Eager Loading
Hi, I am doing an eager loading in ruby on rails using below statement ------------------------ Article.find(:all, :include => [:asset, :vote], :conditions=>"assets.parent_id is null", :order=>"stat_final_ranking desc", :limit=>20) --------------------------------------- the above statement resulted in this expensive query.
2007 Sep 30
2
Outputing to the browser, how?
Hello, I''m writting some helper methods to write forms, so I have this working code: class TableFormBuilder < ActionView::Helpers::FormBuilder ["file_field", "password_field", "text_field"].each do |name| define_method(name) do |label, *args| @template.content_tag(:tr, @template.content_tag(:td, @template.content_tag(:label,
2002 Aug 27
2
unicode
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm running Samba 2.2.3a on Mandrake 8.2 and I have some files with unicode chars in their file names (in fact, I'm moving all my file names to unicode, utf8). And now, I notice, that in windows, the names appeared scrambled and the files are not accesible, is there any way to solve this ? Thank you. - -- Pupeno: pupeno@pupeno.com
2011 Aug 22
6
Trouble with Ruby on Rails
Some background info: I am an OS X user, and my MAC system is OS X 10.6.8(snow leopard). @1st problem (regarding Ruby on Rails installation): I have installed ruby "1.9.2" with RVM. When I typed "ruby -v" command in terminal after installation, it says that the ruby version I have is "1.8.7". Strange, isn''t it? So, I have tried "rvm use 1.9.2"
2005 Feb 02
1
Error when changing from AR 1.0.1 to 1.6
Hello, I have the following output when changing form Active Record 1.0.1 to ActiveRecord 1.6: [error] C:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/support/dependencies.rb:24:in `depend_on'': uninitialized constant ActiveRecord::Mixins (ScriptError)\r [error] \tfrom
2010 Mar 02
0
FYI: FreeBSD HAST project
For those who may be interested, the Highly Available Storage (HAST) project has recently been committed to HEAD in FreeBSD. Obviously, it is still early release and potentially not suitable for a production environment, but may be of interest to those like myself who are on the lookout for a flexible and available network storage option for Xen. More info here: http://wiki.freebsd.org/HAST