README.rdoc in rostra-0.0.7 vs README.rdoc in rostra-0.0.8
- old
+ new
@@ -27,9 +27,38 @@
class User < ActiveRecord::Base
rostra
end
+== Customizing the question and answer models
+Rostra provides a DSL for adding application specific logic to <tt>Rostra::Question</tt> and <tt>Rostra:Answer</tt>:
+
+ class User < ActiveRecord::Base
+ rostra do
+ questions do
+ # Code inside this block will be evaluated in the context of `Rostra::Question`.
+
+ # So an instance method might look like:
+ #
+ def active?
+ # call this like @question.active?
+ end
+ end
+
+ answers do
+ # Code inside this block will be evaluated in the context of `Rostra::Answer`
+
+ # So a class method might look like:
+ #
+ def self.recently_up_voted
+ # call this like Rostra::Answer.recently_up_voted
+ end
+ end
+
+ end
+ end
+
+
== Contributing to Rostra
Fork the project, make your changes, and submit a pull request. Please ensure the tests pass:
rspec spec # runs the specs
cucumber features # runs the cukes