Rails 3 support: active_model integration #3

Open
wants to merge 10 commits into
from

Conversation

Projects
None yet
4 participants
@galetahub

No description provided.

@skiz

This comment has been minimized.

Show comment
Hide comment
@skiz

skiz Nov 8, 2011

👍 This didn't exist when I backported the support.

👍 This didn't exist when I backported the support.

@skiz

This comment has been minimized.

Show comment
Hide comment
@skiz

skiz Nov 9, 2011

Collaborator

There is already a (working) rails3 branch at https://github.com/jamesgolick/active_presenter/tree/rails3 However it looks like there are some good changes here. Would it be possible to apply your requested changes against that?

Collaborator

skiz commented Nov 9, 2011

There is already a (working) rails3 branch at https://github.com/jamesgolick/active_presenter/tree/rails3 However it looks like there are some good changes here. Would it be possible to apply your requested changes against that?

@@ -1,22 +0,0 @@

This comment has been minimized.

@skiz

skiz Nov 9, 2011

Collaborator

Removing licenses is a no-no.

@skiz

skiz Nov 9, 2011

Collaborator

Removing licenses is a no-no.

- saved = presented.keys.select {|key| save?(key, send(key))}.all? {|key| send(key).save}
- raise ActiveRecord::Rollback unless saved # TODO: Does this happen implicitly?
+ if !perform_validations?(options) || (perform_validations?(options) && valid?)
+ _run_save_callbacks do

This comment has been minimized.

@skiz

skiz Nov 9, 2011

Collaborator

I am running in to a particular issue here where the after_save is being called within the transaction, so it will not be available for reading from other processes. Is there a way we can only call before_save within the transaction, then after_save outside the transaction?

@skiz

skiz Nov 9, 2011

Collaborator

I am running in to a particular issue here where the after_save is being called within the transaction, so it will not be available for reading from other processes. Is there a way we can only call before_save within the transaction, then after_save outside the transaction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment