similar to: List of all Models

Displaying 20 results from an estimated 800 matches similar to: "List of all Models"

2007 Nov 16
1
Temporaly silencing the rails log.
Hi! I want to do what subject say. Is there any elegant way to do this: ??? # Silence the log inside the block attached to the method call. def silence_logger orig= nil ObjectSpace.each_object(::Logger) do |logger| logger.info "-" * 80 logger.info "Quieting the log..." orig= logger.level logger.level= ::Logger::FATAL end yield
2006 Apr 24
3
Regex in HTML
So, I''m trying to write a nice bit of regex to handle finding anchor tags in a bit of html. This is what I''ve got.... /<[aA][^>]*>[^<]*<\/[aA]>/ I''m planning on using this with a gsub!. Here is what it has to do.... <html><a href="http://stuff.com" class="link">Anything in here.</a></html> As you can
2006 May 16
5
Transactions in RoR
Hi, Does anyone knows how to manage transactions in RoR. Thanx
2006 Apr 22
6
Friendly Reminder (OT)
Today, I had a tragic hard drive crash. I hadn''t updated anything to SVN in two weeks. I''m posting this here as a reminder to my beloved Rails community. Everyone, right now..... make a backup of your rails work. Make sure its on two disks. Many of you already do that automatically, but just make sure its working. Two near-release rails plugins were lost in the tragic crash
2008 Jul 01
4
Exceptions available in Ruby on Rails
Hi, Can anybody list out what are all the exceptions available in ROR? Thanks in advance... Karthik. -- 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 Apr 05
25
How to avoid bunch of <% %> ??
Hello, I would like to know is there is a way to avoid poluting the views with tons of <% %> ? Like this <%= start_form_tag() %> <%= text_field_tag(''category[title]'', category.title, {:size => 20, :maxlength => 128}) %> <% if not category.parent_id.nil? %> <%= select("category", "parent_id", Category.find(:all,
2010 Jul 14
1
ActiveRecord::Observer, update_all and has_many
Hi, I''m using an ActiveRecord::Observer to log users changing data in my application. However, I''ve noted that adding an item to a has_many relationship gets logged, but removing the item does not. That is: @product.users << user is logged, but: @product.users.delete(user) is not. I''ve dug into ActiveRecord and found that the underlying issue is that the
2008 Mar 12
12
Mongrel has crashed
Hi, my mongrel has crashed with following errors in the logfile: ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.3 available at 0.0.0.0:3000 **
2006 Jan 19
3
Why does Object.subclasses_of ignore subclasses within modules?
ActiveSupport provides a method Object.subclasses_of, shown below: def subclasses_of(*superclasses) subclasses = [] ObjectSpace.each_object(Class) do |k| next if (k.ancestors & superclasses).empty? || superclasses.include?(k) || k.to_s.include?("::") || subclasses.include?(k) subclasses << k end subclasses end Can anyone shine some light on why
2007 May 26
1
make_resourceful 0.1.0 Release!
I am extremely proud to put the code up live for make_resourceful! I have been astonished by the positive feedback I''ve been receiving since our talk at this year''s RailsConf. So much pressure to get this thing out! If you haven''t heard about it... then check out my slides from railsconf http://www.hamptoncatlin.com/assets/2007/5/21/make_resourceful.pdf or listen to the
2012 Oct 02
3
[PATCH] chowning /dev/null should be guarded against
We''ve run into this problem several times and it''s not really expected that someone is going to monkey with /dev/null. So here''s a simple patch. I am not on the mailing list, so please Cc: me. --- lib/unicorn/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb index cde2563..6b6cca2 100644 ---
2006 Apr 13
8
DevTower Beta3 Release!
DevTower Beta3! (0.3) I''m proud to announce some major changes and improvements to DevTower in this beta release! First and foremost, DevTower is now a full plugin. Also, DevTower works (only) with Rails 1.1. ==== ABOUT ===== DevTower used to synchronize the development of Ruby On Rails applications with developers working simultaniously on multiple systems with Subversion. DevTower
2011 Feb 16
1
Forking for background processing with rails/unicorn
Hello, I''ve been working for a few days on a problem which, after tracking it down, seems to be related to unicorn. I''m hoping that somebody might be able to help with information about what''s going on. In the Rails 3 application that I support, we sometimes fork during a web request in order to do background processing behind the scenes without the user (and the
2007 Mar 16
1
Polymorphic find_or_create bug
Today I just spent 3 hours (and before a demo!) trying to figure out why my polymorphic association fields were breaking. Turns out someone else put in a patch for this 6 months ago. I''m not sure if its the same solution I''d use... I''d rather find_or_create attempt to use AssociationProxy#build if its available and only Base#new if we''re not on a proxy.
2006 Jan 05
1
Looping through all models in the application
Hello. I have an application that depends on a table/model (ModelInternationalization) that provides international translations in various languages for all the model/table and columns names as well as some other stuff (whether the column is visible on forms, dropdowns, lists, reports etc). I need to create a management interface for this translation stuff (the plaintext stuff, btw, will be
2012 Apr 12
8
Background jobs with #fork
Hi I''ve migrated from Passenger to Unicorn about a week ago. It''s great. Great transparency and management, thanks for this great software! A few of my Rails applications start background jobs using Kernel#fork. Of course, the ActiveRecord connections are closed and reopened again in the parent and child processes. The child process also does its job. Unfortunately, it seems
2006 Apr 06
8
Fastest learning path to RoR
hi! with a 4GL background, wanting to learn RoR, what is the fastest learning path i should take? should i go grab a RoR tutorial, and learn Ruby along the way, or start with plain Ruby first? thanks for any inputs!
2006 Apr 05
9
Is eval the only way?
Hi, I''m trying to write some methods which use a parameter to represent a Class name. A very simplistic example: def foo(class_name, conditions) x = class_name.find(:all, :conditions => "#{conditions}") end Unfortunately, this does not work. The only way around this problem that I can think of is to use eval: def foo(class_name, conditions) x = eval
2006 Mar 26
4
edge and 1.8.2/1.8.4 issues
I recently upgraded to 1.8.4 to try out mongrel, and so far have been in a kind of hell where I can''t get my app working! Currently running (or trying to run): Ruby version 1.8.4 (i386-mswin32) RubyGems version 0.8.11 Rails version 1.0.0 Active Record version 1.13.2 Action Pack version 1.11.2 Action Web Service version 1.0.0 Action Mailer version 1.1.5 Active Support version
2006 Mar 25
14
Creating a symbolic link within a Rails application?
Hi, how does one create a symbolic link within a Rails application? At this time, I can perform this action at the command line but I''m not sure how to do it within Rails. BTW, I''m doing the following command in Mac OS X: ln -s $SITE_ROOT/common_directory/* $SITE_ROOT/new_directory Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was