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

Clear aggregation cache after setter method calls. #6498

Closed
wants to merge 1 commit into from

Conversation

edtsech
Copy link
Contributor

@edtsech edtsech commented May 26, 2012

Solve this issue:

customer.address.street # => "Quiet Road"
customer.address_street = "Noisy Road"
customer.address.street # => "Quiet Road"

Where:

class Customer
  composed_of :address, :mapping => [ %w(address_street street), %w(address_city city) ]
end


class Address
  attr_reader :street, :city, :country

  def initialize(street, city, country)
    @street, @city, @country = street, city, country
  end
end

Solve this issue:
customer.address.street # => "Quiet Road"
customer.address_street = "Noisy Road"
customer.address.street # => "Quiet Road"
@@ -223,6 +223,22 @@ def composed_of(part_id, options = {})
reader_method(name, class_name, mapping, allow_nil, constructor)
writer_method(name, class_name, mapping, allow_nil, converter)

self.class_eval { define_attribute_methods }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, can we force to define attribute methods here? @josevalim

@rafaelfranca
Copy link
Member

Closed by #6743

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

Successfully merging this pull request may close these issues.

None yet

2 participants