Permalink
Commits on Sep 5, 2011
  1. Overwritten ActiveRecord::Relation#apply_finder_options :no_children …

    …option works again when called on a child class.
    committed Sep 5, 2011
Commits on Sep 4, 2011
  1. Overwritten ActiveRecord::Relation#apply_finder_options no longer use…

    …s options[:condition] because it would fail if that contained a string.
    committed Sep 4, 2011
  2. Now overrides ActiveRecord::Relation methods #to_a and #apply_finder_…

    …options instead of ActiveRecord::Base#find, so the fetching of all properties actually works when using Relation methods such as #includes and #where.
    committed Sep 4, 2011
  3. ClassMethods.find() now respects includes()'d associations by merely …

    …overwriting the original record's attributes instead of replacing the whole object.
    committed Sep 4, 2011
  4. ClassMethods.find() as well as proxies .all, .first and .last now tak…

    …es a :no_children option. If this option is set to true, only records of type self will be returned.
    committed Sep 4, 2011
  5. ChildInstanceMethods.save! now respects :validate option and raises R…

    …ecordNotSaved exception if saving failed, just like ActiveRecord's save! does.
    committed Sep 4, 2011
  6. :save, :update and :create callbacks are now correctly fired by Child…

    …InstanceMethods.save.
    committed Sep 4, 2011
  7. Removed `UPDATE … SET type` query executions, as it appears ActiveRec…

    …ord handles the type fine on it's own. (since Rails 3.1.0?)
    committed Sep 4, 2011
Commits on Sep 3, 2011
  1. self::Writable and root are now assigned self's @changed_attributes s…

    …o no attributes are skipped because their new values are equal to the default.
    committed Sep 3, 2011
  2. A child's id is now set to nil if it was 0 and a new record, so it wi…

    …ll get properly updated to the actual id used by the database after the first save.
    committed Sep 3, 2011
  3. Destroying now also works when the where part of the relation uses bi…

    …nds (for prepared statement deletes).
    committed Sep 3, 2011
Commits on Aug 28, 2011
  1. Merge pull request #25 from Rexly/master

    <subclass>.create! issue with postgres
    petehamilton committed Aug 28, 2011
Commits on Aug 24, 2011
  1. remove debug output

    Kyle Fleming committed Aug 24, 2011
  2. fixing destroy methods by overriding a more core function in ActiveRe…

    …cord::Relation
    Kyle Fleming committed Aug 24, 2011
Commits on Aug 23, 2011
  1. Merge branch 'master' of git://github.com/morgz/citier

    Conflicts:
    	lib/citier/child_instance_methods.rb
    	lib/citier/class_methods.rb
    	lib/citier/instance_methods.rb
    	lib/citier/root_instance_methods.rb
    Kyle Fleming committed Aug 23, 2011
Commits on Aug 22, 2011
  1. removed the after_save callback

    Rails 3 doesn't have a way of specifically calling an after save
    callback so just removing this for now and adding a way to do it
    specifically for the app I'm making.
    morgz committed Aug 22, 2011
Commits on Aug 21, 2011
  1. normalize modules to avoid conflict with rails

    Kyle Fleming committed Aug 21, 2011
Commits on Aug 20, 2011
Commits on Aug 19, 2011
  1. Fixed an issue with STI

    Kyle Fleming committed Aug 19, 2011
Commits on Aug 16, 2011
Commits on Jul 16, 2011
  1. Added the type to the child model before saving so it behaves in the …

    …same way as saving the parent.
    
    Less relevant here but still might effect the type is you have a hierarchy of more than 2 classes. Best to be consistent.
    morgz committed Jul 16, 2011
Commits on Jul 15, 2011
  1. just missed the type in updatetype

    morgz committed Jul 15, 2011
  2. Fixed Issue with saving a child after it's retrieved from parent

    Problem:
    1. Create a Facility of Type 'SwimmingPool'
    SwimmingPool.create(:name => 'Dan Pool', :tldc_id => 97)
    
    2. Retrieve it through root class
    f = Facility.last
    
    3. Save a change
    f.name = 'tits'
    f.save
    
    4. BOOM
    Our previous SwimmingPool now becomes a Facility type.
    
    This was because when we fetch through the root we have no attributes from the child so it didn't update the child type when we saved the name change. The first run through the save that saves the root, chooses the type from the classname.
    morgz committed Jul 15, 2011
  3. Deleting a Root Instance makes sure we leave no children behind

    Just added some checks into the child_instance delete overide
    morgz committed Jul 15, 2011
Commits on Jul 14, 2011
  1. fixed validator to allow updating

    morgz committed Jul 14, 2011