havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.2, 3.1.4, 3.0.6, 3.3.0-preview1: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 256 seconds]
desnudopenguino1 is now known as desnudopenguino
markong has joined #ruby
Pixi has quit [Ping timeout: 240 seconds]
John_Ivan has joined #ruby
Pixi has joined #ruby
markong has quit [Ping timeout: 240 seconds]
roadie` has quit [Ping timeout: 248 seconds]
ua_ has quit [Ping timeout: 246 seconds]
shokohsc2 has joined #ruby
shokohsc has quit [Ping timeout: 250 seconds]
shokohsc2 is now known as shokohsc
moldorcoder7 has quit [Ping timeout: 256 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 250 seconds]
roadie` has joined #ruby
roadie` has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
roadie` has joined #ruby
roadie` has quit [Ping timeout: 248 seconds]
John_Ivan has quit [Ping timeout: 256 seconds]
donofrio has quit [Ping timeout: 250 seconds]
_ht has joined #ruby
jhass has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
desnudopenguino1 is now known as desnudopenguino
jhass has joined #ruby
polishdub has quit [Ping timeout: 250 seconds]
donofrio has quit [Ping timeout: 250 seconds]
polishdub has joined #ruby
roadie` has joined #ruby
roadie` has quit [Ping timeout: 248 seconds]
comet23 has joined #ruby
grenierm has joined #ruby
roadie` has joined #ruby
roadie` has quit [Ping timeout: 248 seconds]
_ht has quit [Remote host closed the connection]
cagey31 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
roadie` has joined #ruby
roadie` has quit [Client Quit]
roadie has joined #ruby
yosafbridge has quit [Quit: Leaving]
friendlypunk has joined #ruby
yosafbridge has joined #ruby
Mahfuj has joined #ruby
<Mahfuj> Hello Everyone!
<Mahfuj> Seareed Inc. is seeking a skilled and passionate developer to join our dynamic e-commerce platform. If you are an experienced professional who thrives in a deadline driven, and fast-paced environment, and who has a strong background in web development, this is an excellent opportunity to contribute to the growth and success of our platform. At Seareed, we value creativity, innovation, and a passion for delivering exceptional user experiences. If you are
<Mahfuj> excited about joining a dynamic team and making a significant impact on the future of our e-commerce platform. Our technical requirements includes doing many payment integrations, but the main framework is Stripe. Pay range 40 USD -100 USD per hour depending on skills, and experience. Please email me resume, portfolio, your relevant experience and why you are interested in this position at reazmahfuj124@gmail.com. We look forward to hearing from you!
teclator has joined #ruby
grenierm has quit [Quit: Client closed]
grenierm has joined #ruby
otisolsen70 has joined #ruby
comet23 has quit [Ping timeout: 245 seconds]
grenierm has quit [Ping timeout: 245 seconds]
ua_ has joined #ruby
infinityfye has joined #ruby
crespire has joined #ruby
crespire1 has quit [Ping timeout: 256 seconds]
roadie has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.91)]
roadie has joined #ruby
shokohsc6 has joined #ruby
shokohsc has quit [Ping timeout: 250 seconds]
shokohsc6 is now known as shokohsc
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
gr33n7007h has quit [Ping timeout: 250 seconds]
gr33n7007h has joined #ruby
gr33n7007h has quit [Ping timeout: 250 seconds]
gr33n7007h has joined #ruby
dza has quit [Remote host closed the connection]
Mahfuj has quit [Ping timeout: 240 seconds]
panella32 has joined #ruby
<panella32> Surprisingly Movie.joins(:movie_people) works but MoviePeople.joins(:movies) not! Any idea? (There's a one-to-many relationship between them)
<panella32> Error Can't join 'MoviePerson' to association named 'movies'; perhaps you misspelled it?
<panella32> >> ActiveRecord::Base.connection.execute("SELECT movie_people.* FROM movie_people INNER JOIN movies ON movie_people.movie_id = movies.id") also works!
<ruby[bot]> panella32: # => (https://carc.in/#/r/f5bl)
<panella32> Isn't weird?
moldorcoder7 has joined #ruby
dza has joined #ruby
caleb has quit [Remote host closed the connection]
Bounga has quit [Remote host closed the connection]
sgtapple has quit [Remote host closed the connection]
slondr has quit [Remote host closed the connection]
whereiseveryone has quit [Remote host closed the connection]
matta has quit [Remote host closed the connection]
johnhamelink has quit [Remote host closed the connection]
srushe has quit [Remote host closed the connection]
alexisg has quit [Remote host closed the connection]
graemefawcett has quit [Remote host closed the connection]
pjaspers has quit [Remote host closed the connection]
patrick has quit [Remote host closed the connection]
KOTP has quit [Remote host closed the connection]
g_sg has quit [Remote host closed the connection]
tsujp has quit [Remote host closed the connection]
Bounga has joined #ruby
patrick has joined #ruby
johnhamelink has joined #ruby
graemefawcett has joined #ruby
hwrd has joined #ruby
srushe has joined #ruby
tsujp has joined #ruby
sgtapple has joined #ruby
g_sg has joined #ruby
KOTP has joined #ruby
caleb has joined #ruby
slondr has joined #ruby
whereiseveryone has joined #ruby
pjaspers has joined #ruby
matta has joined #ruby
alexisg has joined #ruby
nona has joined #ruby
Sankalp has quit [Ping timeout: 265 seconds]
Mahfuj has joined #ruby
Sankalp has joined #ruby
m_antis has joined #ruby
Sankalp has quit [Ping timeout: 240 seconds]
<adam12> panella32: Is it MoviePeople or MoviePerson?
<adam12> panella32: Make sure whatever model it is, has the inverse association back to Movie. Might be belongs_to or something else.
donofrio has joined #ruby
meimei has quit [Ping timeout: 256 seconds]
pounce has quit [Ping timeout: 256 seconds]
<panella32> adam12 Sorry. it is MoviePerson. The associations : https://imgur.com/a/ilI1RqW
<panella32> spend almost 5 hours and still hav no idea why it's not working vice vera.
<adam12> panella32: joins(:movie) maybe? singular.
<panella32> Let me try
Mahfuj has quit [Ping timeout: 240 seconds]
DoxYourselfNow has joined #ruby
<panella32> adam12 you such adam12! It worked!
<panella32> I wanted to say you such a savior!
DoxYourselfNow has quit [Remote host closed the connection]
<panella32> There's a similar issue with another association somewhere else. Let me try this trick to see it also works there or not..
micah has joined #ruby
<panella32> It worked but I now I have another issue.
<micah> How do I test if a variable is true or false? I want to do an action if one of those states exist, but if its not set, then i dont want to do the action
<panella32> micah I think there would be a predicate method by default for all boolean variables. obj.foo? # true/false
donofrio has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
<micah> so will this work:
<micah> def foo(reason = nil)
<micah> if reason
<micah> puts "set"
<micah> end
<micah> end
<mooff> micah, that should indeed work
markong has joined #ruby
<mooff> you can also: puts "set" if reason
Sankalp has joined #ruby
<mooff> note that the only values which aren't considered truthy are nil and false
<mooff> = puts "wow, all true!" if [] and {} and 0 and ""
<ruby-eval> (eval):1: warning: string literal in condition
<ruby-eval> wow, all true!
<ruby-eval> => nil
<panella32> considering this erd (https://i.imgur.com/RpGtTRZ.png) could you tell me why the select part of the following query does not work as intended?
<panella32> Person.joins(movie_people: :role).select('people.name','roles.name').where(movie_people: {movie_id:4}).where.not(movie_people:{role_id:1})
<panella32> The output: https://imgur.com/a/o9xd9s8
<panella32> why isn't 'people.name' presented in the result?
<panella32> Maybe both selected columns have same name "name"?
reset has quit [Quit: reset]
<adam12> panella32: Likely.
<adam12> panella32: Maybe try `roles.name AS role_name`
<adam12> I don't know if that works in ActiveRecord.
szkl has joined #ruby
aindilis has quit [Ping timeout: 268 seconds]
aindilis has joined #ruby
tomtmym has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
otisolsen70 has quit [Quit: Leaving]
pounce has joined #ruby
meimei has joined #ruby
johnjaye has quit [Ping timeout: 268 seconds]
<panella32> That syntax seems to be valid because the equivalent sql command does include the alias you defined but the result is still not as expected. For some reason I could select either people.name or roles.name, not both at the same time..
John_Ivan has joined #ruby
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 256 seconds]
<panella32> adam12 the query actually works inside the app and both attributes are accessible via their alias names, although the appeared result on the the console (https://imgur.com/a/o9xd9s8) seems to be incomplete.
<panella32> So it solved and thank you, time to move on.
<adam12> panella32: You'd probably need to access it via the square bracket I think.
<adam12> person[:role_name] or something
<adam12> Oh, nevermind. Sounds like you solved it.
smp_ has joined #ruby
smp has quit [Ping timeout: 265 seconds]
smp_ is now known as smp
<panella32> Yes it solved. Both dot notation and square bracket notation are working here as expected, both inside the app or in the console. The only thing I still don't understand is why the result of the query (shown in the console) is incomplete! Even though they actually exist but the console tries its best to hide them unless I use dot/square bracket notations to access them manually. Please check out these 2 screenshots https://imgur.com/a/m3Yhn5Q
<panella32> The 2nd image seems to be deceptive, because the shown result is not as expected.I thought my query was wrong but it was correct, from now on I try not to count too much on the results that appear on the console!
szkl has quit [Quit: Connection closed for inactivity]
panella32 has quit [Ping timeout: 246 seconds]
<adam12> panella32: That's natural. ActiveRecord constructs a model by looking at the columns on the table. Your query is returning columns that don't exist on the table.
panella32 has joined #ruby
<panella32> considering an Arel like this ["John Smith":"Writer", "John Smith":"Director", ...] possible to "group_by" it in order to look like this: ["John Smith": "Writer,Director"]. Hard to group_by, isn't it?
nona has quit [Ping timeout: 250 seconds]
nona has joined #ruby
hightower4 has joined #ruby
kapil has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
kapil_ has joined #ruby
hightower3 has quit [Ping timeout: 265 seconds]
tomtmym has quit [Quit: Gone.]
_ht has joined #ruby
Mahfuj has joined #ruby
hightower4 has quit [Ping timeout: 240 seconds]
Mahfuj has quit [Remote host closed the connection]
Mahfuj has joined #ruby
Mahfuj has quit [Client Quit]
teclator has quit [Ping timeout: 240 seconds]
<panella32> (solved)
panella32 has quit [Quit: Textual IRC Client: www.textualapp.com]
nona has quit [Ping timeout: 246 seconds]
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
lena64t has quit [Quit: WeeChat 4.0.0-dev]
stool has joined #ruby
darkism has joined #ruby
stool has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
Guest26nakilon has joined #ruby
delimited has joined #ruby
<Guest26nakilon> is it possible to know if Gemfile had github: "..."? can't find it in Gem.loaded_specs
<Guest26nakilon> oh, it's .source
markong has quit [Ping timeout: 248 seconds]
Guest26nakilon has quit [Quit: Client closed]
EvanR has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
delimited has quit [Quit: leaving]
shokohsc6 has joined #ruby
shokohsc has quit [Ping timeout: 250 seconds]
shokohsc6 is now known as shokohsc
panella32 has joined #ruby
kaivai has quit [Ping timeout: 265 seconds]
<panella32> in the views, <%= to_rgb(@movie.color,0.84) %> does not work but <%= to_rgb(#{@movie.color},0.84) %> does!
<panella32> Any idea why I have to do a string interpolation?
<panella32> the 1st syntax consider "movie.color" a nil but indeed it exists.
cek has joined #ruby
_ht has quit [Quit: _ht]
panella32 has quit [Ping timeout: 268 seconds]
johnjaye has joined #ruby
m_antis has quit [Quit: Leaving]
infinityfye has quit [Quit: Leaving]
r3m has quit [Quit: WeeChat 4.0.0-dev]
r3m has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
panella32 has joined #ruby
<panella32> Let me know please if you have any idea!
nona has joined #ruby
<weaksauc_> panella32 do you have context? is it in the middle of a string or somthing?
<weaksauc_> gist the context
<panella32> It's just a div as following, nothing really special or related is happing around it. Just a flat html div.
<panella32> <div style="background-image: linear-gradient(to right, <%=hex_color_to_rgba("#{@movie.gradient_color}",0.84) %>, white)
<panella32> (it's another div but with same issue)
tomtmym has quit [Quit: Gone.]
markong has joined #ruby
nona has quit [Quit: WeeChat 3.8]
panella32 has quit [Ping timeout: 265 seconds]
panella32 has joined #ruby
cek has quit [Quit: Connection closed for inactivity]
kaivai has joined #ruby
donofrio has joined #ruby
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
panella32 has quit [Ping timeout: 250 seconds]
markong has quit [Ping timeout: 250 seconds]
Perflosopher has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]