lib/yext/api/utils/api_base.rb in yext-api-0.1.1 vs lib/yext/api/utils/api_base.rb in yext-api-0.1.3
- old
+ new
@@ -5,9 +5,17 @@
module Utils
# The base class for the Yext API components.
class ApiBase < Spyke::Base
include Yext::Api::Concerns::FaradayConnection
include Yext::Api::Concerns::DefaultScopes
+
+ before_save :ensure_create_id
+
+ private
+
+ def ensure_create_id
+ attributes[:create_id] ||= attributes[:id]
+ end
end
end
end
end