Sha256: 4f33fc4302f41f4d732e7ae0a81ac1bc1504495e730400505e01d604d77e8bf8

Contents?: true

Size: 503 Bytes

Versions: 10

Compression:

Stored size: 503 Bytes

Contents

module AssetManager
  module TouchTranslation
    def self.included(base)
      base.class_eval do
        method_name = 'touch_after_save_or_destroy_for_globalized_model'
        self::Translation.class_eval do
          redefine_method(method_name) do
            record = send(:globalized_model)
            record.touch unless record.nil?
          end
          after_save(method_name)
          after_touch(method_name)
          after_destroy(method_name)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
intesys_asset_manager-1.2.4 lib/asset_manager/touch_translation.rb
intesys_asset_manager-1.2.3 lib/asset_manager/touch_translation.rb
intesys_asset_manager-1.2.2 lib/asset_manager/touch_translation.rb
intesys_asset_manager-1.2.1 lib/asset_manager/touch_translation.rb
intesys_asset_manager-1.2.0 lib/asset_manager/touch_translation.rb
intesys_asset_manager-1.1.3 lib/touch_translation.rb
intesys_asset_manager-1.1.2 lib/touch_translation.rb
intesys_asset_manager-1.1.1 lib/touch_translation.rb
intesys_asset_manager-1.1.0 lib/touch_translation.rb
intesys_asset_manager-1.0.0 lib/touch_translation.rb