So depends_on graduated to a project called Classy Inheritance. Why the name difference? Well depends_on represents just one type of relationship. I expect other relationships to be added as needs arise. One such method I could see is “composed_of”, where the object wouldn’t be required.
Lockdown will be using Classy Inheritance for [...]
Archive for May, 2008
Classy Inheritance
Posted in classy-inheritance on May 29, 2008 | Comments Off
depends_on update(2)
Posted in classy-inheritance on May 28, 2008 | Comments Off
This update allows for non-polymorphic associations. For instance a user belongs_to a profile. To define this association add the following to the User model:
depends_on :profile, :attrs => [:first_name, :last_name, :email]
Notice an “:as” option has not been passed because this isn’t a polymorphic association. So instead of adding the has_one call, a belongs_to [...]
depends_on update
Posted in classy-inheritance on May 28, 2008 | Comments Off
I’ve updated the code for depends_on.
This update adds a dynamic method, so if you had the call:
depends_on :content, :attrs => [:name, :url ], :as => :presentable
Then you would get a “find_with_content” class method that does the :include for you.
git checkout
Posted in Quick Tips, git on May 28, 2008 | Comments Off
This definitely falls in the duh! category:
If you delete a file and want to restore it to the trunk/master version, for subversion I would do:
svn update
to do the same with git:
git checkout <file>
Seems like this should have been obvious, but I guess I was expecting to find an update or restore or some other git [...]
depends_on
Posted in RubyOnRails, classy-inheritance on May 27, 2008 | Comments Off
For one of my projects I had the need for a polymorphic association in which one object required the existence of the other. I had written a specific version of this, but decided it could easily be abstracted. I didn’t go with the built in ActiveRecord polymorphic features as I wanted to strip [...]
Stage Update: 0.4.0
Posted in Stage on May 26, 2008 | Comments Off
This release addresses the use of namespaces such as “admin”. This release is targeted at Rails only.
For more information on Stage check out the RubyForge site.
Git and Tagging
Posted in Quick Tips, git on May 22, 2008 | Comments Off
Just a quick personal note on how to tag so I don’t have to look it up again. I’m not sure if this is right.?
git tag -a rel_0.0.0git push –tags
Announcing Lockdown
Posted in lockdown on May 10, 2008 | 1 Comment »
If you don’t care about how Lockdown came to be and just want to read about how it works, go to the RubyForge site.
Over the past few years, I have been refining a security system for RubyOnRails. I’ve used it in every Rails app I’ve ever written. However there aren’t many similarities between [...]
