This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current behavior: | |
$ irb | |
jruby-1.7.1 :001 > require 'java' | |
=> false | |
jruby-1.7.1 :002 > java_import 'java.util.ArrayList' | |
=> [Java::JavaUtil::ArrayList] | |
jruby-1.7.1 :003 > a = ArrayList.new | |
=> #<Java::JavaUtil::ArrayList:0x12910b0b> | |
jruby-1.7.1 :004 > a << 1 << 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The problem: In your Rails 3 project, you have a model Request that models a | |
# user's request for content related to a specific problem or topic. The user | |
# can tag her request with any number of words. These are modeled by a Tag class | |
# backed by a tags DB table. Since you want unique records per tag, you have a | |
# Tagging class backed by a taggings table. Taggings is a a many-to-many table | |
# with some additional information. Also, other models in the application | |
# besides requests can be tagged: The Tagging class defines a polymorphic | |
# relationship "taggable" with those models. | |
# | |
# So pretty soon you want to look up all the requests that are tagged with |