1. 27 4月, 2012 3 次提交
  2. 17 1月, 2012 1 次提交
  3. 29 12月, 2011 1 次提交
  4. 07 6月, 2011 1 次提交
  5. 05 6月, 2011 1 次提交
    • J
      Refactor Active Record test connection setup. Please see the... · 253bb6b9
      Jon Leighton 提交于
      Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
      253bb6b9
  6. 18 2月, 2011 1 次提交
  7. 08 1月, 2011 1 次提交
  8. 05 1月, 2011 1 次提交
  9. 04 1月, 2011 1 次提交
    • J
      Remove undocumented feature from has_one where you could pass false as the... · 40afcade
      Jon Leighton 提交于
      Remove undocumented feature from has_one where you could pass false as the second parameter to build_assoc or create_assoc, and the existing associated object would be untouched (the foreign key would not be nullified, and it would not be deleted). If you want behaviour similar to this you can do the following things:
      
      * Use :dependent => :nullify (or don't specify :dependent) if you want to prevent the existing associated object from being deleted
      * Use has_many if you actually want multiple associated objects
      * Explicitly set the foreign key if, for some reason, you really need to have multiple objects associated with the same has_one. E.g.
      
          previous = obj.assoc
          obj.create_assoc
          previous.update_attributes(:obj_id => obj.id)
      40afcade
  10. 23 11月, 2010 1 次提交
  11. 17 11月, 2010 1 次提交
  12. 19 7月, 2010 1 次提交
  13. 19 5月, 2010 1 次提交
  14. 29 12月, 2009 1 次提交
  15. 28 12月, 2009 5 次提交
  16. 10 5月, 2009 2 次提交
  17. 05 5月, 2009 1 次提交
    • M
      Providing support for :inverse_of as an option to associations. · ccea9838
      Murray Steele 提交于
      You can now add an :inverse_of option to has_one, has_many and belongs_to associations.  This is best described with an example:
      
      class Man < ActiveRecord::Base
        has_one :face, :inverse_of => :man
      end
      
      class Face < ActiveRecord::Base
        belongs_to :man, :inverse_of => :face
      end
      
      m = Man.first
      f = m.face
      
      Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again).  With these new :inverse_of options m and f.man are the same in memory instance.
      
      Currently :inverse_of supports has_one and has_many (but not the :through variants) associations.  It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic.
      Signed-off-by: NMurray Steele <muz@h-lame.com>
      Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
      ccea9838