-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add new option to save embedded relations changes in parent #150
Add new option to save embedded relations changes in parent #150
Conversation
1e5eeef
to
f81ce5f
Compare
Build failing with following error:
|
This is great, but I think embedded objects are no different from other fields in some way, so I think the DSL should just be |
@dblock |
@dblock Now if a model has |
If not, will the user have to specify all fields and embedded associations here? |
Also, if we track all fields and embedded relations in |
I think we shouldn't touch |
We can't touch |
First, thanks for hanging on here. What I don't like about a DSL that you propose is that it's not naming "things", but "kinds of things". We can't touch |
We should alias |
Ok. For now, i will make it |
@dblock the term |
Thanks @jagdeepsingh, let us know when it's updated. |
embeds_many :comments | ||
|
||
track_history :on => [:title, :body], | ||
:embeds_many => [:comments], # track comments as embedded attributes, default is [] |
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.
This is still wrong.
LMK when this is ready to re-review, see comment above, update CHANGELOG, fix the build, etc. |
- Change rbx version
a332122
to
774dd0d
Compare
This is still a WIP. I will let you know when to re-review it. |
- Fix polymorphic tracking and dynamic fields tracking, Fix rspecs
52da937
to
511542d
Compare
- jruby-19mode | ||
|
||
allow_failures: | ||
- rvm: rbx-2 |
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.
You do need to re-add rbx-2
above though ;)
Thanks. I made a comment on class naming, I think we should rename it. There's still an entry in CHANGELOG needed. |
…d entry in CHANGELOG
@dblock Please check now. |
@dblock This is ready to be reviewed now. |
Excellent work, thank you. |
This add a new option
embeds_many
to thehistory_trackable_options
to save history of embedded objects in parent record itself.e.g. if there are
User
andArticle
models as following:This will save the
article.attributes
in addition to user's trackable fields touser
's history record whenever an user/article is created/updated/destroyed.