Module: Resourcelogic::Aliases::Config
- Defined in:
- lib/resourcelogic/aliases.rb
Instance Method Summary collapse
-
#path_alias(alias_name, model_name) ⇒ Object
This really isn’t needed thanks to the new parent_from_params? method.
- #path_aliases ⇒ Object
- #route_alias(alias_name, model_name) ⇒ Object
- #route_aliases ⇒ Object
Instance Method Details
#path_alias(alias_name, model_name) ⇒ Object
This really isn’t needed thanks to the new parent_from_params? method. TODO: review this and remove it if neccessary.
56 57 58 59 60 61 62 |
# File 'lib/resourcelogic/aliases.rb', line 56 def path_alias(alias_name, model_name) current_aliases = path_aliases model_name = model_name.to_sym current_aliases[model_name] ||= [] current_aliases[model_name] << alias_name.to_sym write_inheritable_attribute(:path_aliases, current_aliases) end |
#path_aliases ⇒ Object
64 65 66 |
# File 'lib/resourcelogic/aliases.rb', line 64 def path_aliases read_inheritable_attribute(:path_aliases) || {} end |
#route_alias(alias_name, model_name) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/resourcelogic/aliases.rb', line 68 def route_alias(alias_name, model_name) current_aliases = route_aliases model_name = model_name.to_sym current_aliases[model_name] ||= [] current_aliases[model_name] << alias_name.to_sym write_inheritable_attribute(:route_aliases, current_aliases) end |
#route_aliases ⇒ Object
76 77 78 |
# File 'lib/resourcelogic/aliases.rb', line 76 def route_aliases read_inheritable_attribute(:route_aliases) || {} end |