Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added option to create readonly attributes #2484

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Member

plribeiro3000 commented Dec 17, 2013

Added option to Create readonly attributes.

Coverage Status

Coverage increased (+2.15%) when pulling 60aa7d4 on zertico:read_only_attributes into 4c9bcab on fog:master.

Owner

geemus commented Dec 17, 2013

Hmm. I think this might be problematic actually. merge_attributes (which is used in Model#new) relies on this usage to do typecasting, see: https://github.com/zertico/fog/blob/60aa7d402333d4f732339274725cb238332307a9/lib/fog/core/attributes.rb#L142

Related to that, I think read-only should probably be an additional option (instead of a type). We probably want to keep the types separate as it allows values returned from the service to be typecast.

Maybe the better/easier solution for now would be to raise errors in xenserver when you call save/create if you have read-only parameters set (instead of doing it at param setter time). What do you think?

Member

plribeiro3000 commented Dec 17, 2013

Hmmm, i see your point. Maybe if i insert the attribute on the ignore_attributes collection?

Owner

geemus commented Dec 17, 2013

@plribeiro3000 - sounds like it would be worth a try (I worry we might see other issues, but not sure we can know without trying it with some tests).

Member

plribeiro3000 commented Dec 17, 2013

I will try it later and send it with tests. =D

Member

plribeiro3000 commented Jun 10, 2014

I will close this since it is outdated and doesn't provide a good solution for read only attributes without break others providers.

@plribeiro3000 plribeiro3000 deleted the unknown repository branch Jun 10, 2014

Owner

geemus commented Jun 10, 2014

Thanks for the update.

On Mon, Jun 9, 2014 at 11:25 PM, Paulo Henrique Lopes Ribeiro <
notifications@github.com> wrote:

Closed #2484 #2484.

Reply to this email directly or view it on GitHub
#2484 (comment).

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