similar to: Problem with alias_method in a plugin

Displaying 20 results from an estimated 3000 matches similar to: "Problem with alias_method in a plugin"

2007 Mar 28
1
attachment_fu & update_attributes... bug?
It seems that attachment_fu is a pretty popular plugin (it''s great), but I''ve been having a terrible time trying to figure out an issue when using "update_attributes". I''m storing files on the file system rather than in a database. It seems that when "update_attributes" is called with a new file, upload_data= tries to copy a file that
2006 Mar 12
1
alias_method interferes ApplicationHelper
Hello, I''m using Ruby 1.8.4 (darwinport), rails-1.0.0 (gem) , Powerbook / Mac OS X 10.4.5 , Webrick. How come Rails always raises NoMethodError for my helper (must_fill and rp or number_to_currency_rp) in application_helper.rb ? I doubt that alias_method is the culprit, but if i give # comment then there will be no errors at all ... :/ what am i doing wrong? is it a bug or stupid me? Thx
2007 Mar 09
0
Merb + attachment_fu
Merbists, I saw a note in the attachment_fu source code regarding supporting Merb[1] as well as a post on the Caboose forum[2]. Has anyone gotten Merb working with Rick Olson''s attachment_fu to handle uploads for a Rails app? I''ve hacked together something, but it''s not pretty. Besides fixing the TODO mentioned in the attachment_fu source code to support Merb
2007 Feb 26
2
undefined method ... from `alias_method'
0 wicked var/www % ./script/console Loading development environment. >> r = Recipe.find :first NameError: undefined method `recipe_type='' for class `Recipe'' from ./script/../config/../config/../app/models/recipe.rb: 101:in `alias_method'' In recipes_controller: alias_method :orig_recipe_type=, :recipe_type= def recipe_type=(t) if t.nil?
2008 Jan 18
2
NameError when using alias_method -- but method exists?
Hello Rubyists, I am a bit stumped here. I want to extend the ''load_file'' method in the YAML module. Following along with the PickAxe example of making old methods do new things, I try this in irb: >> module YAML >> alias_method :orig_load_f, :load_file >> def load_file(*args) >> contents = orig_load_f(*args) >>
2006 Feb 01
7
Explanation of "alias_method"
Hi! I''m trying to extend ActiveRecord''s find method (Rails 1.0, Ruby 1.8.2), but I recognize a strange behaviour of the "alias_method" call. I wrote a very simple script to explain my problem: ------------------------------------------------------ module ActiveRecordExtension def self.included(base) base.extend(ClassMethods) base.class_eval do
2007 Feb 14
0
mini_magick processor for attachment_fu - HELP
I have posted this here also: http://beast.caboo.se/forums/2/topics/ 823 I''m writing this for a custom application that uses attachment_fu but I thought it might interest some people here who are have problems with rmagick or image_science. rmagick is causing large memory spikes for my application and my host will not install image_science, I tried out image_science locally and the
2007 Jun 29
1
attachment_fu validation error
I have this class: class Logo < ActiveRecord::Base has_one :something has_attachment :content_type => :image, :storage => :db_file, :max_size => 500.kilobytes :thumbnails => {:web => ''150x100'', :pdf => ''150x100''}, :processor =>
2007 Dec 13
4
Attachment_fu problems on updates
On the creation of a member the member''s picture uploads as it should. However, when updating the member, while selecting a new picture, an error is thrown: can''t convert nil into String RAILS_ROOT: /Users/chris/Documents/Projects/Rails/CommunityCMS/trunk Application Trace | Framework Trace | Full Trace
2006 Jun 18
2
using javascript to get an attribute using an ID
Hi everyone, I''m trying to use ajax to update the selected value of a select element. Here''s what I have so far: function RailsModel(model_name) { this.model_name = model_name; } RailsModel.prototype.getAttributeById = function(attribute, id) { Ajax.Request(''/models/get_attribute_by_id/'' + this.model_name + ''/'' + attribute +
2006 Aug 16
3
AR: column methods?
In a model, it seems that methods for column access are only created when one column method on an object is accessed. So, how can one override the default column methods? For instance: create_table "dogs", :force => true do |t| t.column "color", :string end create_table "tails", :force => true do |t| t.column "dog_id", :integer,
2007 Aug 14
1
Upgrade to 1.0.8 broke Rake
Hello Guys. I''m upgrading a project from 0.9.8 to 1.0.8, following this procedure: * Removed vendor/plugins/rspec* completely. * installed rspec and rspec_on_rails from svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_8 * Run script/generate rspec to update spec_helper and spec.opts Now, when running rake, get the following error: superclass mismatch for class Annotation The following
2007 Aug 12
3
Scope and specing models
Hello all, I''m currently having an issue with some specs, specifically scope issues (probably more of a scope issue than a spec issue at this point)... Here''s the error: ActiveRecord::AssociationTypeMismatch in ''A new User should know what role it has'' Role expected, got NilClass D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in
2008 Feb 23
3
Attachment_fu: how to remove images?
I just used attachment_fu for the first time, and it works quite well. I have a user-model, and each of them has_one :image (and the images belongs_to :user). I have a question on this though: how can i remove images? Whenever i set a new image for a user (a user who already has an image), then the table with images gets updated correctly, with the user_id column of the old image set to null, and
2006 Jul 02
0
Rails Core Weekly June 19 - July 2 2006
This is another edition of Rails Core Weekly, affectionately known as RCW. A much nicer pre-web 3.0 version is available from the following url : http://www.pinupgeek.com/articles/category/rails-core-weekly-news We have an Atom/RSS feed available there as well. Rails Core Weekly summarizes the rails-core mailing list, a list dedicated to Ruby on Rails internals and its development. RCW is
2008 Mar 23
1
redcloth gem ragel code doesn''t build in jruby
I tried to install RedCloth-3.274 in jruby (trunk) but the install failed when RedCloth tried to build the C code using mkmf: I forget whether SuperRedcloth ever did build in JRuby?? I know Hpricot (which also uses ragel which can compile to Java code) works in JRuby -- with the patch here: https://code.whytheluckystiff.net/hpricot/ticket/131) I might be confusing the two ... FYI: If you
2007 Sep 07
3
Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
Hi, I am deploying a Rails website using Capistrano to a VPS running the site through Apache and Mongrel. ''cap deploy'' works fine, and mongrels are restarted. When I execute ''cap deploy:rollback'', however, my script fails to restart the mongrels giving this error: !!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could be running already.
2007 Nov 15
0
ParameterMatcher backwards compatibility broken
I''ve just committed (revision 194) a first stab at supporting optional parameter matching. More about this later, but in the meantime I wanted to warn anyone bold enough to be working with "edge" Mocha, that any custom parameter matchers they have written will be broken by this change. However it is easy enough to fix them. You need to derive the matcher from
2007 May 03
0
Deploying on windows 2000 server
Posted this on the rubyonrails-deployment group (http:// groups.google.com/group/rubyonrails-deployment/browse_thread/thread/ d5ef4f3525c3c39a), but figured it couldn''t hurt posting it here too. I''m not a windows user, and I''ve never deployed on windows. Made this small app for a company, and they want it deployed on one of their own servers - a windows server.
2007 Jul 29
3
Memory leak in PerFieldAnalyzer
Hello everyone, we''ve recently discovered a memory leak in the PerFieldAnalyzer. If you use the PerFieldAnalyzer (which you acutally should), you should switch to a pure ruby version of that analyzer. The C version of the Analyzer is consuming memory on every analyzing request. You can find an example script to verify the leak[1]. Furthermore we''ve added a workaround, building