Introduction of record_with_operator

download Introduction of record_with_operator

of 44

  • date post

    08-May-2015
  • Category

    Technology

  • view

    2.204
  • download

    1

Embed Size (px)

description

Rails plugin to set created_by, updated_by, deleted_by to ActiveRecord objects. Supports associations.

Transcript of Introduction of record_with_operator

  • 1.- record_with_operator Meadowy.org2009-08-25;Mitaka.rb#04;Bistro Epices2009826

2. Web2009826 3. 2009826 4. / 2009826 5. 2009826 6. 2009826 7. 2009826 8. def some_callback if user && user.admin? .... endend2009826 9. 2009826 10. ActiveScaffold 2009826 11. Controllercurrent_user2009826 12. MVC 2009826 13. current_user2009826 14. 2009826 15. 2009826 16. record_with_operator2009826 17. record_with_operatorRails MIT http://github.com/nay/record_with_operator/tree2009826 18. installgem install nay-record_with_operator --source http://gems.github.com2009826 19. ActiveRecord operator2009826 20. created_by operator.id2009826 21. updated_bydeleted_by2009826 22. created_bycreator2009826 23. updaterdeleter2009826 24. operator2009826 25. operator 2009826 26. parent.operator = userparent.children.each do c c.operator # => userend2009826 27. 2009826 28. OKdef some_lter @my_record =MyModel.nd(params[:id]) @my_record.operator = current_userend2009826 29. :fordef some_lter @my_record =MyModel.nd(params[:id], :for => current_user)end2009826 30. record_with_operator2009826 31. 2009826 32. 1.named_scope2009826 33. # @company operator # # notes = @company.notes.authorized2009826 34. 2009826 35. 2. 2009826 36. 2009826 37. @company.save # operator # # 2009826 38. 2009826 39. 3. 2009826 40. operator 2009826 41. def some_admin_ltercurrent_user.as_admin= true end2009826 42. if operator.as_admin? ... end2009826 43. EC 2009826 44. recode_with_operator http://github.com/nay/record_with_operator/tree2009826