search for: new_copy

Displaying 2 results from an estimated 2 matches for "new_copy".

Did you mean: new_code
2006 Jun 21
1
Plugin Panic! - no accessing a model''s class methods?
Hi plugin-authors. So this is a little bit of take two on this question, but why can''t I access a singleton on the model calling my plugin? The crux of the full plugin below is: #logger.info self.class.to_s new_copy = self.class.new( @copyable_attributes ) the logger spits out "Datatype", but I get an error from rails saying: undefined method `datatype'' for false:FalseClass for the self.class.new line. I also feel haunted by the knowledge that this is far easier than I think it is, tho...
2006 Jun 05
0
Plugin Namespace Oddities?
...ble_attributes.delete ''id'' options.each do |key, value| next if key.class == String options.delete key options[key.to_s] = value end copyable_attributes.merge! options logger.info self.class.to_s new_copy = self.class.send :new, copyable_attributes new_copy.save end end Originally I was calling self.create, but that failed as well. Rails is tossing my to an error page claiming: undefined method `datatype'' for false:FalseClass however, in my log, the self.class....