Fox.AtomExt
SourceSummary
infer_collection_key(module) | Takes a controller module and attempts to infer the underscored atom key of its model’s collection. Throws error if not given a controller or the model doesn’t exist |
infer_model_key(module) | Takes a controller module and attempts to infer the underscored atom key of its model. Will throw error if not given a controller or the model doesn’t exist |
infer_model_module(module) | Takes a controller module and attempts to infer its model module name. Will error if not given a controller module or the model doesn’t exist |
Functions
Takes a controller module and attempts to infer the underscored atom key of its model’s collection. Throws error if not given a controller or the model doesn’t exist.
Examples
MyApp.PictureController |> infer_model_key # :pictures
MyApp.DonkeyPunchController |> infer_model_key # :donkey_punches
Takes a controller module and attempts to infer the underscored atom key of its model. Will throw error if not given a controller or the model doesn’t exist
Examples
MyApp.PictureController |> infer_model_key # :picture
MyApp.DonkeyPunchController |> infer_model_key # :donkey_punch
Takes a controller module and attempts to infer its model module name. Will error if not given a controller module or the model doesn’t exist.
Examples
MyApp.PictureController |> infer_model_module # MyApp.Picture