Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-31 Thread 'krfg' via Ruby on Rails: Talk
Well, so thank you for helping me and supporting me up to the solution. I am already looking for and reading documentation on transactions, sequences and truncations in Postgres, which is new stuff for me. My next goal is finding how to reset the id sequence in Postgres. I seize the opportunity

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-30 Thread 'krfg' via Ruby on Rails: Talk
On Tuesday, December 29, 2015 at 7:31:36 PM UTC+1, tamouse wrote: > > > >> What happened when you tried creating a new test application? > >> > > The problem as you've stated it is that your first user gets id=2. The > point of the test is to find the minimum set of conditions that >

[Rails] Why the first user created would get id 2 instead of 1?

2015-12-26 Thread 'krfg' via Ruby on Rails: Talk
Have any of you any idea why at Heroku the first user created would get id 2 instead of 1, and ActiveRecord cannot find user with id 1? After deploying my application I created a new user and noticed that the address bar was reporting number 2 at the end of the url:

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-27 Thread 'krfg' via Ruby on Rails: Talk
On Saturday, December 26, 2015 at 10:44:44 PM UTC+1, Colin Law wrote: > > Did you create a user and then delete it again? If so then that would > explain it. id numbers are not reused. Whatever the reason do not > worry about it, you should never assume anything about the actual > value

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-27 Thread 'krfg' via Ruby on Rails: Talk
On Sunday, December 27, 2015 at 7:17:17 PM UTC+1, Hassan Schroeder wrote: > > > I can't imagine that being a possibility, but what's stopping you from > looking for yourself? > > And if you're concerned that an action is causing duplicate queries > to be run, why not look at the DB logs? > I

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-28 Thread 'krfg' via Ruby on Rails: Talk
On Monday, December 28, 2015 at 4:54:42 AM UTC+1, tamouse wrote: > > > Personally, I have the suspicion that you've used the same database on > that Heroku project for a previous try with this app and it's an > artifact of having previously created a user in that table in the > database. To be

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-28 Thread 'krfg' via Ruby on Rails: Talk
On Monday, December 28, 2015 at 4:54:42 AM UTC+1, tamouse wrote: > > > Personally, I have the suspicion that you've used the same database on > that Heroku project for a previous try with this app and it's an > artifact of having previously created a user in that table in the > database. To be

Re: [Rails] Why the first user created would get id 2 instead of 1?

2015-12-29 Thread 'krfg' via Ruby on Rails: Talk
On Tuesday, December 29, 2015 at 4:38:47 AM UTC+1, tamouse wrote: > > > > What happened when you tried creating a new test application? > > I am sorry but if you do not mind I need some instruction on how to recreate same conditions in a test app. I feel and am a bit awkward at this stage. As

[Rails] Re: Ruby on Rails Tutorial - test, reset password

2016-01-28 Thread 'krfg' via Ruby on Rails: Talk
On Wednesday, January 27, 2016 at 10:46:39 AM UTC+1, Ruby-Forum.com User wrote: > > But if so, @user from fixtures should also have > reset_token now (if its reset_digest was influenced by create action > (specifically create_reset_digest method). Can someone please take a > look? > I am

[Rails] Re: Online vs offline IDE

2016-01-27 Thread 'krfg' via Ruby on Rails: Talk
On Wednesday, January 27, 2016 at 9:21:34 AM UTC+1, Mike wrote: > > Both Rubymine and Aptana can be a bit slow / bloated, and they do have > different feature levels (last time I looked). As they are both Java based > you gain the benefit of the introspection which allows the intelligent >

[Rails] Online vs offline IDE

2016-01-26 Thread 'krfg' via Ruby on Rails: Talk
I am aware that Rubyists prefer to use Sublimetext, Vim or TextMate and I personally like Atom (which is open source), but I got used to studying Ruby on Rails with an IDE and personally found it useful, although I suppose I mainly appreciate the integrated terminal and I have no other

[Rails] Is it possible to toggle via web a boolean attribute which is not a strong parameter?

2016-08-15 Thread 'krfg' via Ruby on Rails: Talk
The application I am working on is largely based on Michael Hartl's tutorial. The create action for the users controller uses *strong parameters *with permitted parameters*. *The 'admin'

[Rails] javascript_include_tag and custom js files

2016-07-10 Thread 'krfg' via Ruby on Rails: Talk
The default setting in my application.html.erb is: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'true' %><%= javascript_include_tag 'application', 'data-turbolinks-track': 'true' %> I have a cusom.css.scss file in app/assets/stylesheets which is included

Re: [Rails] javascript_include_tag and custom js files

2016-07-10 Thread 'krfg' via Ruby on Rails: Talk
I past and copy below the content of my application.js file. The lines '//= require jquery' and '//= require jquery_ujs' should assure that the jquery and jquery-ujs files provided by jquery-rails gem will be added to the asset pipeline and available for use. "The require_tree directive tells

Re: [Rails] Incomprehensible (for me) changes not staged for commit

2016-08-08 Thread 'krfg' via Ruby on Rails: Talk
On Monday, August 8, 2016 at 4:01:16 PM UTC+2, Colin Law wrote: > > > The are (or were) in your tree. The rails root dir contains a bin > directory with those files in it. Somehow they have been deleted. I > suggest you do > git checkout . > (note the dot on the end) which will restore

[Rails] Incomprehensible (for me) changes not staged for commit

2016-08-08 Thread 'krfg' via Ruby on Rails: Talk
Hi, after few weeks of inactivity I ran today on my master branch the command 'git status', and I got this: krfg@SATELLITE-L50-A-161:~/workspace/example_app (master)*$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add/rm

[Rails] Re: Incomprehensible (for me) changes not staged for commit

2016-08-08 Thread 'krfg' via Ruby on Rails: Talk
I am using Rails 4.2.2, ruby 2.2.1p85 and rvm. 'rails console --sandbox' does not work anymore: krfg@SATELLITE-L50-A-161:~/workspace/example_app (master)*$ rails console --sandbox Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to

[Rails] Re: Incomprehensible (for me) changes not staged for commit

2016-08-08 Thread 'krfg' via Ruby on Rails: Talk
I am using Rails 4.2.2, ruby 2.2.1p85 and rvm. 'rails server' does not work anymore. 'rails console --sandbox' does not work anymore: krfg@SATELLITE-L50-A-161:~/ workspace/example_app (master)*$ rails console --sandbox Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH]

[Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Once I completed Michael Hartl's tutorial, I packed my homepage in a partial and called it _social_layer.html.erb Then I inserted this partial in my new homepage and proceeded to develop my application. Therefore, an extract of application's new homepage looks like as follows:

[Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Once I completed Michael Hartl's tutorial, I packed my homepage in a partial and called it _social_layer.html.erb Then I inserted this partial in my new homepage and proceeded to develop my application. Therefore, an extract of application's new homepage looks like as follows:

[Rails] Re: What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
NOTE: I did not inserted any link on 'tournament.name' but it keeps coming out of nowhere automatically. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Only the test, the application works as expected. I thought the problem might be that there are too many nested partials in the homepage, but apart from that I have no idea why the test fails -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 12:31:17 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 11:02, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > In app/controllers/static_pages_controller.rb the following variables > (among

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
In app/controllers/static_pages_ controller.rb the following variables (among others) are defined: def home if logged_in? && !current_user.gamer? ... elsif logged_in? && current_user.gamer? ... @week_num = Time.now.strftime("%W").to_i

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
You can have a look at the partial _social_layer.html.erb at this link : it is the code included in the if statement. As I said, I changed my homepage as follows: <% if logged_in? %> <% if current_user.gamer? %>

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
In app/controllers/static_pages_controller.rb the following variables (among others) are defined: def home if logged_in? && !current_user.gamer? ... elsif logged_in? && current_user.gamer? ... @week_num = Time.now.strftime("%W").to_i

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Below is what the console is reporting when I run the test. As you can notice, the test raises one error: method any? on nil class (the instance variable @atp_tournaments of the code in my first post). If I change this instance variable with its explicit value, the next error is of next method

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 12:50:19 PM UTC+1, krfg wrote: > > > > On Friday, February 10, 2017 at 12:31:17 PM UTC+1, Colin Law wrote: >> >> On 10 February 2017 at 11:02, 'krfg' via Ruby on Rails: Talk >> <rubyonra...@googlegroups.com

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
> > > The home page is controlled by static_pages_controller.rb > However the part of the home page concerning microposts creation and > deletion is controlled by the microposts controller. > Below is an extract of microposts_controller.rb > > class MicropostsController < ApplicationController >

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:05:57 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 11:50, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > > > I would need information about logger.info > > When I try to open test.log Ato

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > > > Ok, thanks for the suggestion. > > I will try to use tail if it works wi

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > > > Ok, thanks for the suggestion. > > I will try to use tail if it works wi

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 2:32:49 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:44, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > ... > > As you suggested I inserted logger.info immediately after the > declar

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 3:43:00 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 14:29, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > ... > > Then the problem was just rendering the home page after invalid > submissi

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 2:58:48 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 13:46, 'krfg' via Ruby on Rails: Talk > <rubyonra...@googlegroups.com > wrote: > > ... > > The home page is controlled by static_pages_controller.rb > > However the

[Rails] An issue with cable.js after rails 4.2.2 - 5.0.0.1 update

2016-08-19 Thread 'krfg' via Ruby on Rails: Talk
I upgraded a copy of my rails 4.2.2 application to rails 5.0.0.1, following instructions at railsapp and at edgeguides.rubyonrails.org Most of my work consisted in consulting

Re: [Rails] An issue with cable.js after rails 4.2.2 - 5.0.0.1 update

2016-08-19 Thread 'krfg' via Ruby on Rails: Talk
Thanks. Plainly railsdiff.org does not consider and report empty directories. I found two of them: app/assets/javascripts/channels/ test/fixtures/files/ with an hidden, empty .keep file inside each one They are not in rails 4.2.2 -- You received this message because you are subscribed to the

[Rails] Best choice for scheduled jobs

2016-09-25 Thread 'krfg' via Ruby on Rails: Talk
My Rails 5 application should rely upon the execution of tasks at a specific time: a task every Monday at 8:00 am (except in December), a task any time the 1st of January, a task before 10 am the 1st of December and a task every 1st of each month of the year. All these tasks should be executed

Re: [Rails] Is the test database cleared after each test?

2016-12-03 Thread 'krfg' via Ruby on Rails: Talk
On Friday, December 2, 2016 at 10:45:45 PM UTC+1, Colin Law wrote: > > > The default is that the database will be rolled back between tests. If > you look in test.log you will the rollbacks happening. > > This is coherent with a useful stackoverflow topic

[Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
Some of my tests would not pass if the test database was not cleared after the previous tests. For instance my application, based on the Michael Hartl's tutorial, gives users the opportunity to create an association between two users. The web interface is configured to use or not use Ajax. There

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
On Friday, December 2, 2016 at 6:45:12 PM UTC+1, Dave Aronson wrote: > > > The important thing is that every test start from a *known state*. > The easiest state to achieve and reason about, is empty. > And what is Rails' default behaviour? I only guess that it empties all tables after each

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
I will have a look at database_cleaner. Many thanks for your suggestion. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] Ajax not working inside iteration

2017-01-02 Thread 'krfg' via Ruby on Rails: Talk
I have a AtpRank model containing the first 100 Atp tennis players. My goal is to create in the view a table listing all tennis players and their attributes, along with a button for each player useful for the user to choose a list of tennis players. The home.html.erb code is below: <%

[Rails] Configuring Sentry as error handling service to provide additional request context

2017-03-10 Thread 'krfg' via Ruby on Rails: Talk
I would like to add an error handling service to my Ruby on Rails application and decided to give Sentry a try because, unlikely many other services, it has a free tier. I am wondering if there is any of you who is experienced with Sentry configuration. Basic configuration looks simple.

[Rails] rvm installation on Ubuntu for managing different rails applications

2017-11-28 Thread 'krfg' via Ruby on Rails: Talk
I need to install `rvm` on a new machine. I would use `rvm` to switch to different ruby versions and gemsets required by different Ruby on Rails applications. When a couple of years ago I installed rvm on my current Ubuntu machine, I did it with the following command: $ \curl -L

[Rails] ActionMailer: end of file reached (EOFError)

2018-05-07 Thread 'krfg' via Ruby on Rails: Talk
I am studying Peter Cooper's book Beginning Ruby. According to the author ActionMailer can be used independently of Rails. So I installed the ActionMailer gem in a dedicated gemset and wrote the code below which is an extract from the book: require 'action_mailer'

Re: [Rails] ActionMailer: end of file reached (EOFError)

2018-05-08 Thread 'krfg' via Ruby on Rails: Talk
On Monday, May 7, 2018 at 10:37:36 AM UTC+2, David Merrick wrote: > > EOF usually mean you reached the end of the file or are to read past it. > > So why my code produces this error message? I checked all the required ends: there are two, one for class Emailer and one for method test_email --

Re: [Rails] ActionMailer: end of file reached (EOFError)

2018-05-11 Thread 'krfg' via Ruby on Rails: Talk
Solved at Stackoverflow https://stackoverflow.com/q/50201093/507 > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to