similar to: Index help on Polymorphic Associations

Displaying 17 results from an estimated 17 matches similar to: "Index help on Polymorphic Associations"

2006 Sep 04
2
"include" versus "extend" - what's the difference
Hi, Just wondering when one would use "include" over "extend"? Both seem to bring in methods to the class no? The context is I''m just trying to understand why both are used with the acts_as_audited plugin: Full extract from plugin (used within here): ================================================== # Copyright (c) 2006 Brandon Keepers # # Permission is hereby
2006 Aug 16
1
Active Record Observers causing 404''s and other weird issues
Hi all. I''ve got a simple AR Observer: class NewOrderObserver < ActiveRecord::Observer observe NewOrder def after_create(object) Note.create(...) end end In environment.rb I have the following line: config.active_record.observers = :new_order_observer And in application.rb I have: NewOrderObserver.instance Aside from simply not working, it''s causing
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 Feb 28
4
No action from AJAX link_to_remote...
AJAX & Ruby & Rails newbie here. I''ve got a link to remote that I believe should be working, but doesn''t seem in fact to do *anything*. I''m looking at the webrick log, since the Book says I should be seeing some hot POST action in there, but there''s literally no change when I click on the JS link. From looking at the source that''s
2006 Mar 04
10
Help setting up relationships needed
This is a bit of a long question, but to those of you with some experience, it should be fairly simple I think. I have a notes page that should list all notes the user has entered for all books chronologically like this. Book One: This is the note. Book Four: This is the note. Book One: A different note, entered later. Right now my models are: User has_many :books Book has_many
2006 Mar 01
0
TextHelpers in Controller?
I have a controller that saves info to the DB. It''s based on the AJAX scaffolding code. All I want to do is add a simple_format() function to it before I save a user-edited text field to the DB. TO convert line returns to <br>s, etc. @project_note = ProjectNote.new(params[:project_note]) @project_note.body = simple_format(@project_note.body) Since this happens in a controller,
2008 Jul 01
0
acts_as_audited on ActiveResource
I came across this awesome plugin used for auditing models. This is an ActiveRecord extension. However I was wondering if I could tweak it a little to make it work for ActiveResource. In case you haven''t heard about acts_as_audited plugin, here is the link to check it out. http://opensoul.org/2006/07/21/acts_as_audited Is there anyone who has experience in similar context? Please help!
2009 Nov 26
4
Is this a bug?
Hello all, while I''m using acts_as_audited(on jruby platform), after vendored the acts_as_audited, it reports some error, line 167, # Start observing the declared classes and their subclasses. def initialize Set.new(observed_classes + observed_subclasses).each { |klass| add_observer! klass } #this line end after some trace shows this one, when observed_classes is empty, will
2007 Sep 14
2
Testing a nested controller
Hey everyone. I really stuck on testing a nested controller. I''m trying to make a request using get and afterwards checking the response by response.should ... My routes.rb looks like this: map.resources :writers do |writers| writers.resources :notes end In my notes_controller_spec.rb def do_get writer_id = 1 note_id = 1 get note_path(writer_id, note_id) end it "should show
2006 Aug 19
1
Re: DB Auditing
On Saturday 19 August 2006 11:25, Jeremy Cowgar wrote: > A recent thread titled "DB record versioning/audit" made me post this > message: > > I''ve created a plugin called "acts_as_logged". There already is acts_as_audited. Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2007 Apr 09
1
multi-way join files with types? (resend)
[ I''m still hoping for some help with this, folks... -r ] As part of the Arti (http://mephisto-ar.cfcl.com) effort, I''m looking into creating a database to store information on entities and relationships found in Ruby and Rails, as: Method M1 is defined for Class C1 in File F1. Method M1 of Class C1 is used by Method M2 in File F2. Disregarding (for the moment)
2005 Sep 11
1
Patches awaiting decision
I hope I''m not breaching etiquette too badly. It''s not my intention to offend or pressurize anyone. Also, I admit my personal motivation. I had a look at the list of pending patches (http://dev.rubyonrails.org/report/3) to get an idea what patches are currently open and see what their state is. From some of my own patches I know that they are basically ready for either
2009 Dec 17
2
RFC: conflict_warnings plugin
Greetings, I was hoping to get some feedback on a plugin I wrote. The plugin is called conflict_warnings and is currently available from my github repository at http://github.com/EmFi/conflict_warnings The purpose of the plugin is to provide a simple methods of preventing data inconsistencies that could arise from multiple users interacting with the same resource. Under basic operation a
2009 Jul 29
9
partials...
I am getting a blank page, no errors, just a blank page. I have 2 files... reports/city_taxes_print.erb reports/_city_taxes_print.erb and my method is city_taxes_print and after getting variables from the controller, my erb file which is fairly basic... <% # City of Scottsdale @taxauthids = [ "32", "40" ] @report_title = "Scottsdale Sales Tax Detail Report for
2008 Jun 20
15
before_save model callback rspec testing
hi all, i''m learning rspec and i can''t figure out how to test if a callback is executed in a model. my model code is: class User < ActiveRecord::Base before_save :encrypt_password ... def encrypt(password) self.class.encrypt(password, salt) end thanks a lot, cs. -- Posted via http://www.ruby-forum.com/.
2007 Sep 07
12
Preconditions
Sorry, lots of questions these days. Is there a normal approach for preconditions? In JUnit, I might put a few assertions in the setUp() just to make sure that the test ''data'' I''ve created meets expectations before going to test it. So, for instance, I''ve got an object that is audited using acts_as_audited and I''d like to test the XML that results