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
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!
Srinivasan
@kksrini89

Hello guys, can anyone please help me?

I am trying to install ruby 2.3.x with rvm in Mac os Catalina. Getting errors spending last 2 days on this.

Thomas Bromehead
@thomasbromehead
@kksrini89 what's your issue? Do you have a stacktrace?
I suggest going through this book from Launchschool, there's a whole section dedicated to RVM.
https://launchschool.com/books/core_ruby_tools/read/ruby_version_managers#rvm
If you do a type rvmit should output function, if not you need to reinstall it.
Thomas Bromehead
@thomasbromehead
Did you ever find a solution to your issue @kksrini89 ?
Scott Giminiani
@ScottG489
I'm looking to load a media player (jwplayer) and it's thumbnail image earlier on browser page load. Is there a way I can prioritize it over other assets? Sorry if this is just a general frontend question but I was thinking maybe there would be a way with the asset pipeline. For context I'm trying to improve "page experience" in (chrome) lighthouse by having the player load faster. Specifically the LCP (largest contentful paint)
Thomas Bromehead
@thomasbromehead

Hi @ScottG489, with HTTP2 you can do stream prioritization.
Never implemented it myself but have a look here (scroll down to the Stream Prio paragraph):
https://www.speedshop.co/2016/01/07/what-http2-means-for-ruby-developers.html
https://discuss.rubyonrails.org/t/what-is-the-story-with-http-2-in-rails/75224/3

Definitely something to learn here

Scott Giminiani
@ScottG489
Thanks @thomasbromehead. I'll take a look
gerome0123
@gerome0123

I have this model Person
class Person
generate_public_uid generator: PublicUid::Generators::HexStringSecureRandom.new(32)

         has_many :addresses, as: :resource, dependent: :destroy
         accepts_nested_attributes_for :addresses, allow_destroy: true, update_only: true,
                                reject_if: proc { |attrs| attrs[:content].blank? }
     end

in my person table, I have this public_id that is automatic generated when a person is created. now the nested attribute in adding addresses is working fine. but the update is not the same as what nested attribute default does. my goal is to update the addresses using public_id

class Address
generate_public_uid generator: PublicUid::Generators::HexStringSecureRandom.new(32)

   belongs_to :resource, polymorphic: true

end
this is my address model

I'm using the public id to my primary key. and trying to update nested attribute using the public_id

PavitKaur05
@PavitKaur05
Hi, I just have a quick question and thankful if somebody could answer it, the question is that whether :public and :private could be used to give as values for a enum type attribute for a model or should it give error since those are keywords in rails or ruby?
mtancoigne
@mtancoigne:matrix.org
[m]
@PavitKaur05: Good question, unfortunately I don't have the answer. I'd say "yes you can 'cause a symbol is not the same as the keyword", but have nothing to confirm this.
can we define a "private method?" ?
class Testit
  def private
    puts 'ok, its private then'
    private_thing
  end
  private

  def private_thing
   puts ' test'
  end
end
a = Testit.new
a.private
# ok, its private then
# test
but a class method named private messes up the class: