Comments (6)
The values for order should be the same as the attribute names in the actual API at the moment unfortunately.
So what you're probably looking for is:
xero_connection.Account.all(order: "Name")
from xeroizer.
I had tried that but it doesn't work:
account.xero_connection.Account.all(order: "Name").map(&:name)
=> ["Business Bank Account",
"Business Savings Account",
"Sales",
"Other Revenue",
"Interest Income",
"Purchases",
"Advertising",
"Bank Fees",
"Cleaning",
"Consulting & Accounting",
"Depreciation",
I could only make it work when I changed the gem to use order
instead of orderBy
.
from xeroizer.
I'm not sure what the issue is at your end. The Gem doesn't make use of orderBy
. The code for the ordering is in lib/xeroizer/record/base_model_http_proxy.rb
My version of the test code returns accounts in the correct order:
Xero = Xeroizer::PrivateApplication.new(ACCESS_KEY, ACCESS_SECRET, XERO_PRIVATE_KEY)
accounts = Xero.Account.all(order: "Name")
ap accounts.map(&:name)
Returns:
[
[ 0] "Accounts Payable",
[ 1] "Accounts Receivable",
[ 2] "Accrued Liabilities",
[ 3] "Advertising",
[ 4] "Bank Fees",
[ 5] "Bank Revaluations",
[ 6] "Business Bank Account",
[ 7] "Business Savings Account",
[ 8] "Cleaning",
[ 9] "Clearing Account",
[10] "Commission",
[11] "Computer Equipment",
[12] "Consulting & Accounting",
[13] "Depreciation",
[14] "Entertainment",
[15] "Freight & Courier",
[16] "General Expenses",
[17] "GST",
[18] "Historical Adjustment",
[19] "Income Tax Expense",
[20] "Income Tax Payable",
[21] "Insurance",
[22] "Interest Expense",
[23] "Interest Income",
[24] "Legal expenses",
[25] "Less Accumulated Depreciation on Computer Equipment",
[26] "Less Accumulated Depreciation on Office Equipment",
[27] "Light, Power, Heating",
[28] "Loan",
[29] "Motor Vehicle Expenses",
[30] "Office Equipment",
[31] "Office Expenses",
[32] "Other Revenue",
[33] "Owner A Drawings",
[34] "Owner A Funds Introduced",
[35] "Owner A Share Capital",
[36] "PAYG Withholdings Payable",
[37] "Prepayments",
[38] "Printing & Stationery",
[39] "Purchases",
[40] "Realised Currency Gains",
[41] "Rent",
[42] "Repairs and Maintenance",
[43] "Retained Earnings",
[44] "Revenue Received in Advance",
[45] "Rounding",
[46] "Sales",
[47] "Subscriptions",
[48] "Superannuation",
[49] "Superannuation Payable",
[50] "Suspense",
[51] "Telephone & Internet",
[52] "Tracking Transfers",
[53] "Travel - International",
[54] "Travel - National",
[55] "Unpaid Expense Claims",
[56] "Unrealised Currency Gains",
[57] "Wage Payables",
[58] "Wages and Salaries"
]
from xeroizer.
Ahh, but my code is currently using the HEAD
version of Xeroizer.
from xeroizer.
I have bumped the Gem version with all the latest patches in it. If you update Xeroizer to 2.5.15 then this issue should be fixed.
from xeroizer.
Oh thanks!
from xeroizer.
Related Issues (20)
- Question: Does Xeroizer support OAuth 2? HOT 2
- `.sent_to_contact` on Invoices is undefined HOT 3
- Update the readme/documentation to include Oauth2Application HOT 2
- Xero Deprecation Notice - OAuth 1.0a HOT 1
- Timeout option not set correctly on OAuth 2 client HOT 3
- invoice.save returns false but invoice.errors is empty HOT 15
- New gem release? HOT 6
- How to get all the Items from Xero account HOT 1
- NameError: uninitialized constant Xeroizer::OAuth2Application HOT 4
- Double raise for expired tokens? HOT 2
- GET ERROR WHE do any object.save HOT 2
- trying to run tests as a developer... HOT 5
- syntax error, unexpected ',' in branding_theme.rb HOT 1
- Line Amount can not explicity be set to 0.00 if there is a discount
- Missing require somewhere: "uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState" when used outside of Rails HOT 3
- AuthorizationUnsuccessful error HOT 2
- ApiExceptions result in parse error
- Saving Quotes
- BankAccount Model Not Available?
- How to revoke token / delete current_connection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xeroizer.