Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:23
    gmcgibbon synchronize #34468
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:12
    kamipo commented #34316
  • Nov 19 2018 23:10
    oniofchaos commented #34218
  • Nov 19 2018 23:09
    rafaelfranca synchronize #30320
  • Nov 19 2018 23:08
    oniofchaos commented #34236
  • Nov 19 2018 23:07
    rafaelfranca closed #34487
  • Nov 19 2018 23:07

    rafaelfranca on master

    Prevent TextHelper#word_wrap fr… Merge pull request #34488 from … (compare)

  • Nov 19 2018 23:07
    rafaelfranca closed #34488
  • Nov 19 2018 23:06
    rafaelfranca review_requested #34308
  • Nov 19 2018 23:05
    oniofchaos commented #34280
  • Nov 19 2018 23:01
    oniofchaos commented #34308
  • Nov 19 2018 22:52
    rafaelfranca synchronize #30320
  • Nov 19 2018 22:51

    rafaelfranca on master

    Indent guides as rails help com… Homogenize rails help output I… Merge pull request #34085 from … (compare)

  • Nov 19 2018 22:51
    rafaelfranca closed #34085
  • Nov 19 2018 22:51
    rafaelfranca commented #33643
  • Nov 19 2018 22:51
    rafaelfranca closed #33643
  • Nov 19 2018 22:50

    rafaelfranca on 5-2-stable

    Merge pull request #34106 from … (compare)

  • Nov 19 2018 22:49
    rafaelfranca synchronize #30320
Sourav Goswami
@Souravgoswami
IO.read() doesn't read the data, it's kind of cached
I am using a class variable there though...
Kaia Leahy
@tenebrousedge
and you're entirely sure that cat is reading from the same dyno?
Sourav Goswami
@Souravgoswami
Sure
The reason is that the dyno is a container
What does it show? Look at the process start time, it's like 1 hour or so
Because you are running the same container as I am
No matter where you are, my heroku account is free
If you then go to the home page, start calculating pi, you will see the CPU usage goes 12.5%, core count is 8, 12.5 * 8 = 100% of a core
Kaia Leahy
@tenebrousedge
you say yes it is, your code says no it isn't
Sourav Goswami
@Souravgoswami
Well actually you are right. I am running the picalc, and then I ran heroku bash on my system, then checked the nodename with LinuxStat::OS.nodename, it's different. The IP is different, the root is mounted on /dev/loop8 instead of /dev/loop2. So the online instance is different from the heroku bash I am running.
Kaia Leahy
@tenebrousedge
kk. So I'm going to go out for a run, I'll check back later if you have further questions
Sourav Goswami
@Souravgoswami
I learnt a lot! Thanks... I don't have further questions!
Interestingly I am changing data on another container with the rake task, rather than changing it on the rails root... 😂😂
Sourav Goswami
@Souravgoswami
Anyway, I have created one thread in the controller that updates the data there. I have also implemented begin rescue block that is run if the thread fails for 3 times, to avoid race condition. It's updating the data.txt, but not keeping that data in memory for some other reason. It's working perfectly fine. So technically I can write to heroku's rootfs, it's just a simple container with r/w access. But I can't use rake task because the container that I fire up with rake or with heroku run bash is completely different container, as far as I have seen...
Actually I don't even need rails for that. My app's view folder is deleted, along with many rubygems like webpacker itself! It has no JS, or database. It just has a route and the controller. At this point I think it's really not a good idea to use rails... Any ruby server could be used there...
Gus P
@staycreativedesign
how does one add a helper to a gem im creating? I just created a gem and im trying to add a helper to my gem inside the gem
Marco Amato
@linediconsine

Hi all,

I see in the log this error

"../../../../../../../../../../etc/services{{" is not a valid MIME type

Do you have any clue about what its happening here?

Thanks

Look like somebody with an Header parameter like:

../../../../../../../../../../etc/services{{

Make a request to my app, its this a sort of attack?

Mike Simkins
@msimkins
Has been seen before, they are hoping you have insecure permissions on system files
Marco Amato
@linediconsine
@msimkins Thanks for confirm it
Andrews Peprah Addai
@andrews-peprah
Hi. Does anybody have in mind any other internationalisation gem aside the rails default?
Valentin Damian
@1a
hi people - newbie here. Did anyone do Michael Hartl's rails tutorial and had an Invalid Activation Link error although they followed every step?
KuldeepChotaliya146
@KuldeepChotaliya146
Hello
I am newbie here
Biep
@Biep
I am new, and don't even know my user name..
Ah, it's "Biep". All right.
Joseph A.
@matedemorphy
hello
i'm trying to deploy my app to Heroku but i'm getting this error ´cannot load such file -- bootsnap/setup´
Rails 5.2.4, Ruby 2.6.3, Heroku Stack 18, gem 'bootsnap', '>= 1.4.3'
please help
Joseph A.
@matedemorphy
even if i remove the bootsnap gem the error remains: Could not detect rake tasks, ensure you can run $ bundle exec rake -P against your app and using the production group of your Gemfile.
Mpampis Kostas
@charkost
Rails N+1 queries auto-detection with zero false positives / false negatives: https://github.com/charkost/prosopite
Sourav Goswami
@Souravgoswami

even if i remove the bootsnap gem the error remains: Could not detect rake tasks, ensure you can run $ bundle exec rake -P against your app and using the production group of your Gemfile.

That happens to me, the thing I do to solve this is to copy rake to bin/, and run rake from bin/rake

That doesn't only appen in rails, but also in sinatra..
Jordan Shackelford
@JordanShackelford
hey guys I replaced sqlite3 with pg in my gem file
but when I run my server and connect I get
Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile.>
I checked my Gemfile and found no occurrence of sqlite3 so I'm wondering why it wants to use that as opposed to postgresql?
Jordan Shackelford
@JordanShackelford
ok apparently I had to update my database.yml file from sqlite3 to pg
sarathmsk
@sarathmsk
Looking for Full Stack Ruby On Rails (ROR) Engineers for long term contract role. This is 100% remote opportunity. The applicant should reside in United States. For more info, please reach out to me at sarath@mindsource.com
Markus
@ich:matrix.markusbenning.de
[m]

Hi everyone, i have a problem with a complex eager loading scenario. I have a data model like this:

class Closure < ApplicationRecord
  has_and_belongs_to_many :geo_refs
end
class GeoRef < ApplicationRecord
end

I use to cancancan gem for filtering both record types by users permissions.
So my current query looks like this:

@closures = Closures.includes(:geo_refs).accessible_by(current_ability, :read)

But that will of course eager load all GeoRef of a closure. Not just the one accessible by the user. I need to apply the accessible_by filter again for the eager loaded association.

Markus
@ich:matrix.markusbenning.de
[m]
I guess i have to split the query into two and do the eager loading on my own.
Markus
@ich:matrix.markusbenning.de
[m]
I can query the GeoRefs and filter them with a join:
@geo_refs = GeoRef.joins(:closures).where('closures.id': @closures).accessible_by(current_ability, :read)
But how can i retrieve them grouped together by the closures.id?
Like:
{ 1: [#<GeoRef id:1>, #<GeoRef id:2>], 2: [...] }
Markus
@ich:matrix.markusbenning.de
[m]
Maybe i found the solution:
@geo_refs = GeoRef.joins(:closures).where('closures.id': @closures).accessible_by(current_ability, :read) \
  .select('closures.id AS closure_id, geo_refs.*').index_by(&:closure_id)
Oleksandr Bratashov
@abratashov
Hello guys! Here I've asked about the problem with auto-reloading changed files in Rails 6 is it an issue or am I wrong?
thanks!