Torrone

Activity Graph

Page 1 of 3 | Next »

2018-05-23

[08:38:17] Torrone: has joined #RubyOnRails
[08:40:19] Torrone: Hello, I need to block some e-mail addresses to register on my rails app, such as 'postmaster' or 'admin' etc... Is there a clean way to do this with Rails?
[08:44:56] Torrone: dminuoso, let me re-phrase it: I need a list of email 'names' (*name*@host.dom) to be blocked from being used for creating new users, is this even a thing? How do I archive that without it being a mess? Is there a gem that does this that you know of?
[08:53:41] Torrone: jarnalyrkar, what do you mean?
[08:54:32] Torrone: tbuehlmann, validates_exclusion_of seems to come close but I don't know if passing an array of regex makes sense
[09:02:00] Torrone: dminuoso, compliance with mail delivery services guidelines
[10:40:05] Torrone: Quit: Leaving

2018-05-16

[15:11:24] Torrone: has joined #RubyOnRails
[15:13:33] Torrone: Hello, I'm designing a simple api for my rails app. Most examples I've seen make use of namespace resource statements for routes but I don't need/want to do that, all I want to do is to expose some named endpoints for actions I'm gonna call from the client side. How do I declare namespaces routes so that they only support the few actions I need?
[15:14:50] Torrone: for example I have my Api::v1::TriggersController#trigger_action_1 action and I need a route for that
[15:31:06] Torrone: ok I've figured it out
[17:34:01] Torrone: Quit: Leaving

2018-05-14

[08:58:33] Torrone: has joined #RubyOnRails
[09:00:02] Torrone: hello, I'm trying to add a new date time column through a migration with a default value, code: https://hastebin.com/huretasomu.rb this gives me a sql error: [...] right syntax to use near '-06-02 12:00:00' at line 1. What am I doing wrong?
[09:07:02] Torrone: tbuehlmann, I tried, didn't work
[09:07:19] Torrone: solved just now, needed to be: "\"2018-06-02 12:00:00\""
[09:29:13] Torrone: Quit: Leaving

2018-05-09

[13:34:35] Torrone: has joined #RubyOnRails
[13:36:07] Torrone: Hello, when opening the public/assets folder in my production environment I've noticed that rails keeps old versions of assets on disk, I have at least 50 versions of my css files, is this normal behavior? have you dealt with this before?
[13:38:02] Torrone: Disconnected by services
[13:38:37] Torrone: has joined #RubyOnRails
[13:39:14] Torrone: ellcs, yes, I have many versions of the same files with different digests
[15:20:44] Torrone: I'm getting this error while deploying with capistrano: can't find executable webpack for gem webpacker (Gem::Exception). I'm sure that 'yarn install' is being ran on the server and I've made sure that packages are updated, what else should I check?
[16:09:04] Torrone: nzst, yes, I saw that, solved it for me
[16:09:50] Torrone: though it would be nice if they had it done automatically
[16:45:09] Torrone: Quit: This computer has gone to sleep

2018-05-07

[09:08:50] Torrone: has joined #RubyOnRails
[09:09:21] Torrone: Hello, is there any detailed tutorial/docs for capistrano's parallel deployment that you know of?
[12:00:28] Torrone: Quit: Leaving
[16:00:17] Torrone: has joined #RubyOnRails
[16:01:56] Torrone: Hello, I'm having an issue with my capistrano deployment, I'm setting :rvm_custom_path to '~/.rvm/bin/rvm' but when the deploy task runs the bundler I get: bash: /bin/rvm: No such file or directory (I'm not going to symlink because this looks related to some other issues). thoughts?
[16:02:58] Torrone: Inside, indeed, just joined
[16:03:09] Torrone: I'll post there as well
[16:03:14] Torrone: it won't hurt
[16:06:50] Torrone: Inside, it looks ok until bundle:install
[16:07:34] Torrone: I was checking that cap was using the correct shell and user but it looks ok too
[16:46:35] Torrone: Quit: This computer has gone to sleep

2018-04-30

[09:37:48] Torrone: has joined #RubyOnRails
[09:41:32] Torrone: at the beginning of the ruby script
[09:41:32] Torrone: Hello, not sure if it's the right place to ask: I have a script in ruby that's supposed to run on an ubuntu server. I've made a bash script that launches the ruby script, very basic, and I've put an execution call in /etc/crontab. Whenever I run the bash script from the terminal, everything works fine. When I let crontab run it, however, I get an error (it seems to be missing a gem). What's going on? I've put the ruby version explicitly
[09:41:49] Torrone: (it's the same as when I type which ruby))
[09:43:56] Torrone: what's going wrong here?
[09:59:45] Torrone: has left #RubyOnRails: ("Leaving")

2018-04-27

[11:12:07] Torrone: has joined #RubyOnRails
[11:14:57] Torrone: information on how capistrano generates this file
[11:14:57] Torrone: Hello, I'm setting up an additional environment for my capistrano deploy, during this process I ran cap {ENV} puma:config and uploaded a new puma conf, I had everything set up so that puma created its socket file in "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" but the new puma conf has '/var/www/#{fetch(:application)}/shared/tmp/sockets/#{fetch(:application)}-puma.sock'. How do I change the latter? couldn't find
[11:17:06] Torrone: #{shared_path} is /home/<user>/apps/<application>/shared/
[12:42:50] Torrone: capistrano generated puma conf anyone?
[14:09:43] Torrone: Quit: This computer has gone to sleep

2018-04-18

[15:58:22] Torrone: has joined #RubyOnRails
[16:00:31] Torrone: Hello, I'm running a task that sends a couple of e-mails, in one of these I have a route helper and I'm getting an error. in application.rb puts config.action_mailer.default_url_options ====> {:host=>"http://0.0.0.0:3000"}, later, "ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true". What am I doing wrong?
[16:26:41] Torrone: Quit: This computer has gone to sleep

2018-04-17

[07:18:34] Torrone: has joined #RubyOnRails
[07:20:22] Torrone: Hello, I have a rails application (rails 5), which is hosted on www.example.com and 3 small websites in wordpress, it would be nice to have them be subpaths of my site such as www.example.com/site1. Is there any standard way of doing it? Can Rails help me in this?
[07:23:06] Torrone: thanks dminuoso for pointing me in the right direction
[07:23:16] Torrone: I always trust dminuoso
[07:23:32] Torrone: you're a good guy
[07:44:26] Torrone: Quit: This computer has gone to sleep
[17:52:20] Torrone: has joined #RubyOnRails
[17:54:51] Torrone: Hello, I'm trying to set up a wordpress blog as a subdirectory of my rails app (blog.example.com => www.example.com/blog). The way I would normally do this is adding a proxy pass to my nginx configuration but I have conflicting routes and not having a /blog route defined sends me elsewhere depending on the url I'm on in the blog
[17:55:18] Torrone: I tried following this https://hackernoon.com/wordpress-inside-a-ruby-on-rails-app-c324fbf39ad8 but stopped working after refreshing my permalinks
[17:55:48] Torrone: do you think I can make it with the nginx proxy pass + routes? If so, how do I go about it?
[17:59:04] Torrone: in short, I need to tell Rails to keep routes starting with /blog within the scope of the proxy pass
[18:47:33] Torrone: Quit: This computer has gone to sleep

2018-04-10

[11:15:35] Torrone: has joined #RubyOnRails
[11:15:38] Torrone: hello, I've added capistrano3-autoscaling-deploy to my capfile and now deploy fails at asset precompilation: it looks for a [release_path]/yarn.js and it doesn't find it, saying yarn is not installed, but it is, what can I do about this?
[11:32:56] Torrone: Quit: Leaving

2018-04-06

[16:41:48] Torrone: has joined #RubyOnRails
[16:46:24] Torrone: hello, I'm trying to use http://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-ignored_columns-3D but it's not working for me, the columns don't get ignored, has this happened to you?
[16:51:11] Torrone: thomasfedb, basically I wrote a concern that I use a lot that has a method 'average_rating', since I'm working on a long going project, one of the models that includes the concern has a column named 'average_rating'
[16:51:24] Torrone: and I didn't know!
[16:52:03] Torrone: so what I'm trying to do is to ignore that column since it's not really used anymore and trying not to delete it for safety
[16:52:40] Torrone: the error occurs whenever I call the method 'average_rating'
[16:53:57] Torrone: that's because I check if has_attribute?(:average_rating) and it still returns true
[16:54:07] Torrone: even if I don't fetch the column
[16:55:24] Torrone: but actually I found that if I use ignored_columns combined with commenting out the line with attribute :average_rating I get the correct value
[16:55:37] Torrone: so thank you very much for letting me explain this to you
[17:05:56] Torrone: has left #RubyOnRails: ("Leaving")

2018-03-28

[10:33:03] Torrone: has joined #RubyOnRails
[10:35:51] Torrone: hello, I have a user model that has a paperclip attachment, I use paperclip avatar.url(size) to get it, the user model also has a field called image_url that contains an external image url. I want to override the avatar.url method for the user model so that I can get the image_url field if no attachment is present. Do you think that's possibile without changing all the method calls with another method name?
[10:54:50] Torrone: nvm did it
[10:54:53] Torrone: has left #RubyOnRails: ("Leaving")

2018-03-26

[10:30:11] Torrone: has joined #RubyOnRails
[10:32:39] Torrone: hello, I'm displaying a show action for a store, I need its assistants profiles, the store has_many users which have an assistant profile, so I'm defining a has_many with a scope:
[10:32:42] Torrone: has_many :assistants, -> { active.where('id IS NOT NULL') }, :through => :users, :source => 'assistant_profile', :class_name => 'AssistantProfile'
[10:33:10] Torrone: for some reason, :assistants sometimes contain AssistantProfile and sometimes User records
[10:33:28] Torrone: how do I make sure it only contains AssistantProfile that are not nil?
[11:12:44] Torrone: Quit: This computer has gone to sleep
[11:47:36] Torrone: has joined #RubyOnRails
[13:14:36] Torrone: hello, I'm displaying a show action for a store, I need its assistants profiles, the store has_many users which have an assistant profile, so I'm defining a has_many with a scope:
[13:14:44] Torrone: has_many :assistants, -> { active.where('id IS NOT NULL') }, :through => :users, :source => 'assistant_profile', :class_name => 'AssistantProfile'
[13:14:53] Torrone: for some reason, :assistants sometimes contain AssistantProfile and sometimes User records
[13:14:59] Torrone: how do I make sure it only contains AssistantProfile that are not nil?
[14:01:03] Torrone: has left #RubyOnRails: ("Leaving")

2018-03-22

[14:39:11] Torrone: has joined #RubyOnRails
[14:46:54] Torrone: hello, I have some parts of my application that I load via GET with javascript, I'd like to make them unaccessible by themselves. I was thinking of making use of 'X-CSRF-Token' header but it doesn't seem to work. Thoughts?
[14:48:29] Torrone: dminuoso, hello
[14:48:55] Torrone: I don't want anybody to access them by typing their address in the browser window
[14:49:26] Torrone: because they should only work within the context of the application
[14:49:37] Torrone: i.e. if requested with javascript
[14:50:18] Torrone: yeah but pp request.headers['X-CSRF-Token'] => nil
[14:50:29] Torrone: I am including it in my request
[14:51:40] Torrone: request.headers['HTTP_X_CSRF_TOKEN'] is working
[14:52:02] Torrone: I'd like to use the built-in methods tho, like :verify_authenticity_token
[14:52:15] Torrone: or protect_from forgery
[14:55:10] Torrone: fryguy, thank you for pointing it out
[14:56:19] Torrone: dminuoso, I'm settling for just checking the existence of a request.headers['HTTP_X_CSRF_TOKEN']
[14:56:26] Torrone: thank you for your help
[15:02:20] Torrone: has left #RubyOnRails: ("Leaving")

2018-03-15

[11:08:19] Torrone: has joined #RubyOnRails
[11:10:31] Torrone: Hello, I have a js.erb file that loads data in json format and I tried to wrap the data loading in a <% cache %> block. Rails does not allow me to do it, I want to make sure that the database isn't hit every time I request that file in production. Do I need to worry about that? Can I trust Rails to pre-compile it as long as it is in the assets pipeline?
[11:11:14] Torrone: Or do I have to do something in order to keep it static?
[11:27:17] Torrone: Disconnected by services
[11:27:52] Torrone: has joined #RubyOnRails
[11:28:01] Torrone: I apologize, had connection issues
[11:28:16] Torrone: my question is:
[11:28:18] Torrone: Hello, I have a js.erb file that loads data in json format and I tried to wrap the data loading in a <% cache %> block. Rails does not allow me to do it, I want to make sure that the database isn't hit every time I request that file in production. Do I need to worry about that? Can I trust Rails to pre-compile it as long as it is in the assets pipeline?
[11:28:25] Torrone: Or do I have to do something in order to keep it static?
[11:29:01] Torrone: Disconnected by services
[11:29:52] Torrone: has joined #RubyOnRails
[12:21:19] Torrone: Quit: This computer has gone to sleep
[13:12:50] Torrone: has joined #RubyOnRails
[17:44:23] Torrone: Quit: This computer has gone to sleep

2018-03-12

[11:20:06] Torrone: has joined #RubyOnRails
[11:21:29] Torrone: hello, I'm trying to follow the configuration for this gem https://github.com/capistrano-plugins/capistrano-secrets-yml but when running 'bundle exec cap production setup' the task uses my local machine's username to log in to the server and throws an error, how do I change the user that logs in?
[11:36:01] Torrone: figured it out... had to monkey-patch the 'setup' task
[11:55:54] Torrone: Quit: Leaving

2018-03-09

[13:03:32] Torrone: has joined #RubyOnRails
[13:04:38] Torrone: hello, I'm using a content_for block in a partial and yielding in the footer, it works... sometimes, at the moment it's not working, what do I do about that?
[13:19:07] Torrone: should I see content_for blocks in the console?
[13:26:31] Torrone: fox_mulder_cp, figured it out, I just did a merge and someone had the brilliant idea to cache the whole footer so I was getting weird outcomes
[14:24:12] Torrone: Quit: Leaving

2018-03-05

[17:03:04] Torrone: has joined #RubyOnRails
[17:03:09] Torrone: Hello. I have joint two of my categories into one by migrating my articles. Now I'm tring to redirect requests to the new category in order to be able to remove them seo-safe, this is not working for some reason: https://gist.github.com/Torrone5000/a734dd033884c65cf1c8c345d9c5bf73
[17:04:09] Torrone: ( the way it's not working is that it's not redirecting but reaching the old categories )
[17:54:33] Torrone: nvm it was a typo in my taxonomy name
[17:54:39] Torrone: Quit: Leaving

2018-02-19

[11:53:09] Torrone: has joined #RubyOnRails
[11:55:09] Torrone: hello, I'm writing a helper method that outputs the given block within the context of a html structure. I'm trying wo avoid using a partial bc I think it wouldn't be good for performance. I'm using this code https://gist.github.com/Torrone5000/fc6f0f785b0f7956c744a2f85d9ae53a but I'm having trouble with nested tags that don't get printed on the page, what am I doing wrong?
[13:18:06] Torrone: Quit: Leaving

2018-01-24

[10:46:55] Torrone: has joined #RubyOnRails
[10:48:17] Torrone: Hello, I have a question about rspec that I found hard to answer by googling: Is there a way to test that a model has a method and that the said method is implemented on the class and not in an included module?
[17:43:25] Torrone: Quit: This computer has gone to sleep

2018-01-23

[10:00:26] Torrone: has joined #RubyOnRails
[10:02:26] Torrone: Hello, this spec is working https://gist.github.com/Torrone5000/7a90a905aa43d2cc9728ef54a86c22d6 . However, I'm struggling to find a way to make it DRY, I obviously don't want to repeat the user's declaration but if I call "it_behaves_like 'check delivery', :create, { :user => user }, user['email']" the variables don't get to the shred example. How do I crack this? Thanks a bunch
[17:44:30] Torrone: Quit: This computer has gone to sleep

2018-01-18

[14:38:24] Torrone: has joined #RubyOnRails
[20:53:56] Torrone: Quit: Leaving

2018-01-17

[10:17:34] Torrone: has joined #RubyOnRails
[10:19:38] Torrone: hello, let's supposed I need the id of one record. I just need the id, I don't care about the other fields. How could I query the db without selecting all fields? I've tried with .find(...).pluck(:id) or .select(:id) but that doesn't seem to work
[10:23:44] Torrone: dminuoso, indeed, I thought that would work :-D
[10:25:29] Torrone: yeah, that kinda serves the purpose but I think I need to .limit(1) as well to be sure to get an int and not an array
[10:27:00] Torrone: well, I'm not find()ing by id, that's why I need to make sure of the uniqueness
[10:29:29] Torrone: profiler is telling me that it's fetching record's translations, which I don't need, I'm using globailize
[10:32:04] Torrone: tbuehlmann, it works, as I had tried before, I had the feeling that .select() didn't work with find()
[10:51:13] Torrone: morfin60, thanks, it does if you query by translated fields for some reason
[11:28:37] Torrone: Quit: Leaving

2018-01-12

[08:32:21] Torrone: has joined #RubyOnRails
[08:33:52] Torrone: Hello, I'm trying to test a mail delivery within a fork process triggered by a post request in rspec, I have the post request within a before block. What's the proper way to do it?
[10:38:00] Torrone: Quit: This computer has gone to sleep

2018-01-11

[15:08:26] Torrone: has joined #RubyOnRails
[15:12:18] Torrone: Client Quit

2018-01-10

[15:17:19] Torrone: has joined #ruby
[15:19:17] Torrone: Client Quit

2018-01-04

[11:32:46] Torrone: has joined #RubyOnRails
[11:36:35] Torrone: hello guys, struggling pretty hard with Rspec ( is this the right place to ask? ) I'm trying to test a user registration but I'm getting errors from Rails complaining that Mysql is not connected but in the logs the relevant code is shown to be executed, can you check please? I'll show you my code and results: https://gist.github.com/Torrone5000/bfba280f66b6add506ac106c6781979a
[11:38:12] Torrone: dminuoso, spec_helper is included in rails_helper
[11:40:29] Torrone: yeah, got it, I'm updating :-)
[11:41:12] Torrone: https://gist.github.com/Torrone5000/bfba280f66b6add506ac106c6781979a
[11:42:33] Torrone: has worked fine so far
[11:43:41] Torrone: hm, I'll try to exclude it
[11:44:51] Torrone: good call but it still gives the error
[11:45:46] Torrone: the logs show that the user is being created btw, as well as the email being sent and request redirected
[12:08:40] Torrone: in fact if I run the code within a single 'it' statement and test everything at once the test passes, but I don't want that, I need to test everything independently
[12:43:11] Torrone: Quit: This computer has gone to sleep
[13:09:56] Torrone: has joined #RubyOnRails
[13:25:19] Torrone: Quit: This computer has gone to sleep

2018-01-03

[09:46:52] Torrone: has joined #RubyOnRails
[09:49:12] Torrone: Hello guys, I'm using devise in my rails 5 app and I can't log out. I made sure that I'm sending a DELETE request and the server-side logout action seems to be running but when I refresh the page the current_user is still present. I can log out by deleting cookies and session from the browser. What should I look into next? Thank yo
[12:25:05] Torrone: Hey dminuoso :-) I'm using cookie_store
[12:25:42] Torrone: here https://hastebin.com/zucamijedu.vbs
[12:27:14] Torrone: dminuoso, are you talking about the CSRF?
[12:28:17] Torrone: how do I include it into the delete request?
[12:29:19] Torrone: dminuoso, I have strong evidence that the code relevant to the devise logout is being ran
[12:32:58] Torrone: dminuoso: It returns an empty response, which is expected behavior as documented in devise's code
[12:34:06] Torrone: $.ajax({url:'/users/sign_out', type: 'DELETE', success : function(data) { console.log(data); } })
[12:35:08] Torrone: empty response documented here https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb#L76
[12:36:02] Torrone: though it's for GET requests
[12:40:09] Torrone: dminuoso, you were right though, it was about the authenticity token, what looked weird to me is that the relevant code was reached
[12:41:43] Torrone: that's what it does
[12:41:46] Torrone: Completed 204 No Content in 7910ms (ActiveRecord: 18.3ms)
[12:41:57] Torrone: guess I'd better start profiling
[13:12:14] Torrone: I'm using 'devise', '~> 4.3'
[13:12:25] Torrone: it works now
[13:12:33] Torrone: it was the auth token
[14:28:16] Torrone: Ping timeout: 248 seconds

2018-01-02

[16:34:46] Torrone: has joined #RubyOnRails
[16:38:50] Torrone: o you know how to do this? Thanks :-)
[16:38:50] Torrone: hello, I'm working with the latest version of rails and puma in development environment. As of lately, my dev server started becoming very slow ( and unnerving ) :~) . In the rails logs I read 'Started GET/POST/ETC' and it stays like that for a while, that's where the slowness happens. I was wondering if I can see what it's doing there because maybe I can make it skip something that is not absolutely necessary and is ran there. D
[17:01:40] Torrone: Quit: This computer has gone to sleep
[17:03:14] Torrone: has joined #RubyOnRails
[17:52:24] Torrone: Quit: This computer has gone to sleep

2017-12-29

[14:36:03] Torrone: has joined #RubyOnRails
[14:45:34] Torrone: b.com/Torrone5000/7e5d958370100864e1503a6c5069b5e2
[14:45:34] Torrone: Hello, I'm trying to set up a test environment for a medium sized app that never had tests to begin with (it's not my fault, I just started working with it). I'm trying to seed a test database with records that I know won't change, I've used https://github.com/rroblak/seed_dump to generate a seeds.rb with the records I need but when I run rake db:seed I get an error on create!, here's the error and seeds.rb: https://gist.githu
[14:45:38] Torrone: https://gist.github.com/Torrone5000/7e5d958370100864e1503a6c5069b5e2
[14:51:52] Torrone: nvm found the problem, thanks
[14:51:54] Torrone: has left #RubyOnRails: ("Sto andando via")

2017-12-15

[10:27:33] Torrone: has joined #RubyOnRails
[10:28:33] Torrone: Hello guys, asking for advice: how do I go about writing tests for a medium-sized legacy application without it being a pain?
[10:31:46] Torrone: that's if anyone that's online has any experience on that
[10:33:54] Torrone: dminuoso, I know that's cumbersome, I've started working on this app for which no one has ever written tests for
[10:34:19] Torrone: it has at least 50 models and it's fairly complex
[10:36:17] Torrone: dminuoso, the job I've been tasked with is just to write those tests, I'm having nightmares about spending a month doing tests alone
[10:36:27] Torrone: that's if a month is even enough
[10:37:17] Torrone: basically I need to check that none of the views fails
[10:37:53] Torrone: plus a few tests on user interactions
[10:39:48] Torrone: I was thinking that it might be easier to write a gem that generates those automatically, since there is none around as far as I know
[10:40:21] Torrone: I was looking into https://github.com/jedld/pretentious but it doesn't look like it does what I need
[10:41:56] Torrone: I'm afraid that I cannot bring myself to go through every single function in the code and write tests for each one without losing my mind midway :D
[10:48:25] Torrone: dminuoso, the requirement is to check that 'everything works'
[10:51:55] Torrone: dminuoso, basically that none of the supported views returns a server error under any circumstance
[10:53:07] Torrone: dminuoso, the idea is that if the views work, the controllers under those views work
[10:53:21] Torrone: for most of the writes, we can check bugs as they present
[11:30:11] Torrone: Quit: Sto andando via

2017-12-14

[09:46:01] Torrone: has joined #RubyOnRails
[09:50:30] Torrone: Hello, I'm working on a medium-size application that doesn't have any tests. My initial goal is to check that all my views work. Is there any tool that helps me generate tests for my app?
[14:06:08] Torrone: Quit: This computer has gone to sleep

2017-12-13

[15:54:48] Torrone: has joined #RubyOnRails
[15:58:40] Torrone: hello, I have this module: https://gist.github.com/Torrone5000/8a56e5dc5fe9bbe5f8b2f43d416d353a I want #{self.class.name} to return base class name, getting 'Class' instead. What am I doing wrong? ( base.class.name gives same result)
[16:10:15] Torrone: tcopeland, don't know about that, solved with #{base.name}, thanks
[16:23:24] Torrone: has left #RubyOnRails: ("Sto andando via")

2017-12-04

[10:34:02] Torrone: has joined #RubyOnRails
[10:35:11] Torrone: Hello, is there any way I can set custom getters for association fields? For example, I have models Question, Answer: can I override the way rails gets question.answer.title? Thanks
[10:38:20] Torrone: marahin: yes, but I want the method to fire only when the class instance is called as an association
[10:39:06] Torrone: if I call answer.title or question.answer.title I want two different responses
[10:44:59] Torrone: marahin, I'll explain my need: I'm optimizing my listing queries, I'm using .join and .select and I want each question to be one row, so that when I select a question, I get a field named 'answer_title' that I can get without hitting the db again. Of course this isn't gonna be very useful when I only call 'answer.title' by itself but can save me plenty of sql time if i call question.answer.title
[11:21:56] Torrone: Quit: Sto andando via

2017-11-28

[15:39:40] Torrone: just calling @variable inside the view
[15:39:50] Torrone: (or anywhere else for that matter)
[15:51:13] Torrone: ok, I found the problem: it was actually a method defined in the associated class
[15:51:17] Torrone: has left #RubyOnRails: ("Sto andando via")
[18:23:12] Torrone: has joined #RubyOnRails
[18:25:41] Torrone: Hello, I'm experimenting with active record .select method. I've noticed that when using .eager_load, the resulting SQL has a SELECT statement that includes the columns that I listed in .select first, then a lot of other fields that I haven't listed and I don't need. what's happening? what am I doing wrong?
[19:16:49] Torrone: Quit: Sto andando via