yshmarov / insta2blog.com

Automagically post your Instagram photos to a perfect SEO blog. Turn your Instagram account into a website.
https://insta2blog.com/
MIT License
14 stars 2 forks source link

is this necessary? #81

Closed sljmn closed 2 years ago

sljmn commented 2 years ago
def call
    insta_user_data = ask_user_profile
    insta_user = InstaUser.find_or_initialize_by(username: insta_user_data['username'])
    insta_user.update(
      remote_id: insta_user_data['id'],
      account_type: insta_user_data['account_type'].downcase,
      media_count: insta_user_data['media_count']
    )
    insta_user
  end

is the insta_user necessary? Wouldnt insta_user.update already return what you want?

btw love to follow this project, very cool see you hacking on it! learning a lot!

yshmarov commented 2 years ago

Thanks for your comment!

However the update is returning true here, so that's why I have to explicitly get the insta_user once more:

Screenshot 2022-11-10 at 23 27 38

At moments like this I'm happy to have invested the time into adding some tests 😝

sljmn commented 2 years ago

hehe very nice!