Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@maletor
Created June 3, 2016 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maletor/ef903a286877846a2ab78f78ad4fc175 to your computer and use it in GitHub Desktop.
Save maletor/ef903a286877846a2ab78f78ad4fc175 to your computer and use it in GitHub Desktop.
def user_includes
params[:include].split(',').reduce([]) do |array, relation|
array = array | [relation.split('.').reverse.reduce { |a, n| { n => a } }]
array & allowed_includes
end
end
def allowed_includes
["specialty"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment