Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / habtm-with-deferred-save

Rails plugin. Defers saving the records you add to habtm association until you call model.save, allowing validation in the style of normal attributes.

Clone this repository (size: 195.2 KB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/habtm-with-deferred-save
hg clone ssh://hg@bitbucket.org/nolith/habtm-with-deferred-save

Commit 160ee2cae2ae Raw commit »

commit
160ee2cae2ae
parent
80300ab7a55f
branch
default

Made it so that find, first, last, and any missing methods (this would
include the "dynamic" finders such as find_by_name) called on the
collection_with_deferred_save collection are passed on to the
collection_without_deferred_save collection. (Which means they will
operate strictly on what's in the database and not take into account
what's in unsaved_collection.)

Comments

    Log in to comment »

    File Lines added Lines removed
    .gitignore 1
    lib/has_and_belongs_to_many_with_deferred_save.rb 35 12
    spec/has_and_belongs_to_many_with_deferred_save_spec.rb 16 3
    spec/models/person.rb 4
    spec/models/room.rb 1