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

Documentation of model vs. instance methods. #687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcfergus
Copy link

Adding clarification in Guide between Model and Instance methods, to save future explorers some digging.

Type of PR:

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Documentation
  • Other, please describe:

Breaking changes:

  • No
  • Yes

Details

Adding a bit of documentation on model methods vs instance methods, since it took me a little digging to find out the difference.

@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #687 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #687   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         1554      1554           
  Branches       260       260           
=========================================
  Hits          1554      1554           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c771f9b...0f6b911. Read the comment docs.

@cuebit cuebit added the documentation The issue is about documentation label May 10, 2021
Copy link
Member

@cuebit cuebit left a comment

Choose a reason for hiding this comment

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

Thanks for this. Could review the comment? We can then merge this PR. 🙏

You may insert new data or update existing data through various Model methods. All data created through Vuex ORM gets persisted to Vuex Store.
You may insert new data or update existing data through various Model methods. All data created through Vuex ORM gets persisted to Vuex Store.

Model methods are defined as both class methods (`Model.update`) and as instance methods (`modelInstance.$update`). These methods have identical behavior except for utilizing a different source for the object ID (passed parameter vs. object instance).
Copy link
Member

Choose a reason for hiding this comment

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

This should read "defined as both static methods..." since "class methods" could be recognised as static or instance (more often the latter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is about documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants