You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
account = Weeblycloud::Account.new
user = account.create_user("[email protected]")
site = user.create_site("domain.com", "site_title" => "My Website")
puts site.login_link()
4 http requests are made (one for each line), even though only 3 are necessary. (There is no need to fetch the account object). I just submitted a PR which allows data to be passed into the account so at least you can do:
account = Weeblycloud::Account.new({})
but this is not ideal.
The same is true of other objects. For example (assuming a already know the user and site id) I shouldn't have to fetch the site object to retrieve the login_link
The text was updated successfully, but these errors were encountered:
While unideal, you can use the same workaround for passing {} into the Site class when constructing it. I'm not sure there's a nice compromise between fetching Site-object data and fetching other endpoint data for the Site APIs.
To me an ideal solution would be to make the initializer more specific: Account.new(load:true), Account.new(load:false) or Account.new(data: {....}) with the first being the default.
A simpler alternative would be to allow an initializer of the form Account.new(false) which would be a small modification to CloudResource#initialize
In the code example:
4 http requests are made (one for each line), even though only 3 are necessary. (There is no need to fetch the account object). I just submitted a PR which allows data to be passed into the account so at least you can do:
but this is not ideal.
The same is true of other objects. For example (assuming a already know the user and site id) I shouldn't have to fetch the site object to retrieve the
login_link
The text was updated successfully, but these errors were encountered: