Skip to content
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

change autosave_association.rb so that association autosave can work #344

Merged
merged 1 commit into from Mar 20, 2016

Conversation

ypxing
Copy link

@ypxing ypxing commented Mar 14, 2016

Without patching autosave_association.rb, below case will fail with error
TypeError: [:dorm_id, :room_id] is not a symbol nor a string

    room = Room.new(dorm_id: 1000, room_id: 1001)
    room_assignment = RoomAssignment.new(student_id: 1000)
    room_assignment.room = room
    room_assignment.save

The change is to fix the issue by using record.read_attribute instead of record.send in autosave_association.rb.

cfis added a commit that referenced this pull request Mar 20, 2016
change autosave_association.rb so that association autosave can work
@cfis cfis merged commit 76fb5f2 into composite-primary-keys:ar_4.2.x Mar 20, 2016
@cfis
Copy link
Contributor

cfis commented Mar 20, 2016

Thanks!

cfinucane added a commit to cfinucane/composite_primary_keys that referenced this pull request Jan 11, 2017
cfis added a commit that referenced this pull request Jan 14, 2017
extend approach from #344 to fix autosave for has_one associations as well
kenchan pushed a commit to kenchan/composite_primary_keys that referenced this pull request Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants