[ANN] Rails 0.9.2: End of requiring models, models in sessions, fixes

Discussion in 'Ruby' started by David Heinemeier Hansson, Dec 23, 2004.

  1. Thanks to the powers of const_missing, you no longer need to explicitly
    require models that reside in their own files. They’ll spring to life
    automatically, which is very helpful for inheritance where you’re
    documenting the dependency using subclassing already and for instant
    use of models in script/console. It’s now also safe to place models in
    sessions without worrying about stale association caches—they’re
    cleared at the end of each request. In addition, there are about 33
    other fixes, changes, and features in this release.

    Update your Rails through gems with "gem install rails"

    Rails 0.9.2

    * Fixed CTRL-C exists from the Breakpointer to be a clean affair
    without error dumping [Kent Sibilev]

    * Fixed "rake stats" to work with sub-directories in models and
    controllers and to report the code to test ration [Scott Baron]

    * Added that Active Record associations are now reloaded instead of
    cleared to work with the new const_missing hook in Active Record.

    * Added graceful handling of an inaccessible log file by redirecting
    output to STDERR with a warning #330 [rainmkr]

    * Added support for a -h/--help parameter in the generator #331

    * Fixed that File.expand_path in config/environment.rb would fail when
    dealing with symlinked public directories [mjobin]

    * Upgraded to Action Pack 1.1.0 and Active Record 1.3.0

    Active Record 1.3.0

    * Added a require_association hook on const_missing that makes it
    possible to use any model class without requiring it first. This makes
    STI look like:

    require_association 'person'
    class Employee < Person

    class Employee < Person

    This also reduces the usefulness of Controller.model in Action Pack
    to currently only being for documentation purposes.

    * Added that Base.update_all and Base.delete_all return an integer of
    the number of affected rows #341

    * Added scope option to validation_uniqueness #349 [Kent Sibilev]

    * Added respondence to *_before_type_cast for all attributes to return
    their string-state before they were type casted by the column type.
    This is helpful for getting "100,000" back on a integer-based
    validation where the value would normally be "100".

    * Added allow_nil options to validates_inclusion_of so that validation
    is only triggered if the attribute is not nil [what-a-day]

    * Added work-around for PostgreSQL and the problem of getting fixtures
    to be created from id 1 on each test case. This only works for
    auto-incrementing primary keys called "id" for now #359 [Scott Baron]

    * Added Base#clear_association_cache to empty all the cached
    associations #347 [Tobias Luetke]

    * Added more informative exceptions in establish_connection #356

    * Added Base#update_attributes that'll accept a hash of attributes and
    save the record (returning true if it passed validation, false

    person.attributes = @params["person"]


    * Added Base.destroy and Base.delete to remove records without holding
    a reference to them first.

    * Added that query benchmarking will only happen if its going to be
    logged anyway #344

    * Added higher_item and lower_item as public methods for acts_as_list
    #342 [Tobias Luetke]

    * Fixed that options[:counter_sql] was overwritten with interpolated
    sql rather than original sql #355 [bitsweat]

    * Fixed that overriding an attribute's accessor would be disregarded by
    add_on_empty and add_on_boundary_breaking because they simply used the
    attributes[] hash instead of checking for @base.respond_to?(attr.to_s).

    * Fixed that Base.table_name would expect a parameter when used in
    has_and_belongs_to_many joins [Anna Lissa Cruz]

    * Fixed that nested transactions now work by letting the outer most
    transaction have the responsibilty of starting and rolling back the
    transaction. If any of the inner transactions swallow the exception
    raised, though, the transaction will not be rolled back. So always let
    the transaction bubble up even when you've dealt with local issues.
    Closes #231 and #340.

    * Fixed validates_{confirmation,acceptance}_of to only happen when the
    virtual attributes are not nil #348 []

    * Changed the interface on AbstractAdapter to require that adapters
    return the number of affected rows on delete and update operations.

    * Fixed the automated timestamping feature when running under Rails'
    development environment that resets the inheritable attributes on each

    Action Pack 1.1.0

    * Added search through session to clear out association caches at the
    end of each request. This makes it possible to place Active Record
    objects in the session without worrying about stale data in the
    associations (the main object is still subject to caching, naturally)
    #347 [Tobias Luetke]

    * Added more informative exception when using helper :some_helper and
    the helper requires another file that fails, you'll get an error
    message tells you what file actually failed to load, rather than
    falling back on assuming it was the helper file itself #346 [dblack]

    * Added use of *_before_type_cast for all input and text fields. This
    is helpful for getting "100,000" back on a integer-based validation
    where the value would normally be "100".

    * Added Request#port_string to get something like ":8080" back on 8080
    and "" on 80 (or 443 with https).

    * Added Request#domain (returns string) and Request#subdomains (returns

    * Added POST support for the breakpoint retries, so form processing
    that raises an exception can be retried with the original request
    [Florian Gross]

    * Fixed regression with Base#reset_session that wouldn't use the the

    * Fixed error rendering of rxml documents to not just swallow the
    exception and return 0 (still not guessing the right line, but hey)

    * Fixed that textilize and markdown would instantiate their engines
    even on empty strings. This also fixes #333 [Ulysses]

    * Fixed UrlHelper#link_to_unless so it doesn't care if the id is a
    string or fixnum [zenspider]
    David Heinemeier Hansson, Dec 23, 2004
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vinjvinj
    Jeremy Sanders
    Nov 10, 2005
  2. David Heinemeier Hansson
    David Heinemeier Hansson
    Oct 25, 2004
  3. David Heinemeier Hansson
    James Britt
    Nov 18, 2004
  4. David Heinemeier Hansson

    [ANN] Rails 0.9.5: A world of fixes and tweaks

    David Heinemeier Hansson, Jan 26, 2005, in forum: Ruby
    David Heinemeier Hansson
    Jan 26, 2005
  5. David Heinemeier Hansson
    Bill Guindon
    Mar 7, 2005
  6. David Heinemeier Hansson
    David Heinemeier Hansson
    Mar 27, 2005
  7. David Heinemeier Hansson

    Rails 0.13: 225+ features/fixes in 75 days!

    David Heinemeier Hansson, Jul 6, 2005, in forum: Ruby
    David Heinemeier Hansson
    Jul 6, 2005
  8. BearItAll

    Rails validate in models

    BearItAll, Sep 5, 2005, in forum: Ruby
    Sep 5, 2005