Interesting Things
- Rails Bug: composed_of seems to be broken, at least in Rails 1.99. The :mappings parameter states that it can take an array of symbol-pairs, but symbols do not work — only strings work. Example:
Does not work:
composed_of :name
:class_name => Name
:mapping => [
[:first_name, :first], # :symbol, :symbol does not work!
[:last_name, :last] # :symbol, :symbol does not work!
]
Works!
composed_of :name
:class_name => Name
:mapping => [
['first_name', 'first'], # 'string', 'string' works!
['last_name', 'last'] # 'string', 'string' works!
]
- Ruby ain’t Java! A recent Java-convert ran into the following: when calling a private instance method, you must not indicate
self.private_method, but instead callprivate_method. Example:
Class PrivateCaller
def call_private_here
puts private_method #=> works!
puts self.private_method #=> self? uh oh!
end
private
def private_method
'*** You Called? ***'
end
end
>> priv = PrivateCaller.new
=> #<privatecaller:0x14ec39c>
>> priv.call_private_here
*** You Called? ***
NoMethodError: private method `private_method' called for #</privatecaller:0x14ec39c><privatecaller:0x14ec39c>
from (irb):4:in `private_caller'
from (irb):23
from :0
</privatecaller:0x14ec39c>- TextMate’s Ruby on Rails bundle does not work correctly with Rails 2.0.
- RubyGems 0.95 is not compatable with geminstaller, written and maintained by our own Chad Woolley. Chad and the Gems folks are already on the case.
Man you don’t even know how long I’ve waited for this since disabling my own Movable Type widget
December 20, 2007 at 11:44 pm