[openstreetmap/openstreetmap-website] Add allow_read_email oauth permission (#1431)

Tom Hughes notifications at github.com
Thu Feb 9 11:55:59 UTC 2017


tomhughes commented on this pull request.



> @@ -381,7 +381,8 @@ def api_read
 
   def api_details
     @this_user = @user
-    render :action => :api_read, :content_type => "text/xml"
+    allow_read_email = !current_token.nil? && current_token.read_attribute(:allow_read_email)

Isn't that equivalent to the (simpier) form `current_token && current_token.read_attribute(:allow_read_email)`?

> @@ -0,0 +1,11 @@
+class AddReadEmailPermission < ActiveRecord::Migration
+  def up

If you make that `def change` then you won't need the `down` routine at all.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1431#pullrequestreview-20990871
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170209/d6e64f49/attachment.html>


More information about the rails-dev mailing list