lib/plain_model/querying/except.rb in plain_model-0.1.0 vs lib/plain_model/querying/except.rb in plain_model-0.2.0
- old
+ new
@@ -9,16 +9,19 @@
# Chain method
# @param keys [Array<Symbol>] values keys that you want to exclude from query
# @return new instance with applied changes
def except(*keys)
- _within_new_instance do
- self.values = values.except(*keys)
- end
+ dup.except!(*keys)
end
- included do
- self.chainable_methods += [:except]
+ # Chain method
+ # @param keys [Array<Symbol>] values keys that you want to exclude from query
+ # @return new instance with applied changes
+ def except!(*keys)
+ self.values = values.except(*keys)
+ self
end
+
end
end
end