similar to: plugins and testing

Displaying 20 results from an estimated 70000 matches similar to: "plugins and testing"

2006 May 21
2
acts_as_taggable and single table inheritance
I''ve set up a couple of STI models like such that we get something like this... class A < AR:Base class B < A acts_as_taggable class C < A acst_as_taggable (using the acts_as_taggable plugin) I can tag things just fine this way, the problem I encounter is that the taggings are listed with the base class ("A") and not the appropriate subclass ("B"
2006 Mar 09
4
Testing Migrations
Is there some standard way to test migrations? It seems to me that an additional safeguard for migrations would be to test and see if applying the migrations to the test database allows one to reconstruct the structure of the development database. If you can''t, then there is an error in your migrations, most likely because someone hand-modified the database without generating a
2006 May 24
3
using a helper from the console
I''ve got a couple of helper functions in my application_helper file that I would like to run from the console (for debugging). What is the correct way to invoke a helper from the console? _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2006 Jun 02
2
Group checkbox toggling
This isn''t really a scriptaculous question, but it might be interesting anyway. I''m generating a rails app and in one form I have a grid of check-boxes (rows = A..H and col=1..12). I would like to put a checkbox in the column/row headers to toggle the boxes in a particular row or column. Each box has a name like ''position_A1'' or
2006 Feb 08
3
RJS templates before, during and after
RJS templates are nifty. They let you put all sorts of fun effects all over your bland html pages without too much work. The link_to_remote function also lets you run scripts before, during, and after an AJAX call is run by using callbacks. There does not seem to be an equivalent method for running an RJS template before or during an action. Rendering it at the end is no problem. One
2006 May 04
12
RJSCallback 0.1
Announcing RJSCallback 0.1 The RJS Callback plugin is being developed to provide Ruby On Rails with the ability to easily call RJS templates for the various callbacks associated with AJAX function calls (e.g., :before, :loading, :complete). Currently this plugin automatically detects, loads, and renders RJS templates with specific names and inserts them in the appropriate spot in
2006 Feb 21
4
Multi-page forms
I''m curious to see how others are dealing with the construction of multi-page forms. I can see a couple of ways to do this, each with their own advantages/disadvantates. Approach 1: * define one table with columns for each form entry. * define a method/view for each page, which only displays a subset of the fields. * submitting a page saves the data and moves on to the next page.
2006 Aug 02
5
Fun with ez_where
I''ve been trying to use the ez_where plugin to create a dynamic finder. The structure looks somehing like this.. === controller === def list attribute_filter = params[:filter] @filter = Caboose::EZ::Condition.new :table do attribute <=> attribute_filter if attribute_filter end # ... do the find with the @filter # end === view === .... <%= link_to
2006 Aug 07
1
Eager loading wierdness
Consider this problem. I have an Item that has_many Features I want to find all Items with a Feature name of ''foo''. Normally you would do this.. @items = Item.find(:all, :conditions=>["features.name = ?", ''foo''], :include=>:features) This all works fine and dandy except for this problem. If you do this... <% for item in @items %>
2006 Feb 18
6
Active Record errors value - Why doesn''t this work?
I''m creating an AR object in my controller and then attempting to add error messages to it: if (master_storeids.nil?) @item.errors.add_to_base ''No store is selected'' end This works without error but when it comes time for AR to add the record, it apparently initializes the errors because the message that I added does not cause the AR add to fail as you would
2006 Feb 08
3
Using shared RJS templates
I''ve got an action in my application controller that needs to call a shared RJS template. Typically it''s actually being called by subclasses of the application controller. I''ve tried this.. def action ...code.. render :partial => "shared/template" end with ''_template.rjs'' existing in the shared folder. The problem that crops
2006 Jul 15
12
Safe way to destroy records
Hello, how can I check if a destroy was successful? Is the object only frozen if deleted or do I have to do an additional find to see if there is a record left? What happens if an after_destroy callback returns false? Is there always a rollback? Markus
2006 Feb 01
0
Please explain transactions within sqlserveradapter.rb ?
Hello everyone, I am needing to resolve an error on sqlserveradapter revolving around a trigger on a table. When the AR object is saved, AR throws Cannot create new connection because in manual or distributed transaction mode. at from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in `log'' In order to resolve this, I
2006 Jun 12
0
Rails Testing Strategies
As part of an application I am developing, I have been delving into the dark art of Rails testing. Since the existing literature on the topic is a bit sparse, I have written up a couple of brief articles on testing strategies for rails. The first one is on the usefulness of ''Positive and Negative Controls'', and the other is a simple way to make sure you are working with
2006 Apr 30
0
Breakpoints in plugins?
I''m using the acts_as_taggable plugin for Rails, and trying to set a breakpoint within it to examine behavior. While breakpoints work just fine in my main application, execution is never halted for the breakpoint in the plugin. Are breakpoints intended to work in plugins, or am I trying to use an unsupported feature? Thanks guys. John -- Posted with http://DevLists.com. Sign
2006 Jun 22
4
Authorization Plugin 1.0 release candidate + 3 test apps
In honor of RailsConf, I''m releasing an authorization plugin with 3 test apps that show you how to use the system. A reasonably lengthy description can be found here: http://www.writertopia.com/developers/authorization I will also be talking about the plugin''s architecture in my RailsConf talk on Saturday. Some features: - Nice English-like way of expressing permissions through
2006 Jul 15
13
Active Record: Can it auto-create database tables for you?
Hi, Just get started with Rails and I''m trying to read ahead and find out whether Active Record supports auto-creation of database tables for you? Is this supported, or is the concept that you write your own database DDL to do this? Thanks -- Posted via http://www.ruby-forum.com/.
2006 May 06
3
Extending Rails plugins?
Gents, I''m using the acts_as_taggable rails plugin (not gem), and would like to add some additional methods to it. For example, the find_tagged_with methods essentially does a find tag in a list (effectively an OR), while I''d like to implement a find_tagged_with_all method that would implement an AND (so if I specified 4 tags, it would only return items that were
2006 Jul 07
3
dynamically updating a listbox from another listbox
Hi, I would like to be able to dynamically (without reloading the page) change the values from one listbox when a user select items from another listbox. I have a model ''Sector'' which has_many ''levels'' (and of cours, ''Level'' beyong_to ''sector''). I want to show the user two listboxes with the sectors and levels. But