Questions tagged [pry-rails]

Pry-rails refers to the runtime developer console Pry that is used as an alternative to the standard IRB shell for the programming language Ruby. Use this tag for questions related to the runtime developer console.

Pry-rails refers to the runtime developer console Pry that is used as an alternative to the standard IRB shell for the programming language Ruby. Use this tag for questions related to the runtime developer console.

36 questions
0
votes
1 answer

Function Returning Different Values If Pry Debugger Statements Included

I'm experiencing a strange issue with a ruby function I wrote to remove unwanted items from a hash created by parsing a JSON string. The function will return what I am expecting when I have pry statements included in the function as seen at the…
E Newmy
  • 185
  • 1
  • 1
  • 11
0
votes
1 answer

Seed file contradiction in terminal and pry console

I have a small problem. I am making a simple project website which has 4 models (users, articles, discussions, comments). The following associations have been set up: Users have many discussions and comments, articles have many discussions (and…
achacttn
  • 163
  • 2
  • 9
0
votes
2 answers

Rails params.nil? if else

I have this simple rails code and something weird is happening. As you can see params.nil? is true and it's still calling the else part. What am I missing here? Pry Session 5: def build_resource 6: binding.pry 7: if params.nil? …
luisenrike
  • 2,742
  • 17
  • 23
0
votes
1 answer

Problems for add the watchers in a join_table

When I create a post, I'm adding the watchers of the post. So when the admin creates a post it will be add on the join_table post_watchers. And when I add this with the after_create I'm facing problems because it's adding the user two times. Why…
rld
  • 2,603
  • 2
  • 25
  • 39
0
votes
1 answer

Rails is showing incorrect calculation

[8] pry(#)> self[:total_outstanding]||0 / self.dd_amount => 10100.0 [9] pry(#)> self[:total_outstanding]||0 => 10100.0 [10] pry(#)> self.dd_amount => 900.0 [11] pry(#)> self[:total_outstanding].to_i||0/self.dd_amount.to_i =>…
whizcreed
  • 2,700
  • 3
  • 22
  • 35
-1
votes
0 answers

Pry and pry-rails weird errors

So everytime I start pry console on my windows machine, it initially works as normal for the first line, but then it somehow doubles and repeats itself in some weird way at the next lines. PS C:\Users\locdu\OneDrive\Desktop\twittery> rails console …
1 2
3