How can I upgrade ember-rails' version of ember-data to revision 12? - ember-data

I've got ember-rails updated to master:
bundle update ember-rails
Updating git://github.com/emberjs/ember-rails.git
Fetching gem metadata from https://rubygems.org/.........
....
Using ember-rails (0.11.1) from git://github.com/emberjs/ember-rails.git (at master)
....
Your bundle is updated!
I'd like to use the latest ember-data revision (12), but every time I update my app's store revision number to 12, i.e.:
App.Store = DS.Store.extend({
revision: 12,
adapter: App.Adapter.create()
});
I see the following error message:
Uncaught Error: Error: The Ember Data library has had breaking API changes since the last time you updated the library. Please review the list of breaking changes at https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md, then update your store's `revision` property to 11
...and when I check out DS.CURRENT_API_REVISION it's 11:
console.log(DS.CURRENT_API_REVISION); // 11
Is there a way to get the gem to pull in revision 12, or do I have to build ember-data myself and override the included version?

benburton's solution works for what is asked for, but in the latest ember-data it uses an internal method 'readOnly' that was only added to in ember RC2.
Therefore, you need the latest ember in order to run the latest ember-data. The full solution is to simply disregard the second line of your solution, leaving the following:
rails generate ember:install --head

I ended up using ember-rails to generate ember+ember-data and then removing the updated version of Ember like so:
rails generate ember:install --head
rm vendor/assets/ember/development/ember.js vendor/assets/ember/production/ember.js

Related

Quickbooks & Rails 5, can't create an invoice

Things were working fine until I started the upgrade from Rails 4.2 to 5.0
Using qbo_api gem (1.8.1) which also now needs the simple_oauth (0.3.1) as well as the oauth (0.5.4) gem. (The faraday gem (0.14.0) is loaded as another dependency.)
I can successfully do get requests for invoice, customer, etc., so the keys and initialization of the qbo_api object are all working for qbo_api.get() but when I try to create an invoice with qbo_api.create(:invoice, payload: ...), I get the error:
Operation Could not find resource for relative : /v3/company/123145710499109/invoice of full path: https://sandbox.qbo.intuit.com/qbo50/v3/company/123145710499109/invoice is not supported.
The same qbo_api object is working for get, I see nothing obviously wrong with the URL, and it is unreleated to the JSON payload. I'm not sure where to look to debug this problem.
BTW, clicking on the URL above seems to go to QB just fine, returning a validation error as you would expect.
This turns out to be a problem in the 1.8.0 and 1.8.1 versions of the qbo_api gem. Minimul has released version 1.8.2 which fixes this problem.
Kudos to Minimul for a quick response to this.
check your realmId. Most probably realmId is not match to your connected intuit app. This is why its tells that Operation Could not find resource for relative.

Protractor 5.1.1 selenium-webdriver version inconsitency

I've recently upgraded to Protractor 5.1.1 and am facing some issues when setting cookies via browser.manage().addCookie()
The API has changed between versions 2 and 3 of Selenium-webdriver to expect an object rather than the previous 2..6 arguments. When I make the changes to my code to use the object, the typescript compiler complains saying that it expects 2..6 arguments.
old api:
browser.manage().addCookie('cookieName', 'cookieVal');
new api:
browser.manage().addCookie({name:'cookieName', value: 'cookieVal'});
I think this is because the #types/selenium-webdriver in the package.json of protractor v5.1.1 is pointing at version 2.53.39. The version of the actual selenium-webdriver the same package.json is referencing is 3.0.1.
Should this be the same value? Is anyone else experiencing problems with this?
Yup, this is happening because the type definitions was not written at the time.
workaround
Here is the workaround for now:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
We are setting browser.manage returned options object to any. Then we can give it the addCookie method.
OR
upgrade definitions
you could upgrade your #types/selenium-webdriver type definitions to version 3.
I'm having the same problem! I do know that the #types/selenium-driver is now updated to version 3.0.0.
I haven't had luck with this, but you could try installing it directly (i.e. npm install --save-dev #types/selenium-webdriver) and adding it to your list of types in your tsconfig.json file (i.e. types: [ "selenium-webdriver" ].

Rails 3 in test env won't allow records to save, even with latest sqlite3

I saw this post:
Rails/ActiveRecord/SQLite3: Can't save records in test environment
And after upgrading my sqlite version to the very latest (3.7.17), I am still getting the following error:
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
Any time I try to create anything at all. If all I do is load my fixtures, everything is fine.
I have confirmed that rails is using the updated sqlite3 version by running "rails db".
In my development environment, I can create objects all day long with no errors (I can even have an object create another object after create).
What is special about my test environment that this is happening? How can I fix it?
Edit:
If I delete my test database, and redo rake:db:create and rake:db:migrate, I still get the same issues.
Doing "rails console test" lets me use the test environment just fine, and I can create objects all day long and see existing fixtures. It's only when I type "rake test:units" that I get the errors... (originally I had errors, but one error was legitimate (I don't know why I wasn't getting it in the development environment, and the adapter error was because apparently you aren't supposed to do "rails console RAILS_ENV="test", so it was looking for an adapter for an envrionment called "RAILS_ENV=test")
Edit: When I type "gem uninstall sqlite3" it uninstalls. When I then type "bundle install" it has a problem reinstalling...working on it now.
/home/jenny/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb --with-sqlite3-dir=/usr/local/bin/sqlite3 checking for sqlite3.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check
the mkmf.log file for more details. You may need configuration
options.
If I type "gem install sqlite3" separately, it works just fine, and then "bundle install" it works. However, "rake test:units" has the same errors.
Edit:
When I type "which sqlite3" it prints out "/usr/local/bin/sqlite3"
I wasn't even aware sqlite3 headers were a thing, so I doubt I installed them. I'll try to figure out how to confirm this and see if it helps.
Edit:
I don't see anywhere to download sqlite3 headers on the main site...just source and the precompiled linux binary. There doesn't seem to be a special header in the source, but even if there was, wouldn't it be included in the precompiled binary?
EDIT: link to bundler sqlite3 install error that don't happen when i manually install the gem
http://pastie.org/8063577
EDIT: Not a devise problem. I thought it was, but it turned out I was just creating another object in fixtures, not in the test code.
So, I can create devise User or any other type of object in fixtures all day long, but if I attempt to create one in the unit test, I get the save point error. Same thing for trying to save a fixture in a unit test.
Your problem is most likely related to the fact that you updated your local sqlite but after that you haven't reinstalled your sqlite3 gem.
I'd recommend you follow these steps:
Remove the corresponding line gem 'sqlite3' from your Gemfile
Run bundle install
Run gem uninstall sqlite3
Return the line gem 'sqlite3' to your Gemfile
Run bundle install one more time
If you simply gem uninstall and then bundle install, it will install the same version and dependencies that were recorded in Gemfile.lock. But since you're now using a different and more updated local version, it's safer to allow Bundler to install a new version if needed.

Magento Module SQL/Setup Resource File

I updated the SQL file for my module - how do i get it to automatically run again without creating a new version of it?
I am working on my first module and just need to tweak this one so it works on a new install for someone else.
When Magento automatically runs a SQL file for a setup resource, it makes an entry in the core_resource table.
mysql> SELECT code,version,data_version FROM core_resource;
adminnotification_setup 1.0.0 1.0.0
admin_setup 0.7.2 0.7.2
amazonpayments_setup 0.1.2 0.1.2
api_setup 0.8.1 0.8.1
backup_setup 0.7.0 0.7.0
bundle_setup 0.1.11 0.1.11
...
You'll need to remove the single row in this table that corresponds to your module, and then clear your Magento cache. This will let you re-run your setup resource SQL file.
ONLY remove that single row — if you remove rows for the core modules, there will be much breaking and weeping.

RJS Handler missing

I got a missing template error when I tried to achieve a task using RJS.
All I want is to execute an RJS file on ajax call. But I am getting the
following error.
ActionView::MissingTemplate (Missing template line_items/create,
application/create with {:handlers=>[:erb, :builder, :coffee],
:formats=>[:js, :html], :locale=>[:en, :en]}. Searched in:
* "<MY APP PATH>/app/views"
):
app/controllers/line_items_controller.rb:46:in `create'
But the create.js.rjs is present in the folder /views/line_items. You
can see the handlers miss .rjs extension. I think thats causing the
error.
If I change .rjs to .erb, it works and the content is executed as
javascript and thus I need to modify the RJS functions to Javascript to
return the contents of AJAX call.
Could you please explain how I can attain this using RJS? Please help.
Following is the versions of tools I use.
Ruby version 1.9.2 (i686-linux)
RubyGems version 1.8.10
Rack version 1.3
Rails version 3.1.0
JavaScript Runtime Node.js (V8)
Active Record version 3.1.0
Action Pack version 3.1.0
Active Resource version 3.1.0
Action Mailer version 3.1.0
Active Support version 3.1.0
Thanks in advance.
in order to use RJS with Rails 3.1 you have to use the prototype-rails gem
Make sure prototype-rails gem is in bundler's production group. If you put it in the assets group it will not register the RJS template handler.