Moeh

Activity Graph

Page 1 of 3 | Next »

2018-12-12

[16:18:14] Moeh: has joined #RubyOnRails
[16:18:28] Moeh: has joined #ruby
[16:20:03] Moeh: Hi! In my ruby app I'd like to create a class called "File" which should not 'override' the default Ruby File class. Is there a way to access the default Ruby File class within my app using something like Ruby::File (which doesn't work). Or inherit from the default Ruby File class using something like "class File < File # inherits from Ruby File class" (which also doesn't work).
[16:30:05] Moeh: I am using https://github.com/davetron5000/gli to build a CLI and it looks like it already wraps everything in a "class App" which then loads modules. But it looks like inside of the class definition it'd refer to itself. So in: "module MyModule class File File.basename() end end" File actually refers to itself (and throws a method undefined error). However, when I use "::File" inside it refers to the stdlib and works.
[16:30:34] Moeh: Yes, thanks, makes sense! I'll use "::File" inside of the class definition and then everything works.
[16:32:00] Moeh: Outside of the class definition the names are correctly scoped, so if I do "File" outside of the definition I get the stdlib File and MyModule::File returns my own class as expected. Perfect, thanks a lot!
[17:22:53] Moeh: phaul: Great, thanks so much!
[18:57:09] Moeh: Quit: Textual IRC Client: www.textualapp.com

2018-12-02

[10:27:57] Moeh: has joined #RubyOnRails
[13:08:49] Moeh: Read error: Connection reset by peer

2018-11-20

[12:39:25] Moeh: has joined #RubyOnRails
[12:58:47] Moeh: Quit: Textual IRC Client: www.textualapp.com

2018-06-05

[11:34:38] Moeh: has joined #RubyOnRails
[11:40:02] Moeh: Quit: Textual IRC Client: www.textualapp.com

2017-09-11

[16:45:51] Moeh: has joined #RubyOnRails
[17:38:08] Moeh: Ping timeout: 240 seconds
[18:23:36] Moeh: has joined #RubyOnRails
[19:00:11] Moeh: Quit: Textual IRC Client: www.textualapp.com

2017-07-30

[14:05:39] Moeh: has joined #RubyOnRails
[14:18:48] Moeh: Ping timeout: 260 seconds

2017-07-26

[14:15:38] Moeh: has joined #RubyOnRails
[16:01:06] Moeh: Read error: Connection reset by peer

2017-07-08

[15:27:09] Moeh: has joined #RubyOnRails
[16:33:57] Moeh: Ping timeout: 240 seconds

2017-07-05

[22:13:36] Moeh: has joined #RubyOnRails
[22:52:18] Moeh: Ping timeout: 255 seconds

2017-07-03

[21:30:10] Moeh: has joined #RubyOnRails
[21:45:03] Moeh: Quit: Textual IRC Client: www.textualapp.com

2017-07-01

[21:27:01] Moeh: has joined #RubyOnRails
[23:38:50] Moeh: Quit: Textual IRC Client: www.textualapp.com

2017-06-29

[10:33:46] Moeh: has joined #RubyOnRails
[11:20:22] Moeh: Ping timeout: 260 seconds
[11:27:20] Moeh: has joined #RubyOnRails
[12:19:52] Moeh: Ping timeout: 260 seconds

2017-05-16

[10:38:45] Moeh: has joined #RubyOnRails
[10:39:03] Moeh: Is there a way to have a readonly model that can be destroyed in rails 5?
[10:41:01] Moeh: At the moment we have "def readonly? new_record? ? false : true end" in the model, so what would be the best way to make it destroyable?
[10:41:56] Moeh: If I call destroy on it, I get the error: ActiveRecord::ReadOnlyRecord: UserActivity is marked as readonly
[10:42:24] Moeh: Ahja, can be written as "def readonly? !new_record end" right?
[10:42:50] Moeh: makes sense, yes
[10:46:55] Moeh: matthewd: With this code I still get the exception
[10:50:03] Moeh: Well, delete is not really the problem, as it ignores "readonly?" > http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-delete
[10:52:49] Moeh: http://stackoverflow.com/questions/35348935/activerecord-readonly-true-is-preventing-destroy haven't tried it but according to this just returning true doesn't work
[10:54:41] Moeh: Thanks for all the suggestions, we will just remove the readonly logic, is it not critical :)
[14:11:29] Moeh: Ping timeout: 272 seconds

2016-07-31

[16:38:17] Moeh: has joined #RubyOnRails
[17:11:16] Moeh: Ping timeout: 258 seconds

2016-07-25

[09:34:47] Moeh: has joined #RubyOnRails
[09:36:21] Moeh: Client Quit

2016-07-20

[00:11:06] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-07-19

[22:47:02] Moeh: has joined #RubyOnRails

2016-07-16

[21:34:43] Moeh: has joined #RubyOnRails
[22:42:24] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-07-15

[19:21:36] Moeh: has joined #RubyOnRails
[19:23:51] Moeh: can see that @user.errors is filled by rails. Can someone give me a pointer what I am doing wrong?
[19:23:51] Moeh: Hey guys, I am trying to render my errors as JSONAPI compliant object like described here: https://github.com/rails-api/active_model_serializers/pull/1004 However, when I use "render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer" I get the error "NoMethodError (undefined method `errors' for #<ActiveModel::Errors:0x007f9664c23858>)". But when I use the debugger, I
[19:28:34] Moeh: Okay, this is stupid. The line has to be "render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer" instead of "render json: @user.errors, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer"
[22:44:27] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-07-11

[19:09:43] Moeh: has joined #RubyOnRails
[19:17:50] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-07-10

[00:33:23] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-07-09

[19:26:24] Moeh: has joined #RubyOnRails
[19:31:07] Moeh: Hey guys, is there a way to get a erb file in a controller as string? (would like to convert to PDF)
[19:31:22] Moeh: I tried using render:, but rails complains that I cannot use multiple renders in one action

2016-07-08

[12:46:29] Moeh: has joined #RubyOnRails
[12:47:17] Moeh: Hey guys, we are using https://github.com/rubysherpas/paranoia and it seems that the validation "validates :email, presence: true, allow_blank: false" in the User model is not enforced. So I create a user with email "asd@asd.com", soft delete it, and create another user with email "asd@asd.com" without problems.
[12:47:36] Moeh: Is there a way to enforce uniqueness also for users that have "deleted_at" filled?
[12:50:43] Moeh: workmad3: Sorry, copy past error, this is the actual line: "validates :email, presence: true, allow_blank: false, uniqueness: true"
[12:56:54] Moeh: We do have a uniqueness constraint in the db, but we would rather like to have rails catch the error
[12:57:18] Moeh: Will try the conditions
[12:59:18] Moeh: How would the entire line look like with the 'conditions' part? I somehow can't find examples for using conditions
[13:03:43] Moeh: workmad3: validates :email, presence: true, allow_blank: false, uniqueness: { conditions: ->{ unscoped }} - this seems to work, is it correct? Because I don't see the "true" anywhere
[13:04:46] Moeh: Okay, using this line it fails for every email address, so there is an error
[14:31:37] Moeh: Read error: Connection reset by peer

2016-07-01

[12:55:53] Moeh: has joined #RubyOnRails
[12:56:34] Moeh: Is there a
[12:56:50] Moeh: better / more best practice way to write this query: Organization.find_by(id: @session.organization_id).dashboards.where("published = true OR user_id = #{@session.user_id}")
[12:58:27] Moeh: Scient: What is the advantage if structuring the query like this?
[13:01:38] Moeh: Scient: Ok, to implement this I create an "organization" method in the session model that finds the organization based on session.organization_id and a scope like "scope :published, -> { where(published: true) }" in the dashboard model?
[15:59:48] Moeh: Quit: My Mac has gone to sleep. ZZZzzz…
[16:58:44] Moeh: has joined #RubyOnRails
[17:21:25] Moeh: Max SendQ exceeded

2016-06-29

[13:45:33] Moeh: has joined #RubyOnRails
[13:47:08] Moeh: Hey guys, I updated from rails 5 beta2 to rc2 today and it seems that skip_before_action :authenticate! in my SessionsController does not work anymore. In beta2 the action was skipped (as intended, because the user is not logged in before login), now it seems that the action is invoked.
[13:57:27] Moeh: It seems that the cause of the problems is that parameters are filtered out. If I put a breakpoint in the action I can see that params only contains controller and action but none of the actual parameters. Even though they are included in the request.
[13:58:22] Moeh: Sure, will create a gist
[14:00:59] Moeh: https://gist.github.com/Maarius/780a67ff21054600123aa2c93e924037 I hope this is enough to understand my problem
[14:05:24] Moeh: http://imgur.com/zl6T910
[14:05:31] Moeh: Here is the request as seen in the browser
[14:08:05] Moeh: The weird thing is that this exact code works in rails 5 beta 1. Just verified by downgrading.
[14:09:53] Moeh: I put "gem 'rails', '5.0.0.rc2'" in my Gemfile and did 'bundle update'.
[14:10:02] Moeh: idk if that means I am on edge?
[14:10:43] Moeh: Then no, not for rails itself. For some of the gems we do
[14:11:42] Moeh: dminuoso: You meant me? :)
[14:15:02] Moeh: dminuoso: Just updated the gist
[14:15:06] Moeh: Thanks for your help!
[14:18:00] Moeh: But how is it possible that it works fine with rails 5 beta 2 and not in rc2? Any idea where I can start looking for the cause of this?
[14:18:11] Moeh: Sorry, beta 1
[14:20:22] Moeh: sevenseacat: Well, if I check out the previous Gemfile, run bundle and change nothing else, the code runs absolutely fine.
[14:25:23] Moeh: sevenseacat: This is the log for rails 5.0.0.beta1: https://gist.github.com/Maarius/780a67ff21054600123aa2c93e924037#file-rails-5-0-0-beta1
[14:26:29] Moeh: This line is interesting: 5.0.0.beta1 Processing by UsersController#forgot_password as JSON 5.0.0.rc2: Processing by UsersController#forgot_password as application/vnd.api+json
[14:28:12] Moeh: Same as before: {"data":{"attributes":{"email":"moeh@company.com"}}}
[14:28:33] Moeh: Or do you want to see the screen with the headers?
[14:32:47] Moeh: http://imgur.com/1pjPOsq
[14:36:56] Moeh: sevenseacat: I think I found the issue. See https://gist.github.com/Maarius/780a67ff21054600123aa2c93e924037#file-mime_types-rb This piece of code we had commented out for 5.0.0.beta1 because otherwise the parameters were filtered out. Now I uncommented it and tried again with 5.0.0.rc2 and now the params are not filtered out anymore and the code works fine again.
[14:37:36] Moeh: Puuh, that was not really obvious.. But I guess has to be expected when you use beta versions :/ Anyway, thanks a lot for taking the time and helping out.
[18:03:15] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-28

[10:48:45] Moeh: has joined #RubyOnRails
[10:49:13] Moeh: Can anyone tell me if pundit / CanCanCommunity is compatible with Rails 5?
[19:12:43] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-27

[10:45:40] Moeh: has joined #RubyOnRails
[10:48:05] Moeh: Hey guys, I am using the braintree gem and unfortunately some of the objects are not serializable (see: https://github.com/braintree/braintree_ruby/issues/50). Braintree-rails seems to be overkill for us as well, therefore I would like to implement the recommendation from this comment: https://github.com/braintree/braintree_ruby/issues/50#issuecomment-227195012 So where do I have to override the Braintree::Customer model to be able to serialize it?
[20:18:46] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-17

[15:35:32] Moeh: has joined #RubyOnRails
[16:52:52] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-15

[14:56:19] Moeh: has joined #RubyOnRails
[17:14:31] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-10

[10:26:46] Moeh: has joined #RubyOnRails
[13:17:59] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-07

[09:29:42] Moeh: has joined #RubyOnRails
[09:31:08] Moeh: Client Quit
[18:09:42] Moeh: has joined #RubyOnRails
[20:22:15] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-06

[17:44:38] Moeh: has joined #RubyOnRails
[18:20:45] Moeh: Quit: My Mac has gone to sleep. ZZZzzz…

2016-06-03

[11:07:47] Moeh: has joined #RubyOnRails
[14:05:13] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-06-02

[10:40:00] Moeh: has joined #RubyOnRails
[10:41:40] Moeh: Hey guys. So we use an "after_create" callback to create another entity using "User.create!(...)" in the callback. Now, if "User.create!(...)" fails, we don't see any exception, the transaction is just rolled back. How can we make sure that the errors in the callbacks are properly handled?
[10:48:53] Moeh: alfiemax: Yes, we do
[12:53:12] Moeh: Ping timeout: 258 seconds

2016-05-07

[15:35:39] Moeh: has joined #RubyOnRails
[15:36:26] Moeh: Can someone tell me if delayed_job_active_record is compatible with rails 5.0.0-rc1?
[15:37:18] Moeh: Great! And do you check out master branch or latest release (4.1)?
[15:37:43] Moeh: Sounds good! Thanks a lot!
[19:19:40] Moeh: Quit: Textual IRC Client: www.textualapp.com
[19:42:43] Moeh: has joined #RubyOnRails
[21:07:56] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-05-06

[00:11:44] Moeh: Quit: Textual IRC Client: www.textualapp.com
[14:03:10] Moeh: has joined #RubyOnRails
[19:15:56] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-05-05

[22:57:44] Moeh: has joined #RubyOnRails

2016-04-29

[00:31:01] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-04-28

[15:19:23] Moeh: has joined #RubyOnRails
[15:19:50] Moeh: Hey guys. One question: is the 'tzinfo-data' gem necessary when running rails on OSX / Ubuntu machines?
[15:27:12] Moeh: Ping timeout: 276 seconds
[22:39:41] Moeh: has joined #RubyOnRails

2016-04-15

[11:36:04] Moeh: has joined #RubyOnRails
[18:14:49] Moeh: Ping timeout: 250 seconds

2016-04-05

[15:23:42] Moeh: has joined #RubyOnRails
[15:24:49] Moeh: Hey guys. I am using "render nothing: true, status: 204" in one of my controllers and rails actually returns 200, not 204. I am running Rails 5.0.0.beta1. Is that expected behavior? (And yes, I know I should rather use head, I was just surprised.)
[15:27:12] Moeh: Yes, I experience the following behavior: "head :ok" => 200 (correct), "head :no_content" => 204 (correct), "render nothing: true, status: 204" => 200 (incorrect, at least IMO).
[16:01:39] Moeh: smathy: I just created a new rails app and there it also works for me. So that means that something in our app breaks this behavior. Quite strange.
[18:17:38] Moeh: What is the recommended way of dealing with User.find(params[:id]) where it might be that no user exists with this id? First do User.exists?(params[:id]) and then find it (and thereby have two calls) or wrap the User.find in a begin / rescue block?
[18:21:03] Moeh: smathy: so I do "@user = User.find_by_id(params[:id])" and then "if @user ..."
[18:21:40] Moeh: cool, thanks!
[18:22:24] Moeh: you mean: do not use "User.find_by_id" and instead "User.find_by(id: id)"?
[18:22:36] Moeh: perfect, thanks!
[18:31:43] Moeh: PaulePanter: What is the downside of using User.find_by(id: id)
[18:35:08] Moeh: PaulePanter: The find_by is shorter or did I make a mistake: https://gist.github.com/Maarius/8db78d023724de600eae770b38a676a3 ?
[19:11:48] Moeh: Ping timeout: 276 seconds

2016-03-24

[12:48:44] Moeh: has joined #RubyOnRails
[12:49:55] Moeh: What is the recommended way to allow rails to accept dasherized attributes that follow the JSON API spec recommendation. This: https://github.com/rails/rails/pull/20389#issuecomment-198759230?
[17:28:35] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-03-21

[12:45:47] Moeh: has joined #RubyOnRails
[12:47:04] Moeh: I am currently going through my code with rubocop and try to fix all the styling issues. Now rubocop suggested a guard clause for some code, could someone have a look at https://gist.github.com/Maarius/2f358dabeebf948f1c64 and tell me if the bottom part is correct as guard clause for the top part?
[12:49:37] Moeh: universa1: This method is used in a before_action in a controller. I guess the author would like the controller to proceed and therefore returns true (it is not my code).
[12:51:40] Moeh: universa1: I added a comment. Would that code then have the same behavior as the if / else condition?
[12:53:51] Moeh: universa1: Updated the gist
[12:57:08] Moeh: universa1: Thanks a lot!
[16:36:52] Moeh: Hey guys, I am using the paranoia gem to implement soft deletion of entities (https://github.com/rubysherpas/paranoia). In a callback I would now like to set deleted_by_user_id to the @current_user that is set by the application controller. Is there any way to access this @current_user in the model?
[16:43:01] Moeh: smathy: Thanks, will check it out!
[16:46:27] Moeh: Okay, good to know!
[18:52:14] Moeh: Ping timeout: 248 seconds

2016-02-05

[12:54:04] Moeh: has joined #RubyOnRails
[18:08:26] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-02-03

[10:36:56] Moeh: has joined #RubyOnRails
[10:51:30] Moeh: Ping timeout: 250 seconds
[13:13:33] Moeh: has joined #RubyOnRails
[16:30:25] Moeh: Quit: Textual IRC Client: www.textualapp.com
[17:38:10] Moeh: has joined #RubyOnRails
[19:22:15] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-02-02

[14:27:47] Moeh: has joined #RubyOnRails
[20:42:52] Moeh: Quit: My Mac has gone to sleep. ZZZzzz???

2016-01-31

[17:26:49] Moeh: has joined #RubyOnRails
[19:52:26] Moeh: Quit: My Mac has gone to sleep. ZZZzzz???
[20:13:33] Moeh: has joined #RubyOnRails
[22:37:56] Moeh: Quit: Textual IRC Client: www.textualapp.com

2016-01-26

[19:12:43] Moeh: has joined #RubyOnRails
[19:41:34] Moeh: Quit: Page closed

2016-01-22

[14:32:45] Moeh: has joined #RubyOnRails
[14:33:48] Moeh: How can I make rails 5 accept JSON formatted according to JSONAPI (http://jsonapi.org/format/)? I have active model serializers installed and data served by rails already complies to this standard. However I would like to accept POSTs that are formatted this way.
[15:50:24] Moeh: Quit: Page closed
[15:55:16] Moeh: has joined #RubyOnRails
[15:56:43] Moeh: If I use active model serializers with the JSONAPI adapter, rails correctly serializes objects in the JSONAPI format. However, it seems it cannot accept calls with this format. Anyone knows if that is solved with https://github.com/cerebris/jsonapi-resources? Which should I use?
[16:06:13] Moeh: I want to make POST calls containing a jsonapi payload to the rails app
[16:08:16] Moeh: tubbo: That is definitely possible. I was just wondering if there is a way around that. It feels somehow strange that with AMS I can serialize an object in JSON in the jsonapi format but not deserialize.
[16:08:40] Moeh: Jeah, I would not want to use both at the same time
[16:11:44] Moeh: Well, I would like to build a rails api that conforms with the JSONAPI spec. It would be kind of strange data from api -> client has a different format than client -> api, don't you think?
[16:14:34] Moeh: tubbo: Yes, I see what you mean.
[16:22:26] Moeh: tubbo: Jeah, I would like to divert from the standards as little as possible. Which is why I am so sad that there isn't already a "rails way" to do it :)
[16:25:21] Moeh: maxx88: Thanks! Will have a look!
[17:37:50] Moeh: tubbo: It is actually so simple: http://stackoverflow.com/questions/32491360/deserializing-json-api-with-rails-strong-parameters
[17:38:06] Moeh: I have it now working, GET and POST requests in jsonapi format.
[17:39:52] Moeh: That is a very good idea! Where would you put it?
[20:28:10] Moeh: Quit: Page closed

2016-01-20

[20:13:56] Moeh: has joined #RubyOnRails
[20:16:07] Moeh: Hey, I am using rails 5 with active model serializer and somehow that seems to break the controller generate on rails g scaffold $model. See https://gist.github.com/Maarius/86e50598139b5584a605 Can someone tell me how to fix this?
[21:06:55] Moeh: Quit: Page closed

2016-01-18

[17:36:18] Moeh: has joined #RubyOnRails
[17:37:47] Moeh: How can I whitelist all parameters that are nested under a certain field? Say I have a Chart entity and in the controller I have params.require(:chart).permit(configuration: :value_field). However I would like to allow all parameters that are within "configuration". How would I do that?
[17:43:13] Moeh: I am looking at https://github.com/rails/rails/issues/9454 right now
[17:43:18] Moeh: That describes exactly my problem
[17:43:51] Moeh: The the solution described by fxn works for me. Great :)
[17:44:14] Moeh: It is interesting, I still get the error "Unpermitted parameter: configuration", however it still applies it.
[19:59:50] Moeh: Quit: Page closed

2016-01-15

[12:40:31] Moeh: has joined #RubyOnRails
[12:42:15] Moeh: What is the rails best practice to store configuration data that can regularly change for an entity. Say I have a Chart entity and would like to store its configuration where I would often add or remove fields. Shall I serialize chart.configuration and store it to a "configuration" database column? Or should the configuration be an ActiveModel? Would be great to get some guidance.
[12:43:24] Moeh: The user
[12:49:21] Moeh: rvanlieshout: Probably between 5-20 fields. Yes, we are using postgres.
[12:50:40] Moeh: I though about that. However, that would require me to write all value validation myself, correct? If I use ActiveModel, I could use the built in rails validations.
[12:52:38] Moeh: Yes, that is the current configuration. One column for each field. However it seems to be quite clunky if the fields change from time to time.
[12:56:06] Moeh: arup_r: Yes, I am looking at http://nandovieira.com/using-postgresql-and-jsonb-with-ruby-on-rails right now and that seems quite exactly matching what we want. So I would create a JSONB column and use store_accessor to access the fields.
[13:00:11] Moeh: Jep, sounds very good.
[13:00:24] Moeh: Will try that
[13:00:44] Moeh: Thanks a lot for your help guys. Always appreciated :)
[15:33:26] Moeh: Quit: Page closed

2016-01-08

[10:58:25] Moeh: has joined #RubyOnRails
[11:00:33] Moeh: Hey there. I am using guard livereload with my rails app. It works fine (reloads the browser) when I edit .slim templates, however when I edit my "main.css.scss" file, the get request in the browser fails and all CSS is subsequently removed. This is my guardfile: http://pastebin.com/QXJ8AacW Would be great if someone could help me.
[11:00:59] Moeh: Sorry: http://pastie.org/10677460
[14:43:41] Moeh: Quit: Page closed
[16:26:50] Moeh: has joined #RubyOnRails
[16:28:37] Moeh: Can someone tell me how to clone all attributes and relations of an object like "source" to an object like "target" while only updating target and not creating a new record? I tried using the amoeba gem, but it always creates a new record.
[16:31:33] Moeh: arup_r: I don't understand. The object exists already, I don't want to create a new one.
[19:32:52] Moeh: Quit: Page closed

2015-12-14

[00:11:41] Moeh: I don't really get why this is not supported out of the box. Meaning to serialize an object with associations and deserialize it.
[00:14:47] Moeh: what exactly do you mean?
[00:35:08] Moeh: For first level :includes, I already managed to overwrite the keys (http://pastie.org/10631357). However, it is not working for 2nd level nesting, like user.to_json(:include => {:comments => {:include => {:points}}})
[01:38:41] Moeh: Quit: Page closed
[18:03:03] Moeh: has joined #RubyOnRails
[18:03:47] Moeh: Is there any way to use a "where" equivalent in a CollectionProxy where the elements are not saved to the db yet?
[18:07:40] Moeh: tubbo: Okay, so I have I have a user model and a comment model. A user has many comments. Is there a way to look for a specific comments in users.comments when the comments that are added are not saved to the db yet?
[18:09:50] Moeh: Yes, I saw that. Unfortunately this doesn't work in my case as I need the actual object. So something similar what I get when I do user.comments.first, except that I would like to do something like users.comments.where(real: true).first
[18:18:48] Moeh: tubbo: I have a multi step form where I store the intermediate objects in the session, therefore it is not saved yet.
[21:25:55] Moeh: Quit: Page closed