-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Models #18
base: master
Are you sure you want to change the base?
Models #18
Conversation
TODO: update readme. |
def initialize(attributes = {}) | ||
attributes = attributes.symbolize_keys | ||
self.id = attributes.delete(:id) | ||
self.attributes = ((column_defaults || {}).merge(attributes)).symbolize_keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to symbolize_keys
on column_defaults
?
Looks good I like it :) |
module Waistband | ||
class Model | ||
|
||
extend ::ActiveModel::Callbacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be able to just use ActiveModel::Model but it's been a while since I've used it.
Philosophy Ramblings: This is awesome. However, if you you able to save a new model and re-load it quickly, we know that it's very likely that ES will not yet have indexed the new object, and things like Since you are working with only one record here (as opposed to multi writes which you might use some of the other waistband sections for), you have the opportunity to enforce that when you call
Eh, these are all probably terrible ideas... never mind! |
Well, reload! would work using the find method, which is not a search, so On Sun, Feb 22, 2015 at 11:42 AM, Evan Tahler [email protected]
Pablo Jairala |* TaskRabbit *| Staff Engineer |
Huh, I thought you always needed to wait for the refresh (even when loading by document ID).... Fancy! |
No description provided.