Sha256: 5c184afa203756bc56b8d186010d128938812ff5a346aa5578d08fa7c133670c
Contents?: true
Size: 623 Bytes
Versions: 3
Compression:
Stored size: 623 Bytes
Contents
require 'action_dispatch' module DestroyedAt::Mapper module Routes def set_member_mappings_for_resource member do put :restore if parent_resource.actions.include?(:restore) end super end end module Resource def default_actions actions = super if self.name.camelcase.singularize.constantize.included_modules.include?(DestroyedAt) actions << :restore end actions end end end ActionDispatch::Routing::Mapper.send(:prepend, DestroyedAt::Mapper::Routes) ActionDispatch::Routing::Mapper::Resource.send(:prepend, DestroyedAt::Mapper::Resource)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
destroyed_at-0.4.0 | lib/destroyed_at/routes.rb |
destroyed_at-0.3.1 | lib/destroyed_at/routes.rb |
destroyed_at-0.3.0 | lib/destroyed_at/routes.rb |