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

use self instead of #read_attribute #16704

Merged
merged 1 commit into from
Sep 1, 2014

Conversation

ankit1910
Copy link

No description provided.

@rafaelfranca
Copy link
Member

Thank you but the behaviour is different. Also this method is not defined on this module neither in their dependencies.

@rafaelfranca
Copy link
Member

By different I mean. [] has a cache and we don't want to hit this cache here.

@rafaelfranca rafaelfranca reopened this Aug 26, 2014
@rafaelfranca
Copy link
Member

In fact I'll wait travis to run and check locally before merge. Thanks.

rafaelfranca added a commit that referenced this pull request Sep 1, 2014
use self instead of #read_attribute
@rafaelfranca rafaelfranca merged commit fcbdac7 into rails:master Sep 1, 2014
@ankit1910 ankit1910 deleted the use-existing-method branch October 11, 2015 07:50
@kirs
Copy link
Member

kirs commented Mar 8, 2016

I found that [] doesn't work with ActiveRecord::Store.

class User < ActiveRecord::Base
  store :settings
  store_accessor :settings, :privileges, :servants
end

User.new.servants?
=> NoMethodError

@rafaelfranca do you think that we can switch from [] to public_send(attr_name) here?

@rafaelfranca
Copy link
Member

@kirs 👍

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

3 participants