Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Handle mapping transformations in one place - #87

Merged
supermarin merged 1 commit into
masterfrom
mappings-filter
Mar 27, 2014
Merged

supermarin merged 1 commit into
masterfrom
mappings-filter

Conversation

@stephencelis

Copy link
Copy Markdown
Collaborator

This pushes most of the transformation logic back into the Mappings category, and centralizes where properties are filtered in the ActiveRecord category.

Because of this, we can ensure that:

  • transformations happen before KVC methods like willChangeValueForKey: and didChangeValueForKey: are called, and
  • invalid keys are dropped before building a predicate for fetching via findOrCreate:.

@stephencelis

Copy link
Copy Markdown
Collaborator Author

This relates to #86.

@supermarin Thoughts?

@stephencelis

Copy link
Copy Markdown
Collaborator Author

@kattrali Looking over older tickets and realizing that this might provide the same fix as #62?

This pushes most of the transformation logic back into the Mappings
category, and centralizes where properties are filtered in the
ActiveRecord category.

Because of this, we can ensure that:

 - transformations happen before KVC methods like willChangeValueForKey:
   and didChangeValueForKey: are called, and

 - invalid keys are dropped before building a predicate for fetching via
   findOrCreate:.

Reported-by: amseddi
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
@supermarin

Copy link
Copy Markdown
Owner

Looks good, thanks everyone!

supermarin added a commit that referenced this pull request Mar 27, 2014
Handle mapping transformations in one place
@supermarin
supermarin merged commit aca2cbc into master Mar 27, 2014
@stephencelis
stephencelis deleted the mappings-filter branch March 27, 2014 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants