Module: Voltron::Encryptable::ClassMethods
- Defined in:
- lib/voltron/encryptable.rb
Instance Method Summary collapse
- #delete(id) ⇒ Object
- #destroy(id) ⇒ Object
- #exists?(conditions = :none) ⇒ Boolean
- #find(*args) ⇒ Object
Instance Method Details
#delete(id) ⇒ Object
41 42 43 |
# File 'lib/voltron/encryptable.rb', line 41 def delete(id) super(decoded_ids(id)) end |
#destroy(id) ⇒ Object
37 38 39 |
# File 'lib/voltron/encryptable.rb', line 37 def destroy(id) super(decoded_ids(id)) end |
#exists?(conditions = :none) ⇒ Boolean
27 28 29 30 31 32 33 34 35 |
# File 'lib/voltron/encryptable.rb', line 27 def exists?(conditions = :none) if conditions.is_a?(String) # If conditions is a string, assume it's an encoded id super(decoded_ids(conditions)) else # Otherwise do what exists? normally does super(conditions) end end |
#find(*args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/voltron/encryptable.rb', line 16 def find(*args) scope = args.slice!(0) = args.slice!(0) || {} if ![:bypass] && ![:first, :last, :all].include?(scope.try(:to_sym)) scope = decoded_ids(scope) end super(scope) end |