Sha256: 1e992973d300377e1a7f920a25ee23f915cecf5220cb14e0fc4abf54ad17564d

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

module Devise 
  module Models
    module Imprintable
      def update_imprintable_fields!(request)
        self.first_sign_in_at = self.first_sign_in_at || Time.now
        self.first_sign_in_ip = self.first_sign_in_ip || request.remote_ip
        save(:validate => false) or raise "Devise imprintable could not save #{inspect}." \
          "Please make sure a model using imprintable can be saved at sign in."
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise_imprintable-0.0.3 lib/devise_imprintable/model.rb
devise_imprintable-0.0.2 lib/devise_imprintable/model.rb