Skip to content

Attributes of entities do not update until refetch/reinitialize of the whole object #1

Description

@Flauschbaellchen

If you change one or more attributes of an entity, e.g. a channel, it won't be synced with the object itself.
Example:

@session.chanserv.info("#opers") do |channel|
  channel.url                     #=> nil
  channel.url!("www.example.com") #=> Sets an url for the channel
  channel.url                     #=> nil
end

# or

channel = @session.chanserv.info("#opers")
channel.url                     #=> nil
channel.url!("www.example.com")
channel.url                     #=> nil

# but (as the object is fetched and initialized again):

@session.chanserv.info("#opers").url #=> nil
@session.chanserv.info("#opers").url!("www.example.com")
@session.chanserv.info("#opers").url #=> www.example.com

Sure, there are some workarounds which would fix this..
But they would mess up the code.
I'll leave it as it is until I have a really good idea or decide to put up one of the workarounds. (Ideas welcome!)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions