Module: PopulateMe::API::Helpers
- Includes:
- WebUtils
- Defined in:
- lib/populate_me/api.rb
Instance Method Summary collapse
Instance Method Details
#resolve_model_class(name) ⇒ Object
107 108 109 110 111 |
# File 'lib/populate_me/api.rb', line 107 def resolve_model_class name model_class = resolve_dasherized_class_name(name) rescue nil halt(404) unless model_class.respond_to?(:admin_get) model_class end |
#resolve_model_instance(model_class, id) ⇒ Object
113 114 115 116 117 |
# File 'lib/populate_me/api.rb', line 113 def resolve_model_instance model_class, id instance = model_class.admin_get id halt(404) if instance.nil? instance end |