Permalink
Browse files

Do a better job of linking class/method RDocs to the guides

This links all of the guides except the reflection guide to at least
one class or method.  There's probably more places that should link
to the guides, but this is a good start.
  • Loading branch information...
1 parent 05fdc1c commit 4bcf03412f9af88fc147e3521f0740ebecdc1a3d @jeremyevans committed Apr 19, 2010
View
@@ -46,6 +46,9 @@
#
# You can set the SEQUEL_NO_CORE_EXTENSIONS constant or environment variable to have
# Sequel not extend the core classes.
+#
+# For a more expanded introduction, see the {README}[link:files/README_rdoc.html].
+# For a quicker introduction, see the {cheat sheet}[link:files/doc/cheat_sheet_rdoc.html].
module Sequel
@convert_two_digit_years = true
@datetime_class = Time
@@ -118,7 +121,8 @@ def self.condition_specifier?(obj)
#
# Sequel.connect('sqlite://blog.db'){|db| puts db[:users].count}
#
- # For details, see the "Connecting to a Database" Guide.
+ # For details, see the {"Connecting to a Database" guide}[link:files/doc/opening_databases_rdoc.html].
+ # To set up a master/slave or sharded database connection, see the {"Master/Slave Databases and Sharding" guide}[link:files/doc/sharding_rdoc.html].
def self.connect(*args, &block)
Database.connect(*args, &block)
end
@@ -11,6 +11,9 @@ module Schema
# Schema::Generator has some methods but also includes method_missing,
# allowing users to specify column type as a method instead of using
# the column method, which makes for a nicer DSL.
+ #
+ # For more information on Sequel's support for schema modification, see
+ # the {"Schema Modification" guide}[link:files/doc/schema_rdoc.html].
class Generator
# Classes specifying generic types that Sequel will convert to database-specific types.
GENERIC_TYPES=[String, Integer, Fixnum, Bignum, Float, Numeric, BigDecimal,
@@ -200,6 +203,9 @@ def composite_foreign_key(columns, opts)
# object and a block of operations to perform on the table, and
# gives the Database a table an array of operations, which the database uses to
# alter a table's description.
+ #
+ # For more information on Sequel's support for schema modification, see
+ # the {"Schema Modification" guide}[link:files/doc/schema_rdoc.html].
class AlterTableGenerator
# An array of DDL operations to perform
attr_reader :operations
@@ -46,7 +46,7 @@ def add_index(table, columns, options={})
# definitions using create_table, and #add_index accepts all the options
# available for index definition.
#
- # See Schema::AlterTableGenerator.
+ # See Schema::AlterTableGenerator and the {"Schema Modification" guide}[link:files/doc/schema_rdoc.html].
def alter_table(name, generator=nil, &block)
remove_cached_schema(name)
generator ||= Schema::AlterTableGenerator.new(self, &block)
@@ -66,7 +66,7 @@ def alter_table(name, generator=nil, &block)
# * :temp - Create the table as a temporary table.
# * :ignore_index_errors - Ignore any errors when creating indexes.
#
- # See Schema::Generator.
+ # See Schema::Generator and the {"Schema Modification" guide}[link:files/doc/schema_rdoc.html].
def create_table(name, options={}, &block)
options = {:generator=>options} if options.is_a?(Schema::Generator)
generator = options[:generator] || Schema::Generator.new(self, &block)
@@ -20,6 +20,8 @@ module Sequel
#
# Datasets are Enumerable objects, so they can be manipulated using any
# of the Enumerable methods, such as map, inject, etc.
+ #
+ # For more information, see the {"Dataset Basics" guide}[link:files/doc/dataset_basics_rdoc.html].
class Dataset
extend Metaprogramming
include Metaprogramming
@@ -3,7 +3,7 @@ class Dataset
# ---------------------
# :section: Methods related to prepared statements or bound variables
# On some adapters, these use native prepared statements and bound variables, on others
- # support is emulated.
+ # support is emulated. For details, see the {"Prepared Statements/Bound Variables" guide}[link:files/doc/prepared_statements_rdoc.html].
# ---------------------
PREPARED_ARG_PLACEHOLDER = LiteralString.new('?').freeze
@@ -107,7 +107,8 @@ def exclude(*cond, &block)
#
# filter also takes a block, which should return one of the above argument
# types, and is treated the same way. This block yields a virtual row object,
- # which is easy to use to create identifiers and functions.
+ # which is easy to use to create identifiers and functions. For more details
+ # on the virtual row support, see the {"Virtual Rows" guide}[link:files/doc/virtual_rows_rdoc.html]
#
# If both a block and regular argument
# are provided, they get ANDed together.
@@ -133,7 +134,7 @@ def exclude(*cond, &block)
# software.filter{|o| o.price < 100}.sql #=>
# "SELECT * FROM items WHERE ((category = 'software') AND (price < 100))"
#
- # See doc/dataset_filtering.rdoc for more examples and details.
+ # See the the {"Dataset Filtering" guide}[link:files/doc/dataset_filtering_rdoc.html] for more examples and details.
def filter(*cond, &block)
_filter(@opts[:having] ? :having : :where, *cond, &block)
end
@@ -410,17 +410,17 @@ module AssociationDatasetMethods
# end
#
# The project class now has the following instance methods:
- # * portfolio - Returns the associated portfolio.
- # * portfolio=(obj) - Sets the associated portfolio to the object,
- # but the change is not persisted until you save the record (for many_to_one associations).
- # * portfolio_dataset - Returns a dataset that would return the associated
- # portfolio, only useful in fairly specific circumstances.
- # * milestones - Returns an array of associated milestones
- # * add_milestone(obj) - Associates the passed milestone with this object.
- # * remove_milestone(obj) - Removes the association with the passed milestone.
- # * remove_all_milestones - Removes associations with all associated milestones.
- # * milestones_dataset - Returns a dataset that would return the associated
- # milestones, allowing for further filtering/limiting/etc.
+ # portfolio :: Returns the associated portfolio.
+ # portfolio=(obj) :: Sets the associated portfolio to the object,
+ # but the change is not persisted until you save the record (for many_to_one associations).
+ # portfolio_dataset :: Returns a dataset that would return the associated
+ # portfolio, only useful in fairly specific circumstances.
+ # milestones :: Returns an array of associated milestones
+ # add_milestone(obj) :: Associates the passed milestone with this object.
+ # remove_milestone(obj) :: Removes the association with the passed milestone.
+ # remove_all_milestones :: Removes associations with all associated milestones.
+ # milestones_dataset :: Returns a dataset that would return the associated
+ # milestones, allowing for further filtering/limiting/etc.
#
# If you want to override the behavior of the add_/remove_/remove_all_/ methods
# or the association setter method, there are private instance methods created that are prepended
@@ -439,6 +439,8 @@ module AssociationDatasetMethods
# => [:portfolio, :milestones]
# Project.association_reflection(:portfolio)
# => {:type => :many_to_one, :name => :portfolio, :class_name => "Portfolio"}
+ #
+ # For examples of advanced usage, see the {Advanced Associations page}[link:files/doc/advanced_associations_rdoc.html].
module ClassMethods
# All association reflections defined for this model (default: none).
attr_reader :association_reflections

0 comments on commit 4bcf034

Please sign in to comment.