Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Adds #key and #to_param to the AMo interface | snusnu | 2010-02-19 | 1 | -1/+20 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces two new methods that every AMo compliant object must implement. Below are the default implementations along with the implied interface contract. # Returns an Enumerable of all (primary) key # attributes or nil if new_record? is true def key new_record? ? nil : [1] end # Returns a string representing the object's key # suitable for use in URLs, or nil if new_record? # is true def to_param key ? key.first.to_s : nil end 1) The #key method Previously rails' record_identifier code, which is used in the #dom_id helper, relied on calling #id on the record to provide a reasonable DOM id. Now with rails3 being all ORM agnostic, it's not safe anymore to assume that every record ever will have an #id as its primary key attribute. Having a #key method available on every AMo object means that #dom_id can be implemented using record.to_model.key # instead of record.id Using this we're able to take composite primary keys into account (e.g. available in datamapper) by implementing #dom_id using a newly added record_key_for_dom_id(record) method. The user can overwrite this method to provide customized versions of the object's key used in #dom_id. Also, dealing with more complex keys that can contain arbitrary strings, means that we need to make sure that we only provide DOM ids that are valid according to the spec. For this reason, this patch sends the key provided through a newly added sanitize_dom_id(candidate_id) method, that makes sure we only produce valid HTML The reason to not just add #dom_id to the AMo interface was that it feels like providing a DOM id should not be a model concern. Adding #dom_id to the AMo interface would force these concern on the model, while it's better left to be implemented in a helper. Now one could say the same is true for #to_param, and actually I think that it doesn't really fit into the model either, but it's used in AR and it's a main part of integrating into the rails router. This is different from #dom_id which is only used in view helpers and can be implemented on top of a semantically more meaningful method like #key. 2) The #to_param method Since the rails router relies on #to_param to be present, AR::Base implements it and returns the id by default, allowing the user to overwrite the method if desired. Now with different ORMs integrating into rails, every ORM railtie needs to implement it's own #to_param implementation while already providing code to be AMo compliant. Since the whole point of AMo compliance seems to be to integrate any ORM seamlessly into rails, it seems fair that all we really need to do as another ORM, is to be AMo compliant. By including #to_param into the official interface, we can make sure that this code can be centralized in the various AMo compliance layers, and not be added separately by every ORM railtie. 3) All specs pass | |||||
* | Update Renderer | Yehuda Katz | 2010-02-18 | 1 | -5/+4 | |
| | ||||||
* | Merge master. | José Valim | 2010-02-17 | 4 | -9/+15 | |
|\ | ||||||
| * | Update AP to start locking down a public API. This work is parallel to some ↵ | Yehuda Katz | 2010-02-16 | 4 | -9/+15 | |
| | | | | | | | | docs I'm working on. | |||||
* | | Ensure render :text => resource first tries to invoke :to_text on it | José Valim | 2010-02-16 | 1 | -0/+7 | |
| | | ||||||
* | | Rename Rails::Subscriber to Rails::LogSubscriber | Prem Sichanugrist | 2010-02-16 | 2 | -3/+3 | |
|/ | ||||||
* | Its not a deprecation if you actually just ignore the call | David Heinemeier Hansson | 2010-02-09 | 1 | -0/+2 | |
| | ||||||
* | Lookup the status code and rework the Completed line a bit | David Heinemeier Hansson | 2010-02-05 | 1 | -2/+1 | |
| | ||||||
* | Make UrlWriter includable in a Module | Jeremy Kemper | 2010-02-05 | 1 | -1/+9 | |
| | ||||||
* | Rationalize railtie dependencies: AC uses AV; AR uses AMo; and Rails always ↵ | Jeremy Kemper | 2010-02-04 | 1 | -0/+1 | |
| | | | | uses AS. | |||||
* | Add method and path to AC notifications. | José Valim | 2010-02-03 | 1 | -1/+3 | |
| | ||||||
* | Merge branch 'master' of gitproxy:rails/rails | José Valim | 2010-02-01 | 7 | -23/+43 | |
|\ | ||||||
| * | Convert to class_attribute | Jeremy Kemper | 2010-02-01 | 7 | -23/+43 | |
| | | ||||||
* | | Deprecate AC configuration values which were moved to Rack. | José Valim | 2010-02-01 | 1 | -6/+22 | |
|/ | ||||||
* | deOMGifying Railties, Active Support, and Action Pack | Mikel Lindsaar | 2010-01-31 | 1 | -1/+1 | |
| | ||||||
* | Bring helpers_dir deprecation back. | José Valim | 2010-01-30 | 1 | -0/+2 | |
| | ||||||
* | Fix some backward incompatible behavior on AM. | José Valim | 2010-01-30 | 2 | -28/+2 | |
| | ||||||
* | Fix rendering of layouts. | José Valim | 2010-01-29 | 1 | -5/+0 | |
| | ||||||
* | ActionMailer should depend just on AbstractController. | José Valim | 2010-01-29 | 3 | -5/+154 | |
| | ||||||
* | AC railtie should configure helpers path. | José Valim | 2010-01-26 | 2 | -3/+6 | |
| | ||||||
* | Keep ActionController::Base.helpers_dir around for a bit longer | Joshua Peek | 2010-01-26 | 1 | -37/+33 | |
| | ||||||
* | Merge remote branch 'mikel/master' | José Valim | 2010-01-26 | 2 | -26/+7 | |
|\ | ||||||
| * | Merge branch 'master' of git://github.com/rails/rails | José Valim and Mikel Lindsaar | 2010-01-25 | 3 | -25/+13 | |
| |\ | | | | | | | | | | | | | | | | Conflicts: actionmailer/lib/action_mailer/mail_helper.rb railties/lib/rails/configuration.rb | |||||
| * | | Move double render check out of AbstractController. | José Valim and Mikel Lindsaar | 2010-01-23 | 1 | -0/+4 | |
| | | | ||||||
| * | | Added AbstractController::Collector. | José Valim and Mikel Lindsaar | 2010-01-23 | 1 | -26/+3 | |
| | | | ||||||
* | | | Add a deprecation for helpers_dir. | José Valim | 2010-01-25 | 1 | -0/+12 | |
| | | | ||||||
* | | | Add active_model/railtie back to generated boot.rb, add models back to ↵ | José Valim | 2010-01-25 | 2 | -5/+5 | |
| |/ |/| | | | | | paths, load active_support/railtie since we need it and ensure default logger is set before config. | |||||
* | | Fix failing tests after merge. | José Valim | 2010-01-24 | 1 | -0/+1 | |
| | | ||||||
* | | Rename plugin_name to railtie_name and engine_name. | José Valim | 2010-01-24 | 1 | -1/+1 | |
| | | ||||||
* | | Ensure helpers work from configured path. | José Valim | 2010-01-24 | 2 | -9/+11 | |
| | | ||||||
* | | Merge branch 'master' into app | José Valim | 2010-01-23 | 2 | -35/+24 | |
|\| | | | | | | | | | Conflicts: railties/lib/rails/application.rb | |||||
| * | Ensure strings given to render with slash are rendered relative to the ↵ | José Valim | 2010-01-22 | 2 | -35/+24 | |
| | | | | | | | | configured _prefix. | |||||
* | | Get rid of initializers global and create i18n railtie. | José Valim | 2010-01-23 | 1 | -0/+2 | |
| | | ||||||
* | | Moved more configuration away from bootstrap. | José Valim | 2010-01-22 | 1 | -10/+0 | |
| | | ||||||
* | | Add view paths to Engine setup. | José Valim | 2010-01-22 | 1 | -2/+1 | |
| | | ||||||
* | | Massive cleanup in Railties and load stack. | José Valim | 2010-01-21 | 1 | -6/+0 | |
|/ | ||||||
* | Make filter parameters based on request, so they can be modified for ↵ | José Valim | 2010-01-21 | 2 | -2/+10 | |
| | | | | anything in the middleware stack. | |||||
* | Tidy up new filter_parameters implementation. | José Valim | 2010-01-21 | 3 | -15/+5 | |
| | ||||||
* | Add deprecation warning for calling filter_parameter_logging ↵ | Prem Sichanugrist | 2010-01-21 | 1 | -27/+2 | |
| | | | | | | ActionController::Base, and allow it to be configured in config.filter_parameters Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Move filter_parameter_logging logic out of the controller and create ↵ | Prem Sichanugrist | 2010-01-21 | 2 | -33/+5 | |
| | | | | | | ActionDispatch::ParametersFilter to handle parameter filteration instead. This will make filteration not depending on controller anymore. Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Expose last controller in rack env["action_controller.instance"] | Joshua Peek | 2010-01-20 | 1 | -0/+1 | |
| | ||||||
* | Move ActionController::Translation to AbstractController::Translation. | José Valim | 2010-01-20 | 2 | -14/+1 | |
| | ||||||
* | Bring normalize behavior to AbstractController::Rendering | José Valim | 2010-01-20 | 3 | -35/+17 | |
| | ||||||
* | Stop overriding LoadError.new to return a MissingSourceError (and sometimes ↵ | Yehuda Katz | 2010-01-19 | 1 | -1/+1 | |
| | | | | nil!) | |||||
* | Move parameters to the top on logging. | José Valim | 2010-01-19 | 4 | -15/+20 | |
| | ||||||
* | Cleanup deprecation notices. | Joshua Peek | 2010-01-18 | 1 | -1/+1 | |
| | ||||||
* | Add ActionDispatch::Railties::Subscriber and finish tidying up the logging. | José Valim | 2010-01-17 | 3 | -58/+1 | |
| | ||||||
* | Get rid of prepare_each_request, since now it's a middleware initialization ↵ | José Valim | 2010-01-17 | 2 | -4/+0 | |
| | | | | parameter. | |||||
* | Cookies middleware | Joshua Peek | 2010-01-16 | 2 | -183/+6 | |
| | ||||||
* | Build middleware stack and reload routes after app initializers run | Joshua Peek | 2010-01-16 | 1 | -1/+0 | |
| | | | | [#3709 state:resolved] |