arrowcircle

Activity Graph

Page 1 of 1

2016-06-30

[16:41:26] arrowcircle: has joined #RubyOnRails
[16:46:18] arrowcircle: Hi! I have a strang problem with namespacing in rails. https://gist.github.com/arrowcircle/d1ac3bdf78d67703c8e3a3aeca3d22dc If I access my namespaced activemodel, it shows me activerecord model instead. What I doing wrong?
[17:10:31] arrowcircle: matthewd, thanks! I changed all my Pochta models, but ring no bells. Rails s works, but Pochta::Box::News still returns News. I updated the gist https://gist.github.com/arrowcircle/d1ac3bdf78d67703c8e3a3aeca3d22dc
[17:11:25] arrowcircle: and if I put reload! in console, it fails with error (colsole.log)
[17:24:44] arrowcircle: hmm. I dont get it, should I use it in Pochta or in top level News?
[17:32:27] arrowcircle: matthewd, still cant figure out what is wrong
[17:35:34] arrowcircle: guide suggests to user require_dependency
[17:38:17] arrowcircle: it happens in console
[17:38:29] arrowcircle: should i put it in top level news.rb?
[17:41:52] arrowcircle: and how not to catch it in production?
[17:49:12] arrowcircle: now I have another problem, it tells me TypeError: Box is not a module
[17:54:00] arrowcircle: @matthewd how to deal with it?
[18:07:05] arrowcircle: but how to nest it properly? I need these classes to have parent class
[18:07:38] arrowcircle: dont put it under box namespace?
[18:07:46] arrowcircle: put to pochta?
[18:15:27] arrowcircle: Quit: Leaving.

2016-03-16

[10:04:03] arrowcircle: has joined #RubyOnRails
[10:09:28] arrowcircle: Quit: Leaving.
[11:25:56] arrowcircle: has joined #RubyOnRails

2016-03-15

[12:32:17] arrowcircle: has joined #RubyOnRails
[12:33:43] arrowcircle: hi! I'm trying to make a view for admin interface with structure like https://gist.github.com/cortc/38bc6b6c5be8a23cb9c8 . I need to count number of t.cell method calls. How can I organize list_table method? I dont want from where to start
[12:49:34] arrowcircle: hi! I'm trying to make a view for admin interface with structure like https://gist.github.com/cortc/38bc6b6c5be8a23cb9c8 . I need to count number of t.cell method calls. How can I organize list_table method? I dont want from where to start
[12:51:35] arrowcircle: universa1, how to count number of t.cell method calls
[12:51:44] arrowcircle: universa1, thats what i need to write
[12:52:36] arrowcircle: universa1, from what? what is |t|? what class it should be?
[12:53:16] arrowcircle: sevenseacat, its not a code, its what i want.
[12:53:25] arrowcircle: universa1, yes
[12:54:35] arrowcircle: sevenseacat, I need to write list_table method and cell method.
[12:55:45] arrowcircle: yes, block as parameter, but how to count cell method calls inside this block? where to store it?
[13:52:51] arrowcircle: Quit: Leaving.

2015-08-28

[13:13:52] arrowcircle: has joined #RubyOnRails
[13:14:33] arrowcircle: hi! my question is not about rails, but could you please advice me any solutions for visits tracking of resources in rails app?
[13:31:56] arrowcircle: @sevenseacat, Thanks!
[13:42:55] arrowcircle: Quit: Leaving.

2015-08-11

[10:00:23] arrowcircle: has joined #RubyOnRails
[10:01:29] arrowcircle: hi! I have slow assets precompile on my production serve. It takes 3 minutes to build application.js. On my laptop it gets 10 secs for the same file. What can cause such slow behaviour?
[11:56:33] arrowcircle: Quit: Leaving.
[12:56:01] arrowcircle: has joined #RubyOnRails

2015-07-08

[12:17:00] arrowcircle: has joined #RubyOnRails
[12:17:52] arrowcircle: hi! I am trying to make redirects from old site and added this part to routes.rb. https://gist.github.com/arrowcircle/f4faf6b78856421c4cc5 How can i refactor it? Should i move it to nginx config? Should i use middleware? Will it slow down routing?
[12:19:55] arrowcircle: Aeyrix, should i remove it from rails routes?
[12:20:47] arrowcircle: Aeyrix, does is support regexps?
[12:38:13] arrowcircle: Quit: Leaving.

2015-04-29

[15:46:05] arrowcircle: hi! i trying to make correct route in for for namespace and scope. https://gist.github.com/arrowcircle/992748814fb84849f641 How should i change my routes or url in form to get it done?
[15:49:25] arrowcircle: rhizome, cabinet_events for post, but there are no company_id here
[15:50:18] arrowcircle: rhizome, i updated gist
[15:54:46] arrowcircle: rhizome, Updated gist again, with full rake routes about events in cabinet
[15:56:08] arrowcircle: rhizome, should i wrap my events in resources :companies, path: ''?
[15:57:41] arrowcircle: rhizome, how to pass company_id in form?
[16:00:44] arrowcircle: rhizome, dont work. if i create event, all is ok, but when i edit i get no route match
[16:01:56] arrowcircle: rhizome, its when i use [:cabinet, @event]

2015-04-15

[09:10:14] arrowcircle: hi! i want to make an activemodel class, that will save group of items (AR models) and have custom validations. what is the best way to do this? im against initialization of these items and assignment of items params in controller. Any ideas?
[09:13:15] arrowcircle: How to deal with activemodel nested ar models? https://gist.github.com/arrowcircle/bfac5fb01ee6b1776683
[09:18:19] arrowcircle: universa1, i want to assign items to composer in controller like composer.assing_attributes(composer_attributes), but active model dont have this method
[09:18:28] arrowcircle: universa1, how to make it right?
[10:08:47] arrowcircle: hi! how to deal with activemodel class with nested activerecord models? https://gist.github.com/arrowcircle/bfac5fb01ee6b1776683 . It works for new items records, how to make it work with existing items?

2015-02-20

[12:31:36] arrowcircle: hi! i trying to make images for opengraph and twitter cards with format png. Whats best way to cache them and persist on disk?
[12:34:49] arrowcircle: cryo28, ideally i want to put it in public/uploads and serve as static with nginx, and only generate if missing
[12:35:46] arrowcircle: cryo28, i mean how to configure controller to send file and nginx to serve it if it exists
[12:37:13] arrowcircle: cryo28, problem is this will hit rails stack all the time
[12:38:10] arrowcircle: universa1, problem is all uploads are in public/uploads, and url to image is /articles/1.png
[12:38:24] arrowcircle: universa1, i dont need any access control
[12:39:35] arrowcircle: universa1, cryo28, i want to hit rails and generate it only if image dont exist. if it exist it should be served as static
[12:41:19] arrowcircle: cryo28, universa1, problem is, when i generated image and want to serve it as static, it will be available in public/uplaods folder/, ie as /uploads/articles/1.png, and i want it to be available as static as /articles/1.png
[12:42:22] arrowcircle: cryo28, but link is to /articles/1.png, not to uploads
[12:43:40] arrowcircle: cryo28, and if this file is not available, will it hit rails to generate it?
[12:44:38] arrowcircle: JR___, you can move you product code to partial, render partial inside js and put it before other products
[12:45:55] arrowcircle: JR___, see my comment in github
[12:46:13] arrowcircle: cryo28, if all missing files go to rails, it will try to hit uploads
[12:47:33] arrowcircle: universa1, and if i want to put them inside public/uploads/articles/1.png?
[12:48:18] arrowcircle: universa1, problem is its not about only articles, its about all controllers. I should not add all them as shared folders
[12:49:17] arrowcircle: JR___, you can make js-format request via link_to remote: true and response as js code
[12:50:35] arrowcircle: cryo28, problem is, that url is in public/uploads, not in public
[12:53:32] arrowcircle: cryo28, yes, but i need /articles/1.png to lookup /uploads/articles/1.png
[12:53:41] arrowcircle: cryo28, and if its missing - hit rails stack
[12:54:16] arrowcircle: cryo28, will it change the url?
[12:54:39] arrowcircle: arrowcircle, or just serve file from different folder?
[12:55:40] arrowcircle: cryo28, is it possible to work as i want?
[12:56:22] arrowcircle: cryo28, ok, thanks a lot! will google nginx rewrites
[12:58:29] arrowcircle: cryo28, i think its possible to just use try_files
[13:03:23] arrowcircle: cryo28, ok, thx, this will solve my problem
[13:04:01] arrowcircle: cryo28, no, it should be /public/uploads/articles/1.png
[13:04:08] arrowcircle: cryo28, so its ok
[13:05:58] arrowcircle: cryo28, actually it should look for all url, because any page have this image

2014-11-14

[12:22:14] arrowcircle: hi! what is the best way of changing class of STI model?

2014-08-18

[11:54:03] arrowcircle: hi! i have a complex sql query in my method https://gist.github.com/arrowcircle/3ae43824ba18b88aa2bb . It works good, but it returns array, that have problems with pagination. Kaminary pagination of array works fine, but it loads all results into memory. Is it possible to convert my query to return activerecord relation?
[11:56:49] arrowcircle: mikecmpbll, can i pass raw sql to joins method?
[11:57:16] arrowcircle: mikecmpbll, thanks man!

2014-06-18

[15:51:02] arrowcircle: hi! i trying to make rails plugin, created it with rails plugin new. added app folder with models and so on. when i run spec i get error about uninitialized constant for my models in app/models. how should i require it to work?

2014-06-07

[08:50:47] arrowcircle: hi! what is the best way to upload images for non persisted model? for example, i have comment form, i put some message inside, then drag and drop some images for this comment (with some html5 magic) and click submit? how to make such attachments?

2014-05-23

[09:00:19] arrowcircle: hi! i want to make custom form builder to behave like https://gist.github.com/arrowcircle/d25dcf50c8b1ac3eaafc
[09:00:34] arrowcircle: how can i insert errors and action buttons around from block?
[09:09:05] arrowcircle: any ideas on how to make custom form builder to work like https://gist.github.com/arrowcircle/d25dcf50c8b1ac3eaafc
[09:13:10] arrowcircle: nope. will see now. thx for the tip

2014-05-19

[13:29:21] arrowcircle: hi! how can i refactor this view? https://gist.github.com/arrowcircle/7ff2878d896839492eb8
[13:31:35] arrowcircle: rvanlieshout, thx!

2014-04-24

[05:16:12] arrowcircle: hi! i have a strange problem after upgrading sass-rails gem. first it required me to add links to assets inside css files with "depend_on_asset" comment. Now it dont show these assets at all - digest in request and in assets is different. How can i fix this?

2014-02-17

[20:02:37] arrowcircle: hi! i have an app, where users upload 10mb files. Some of them are dial up (or slow connection). I use unicorn as app server, but when all workers are busy i have no workers to process requests. How can I solve this situation? WIll it help, if i change my application server (to puma)?
[20:04:00] arrowcircle: Scient, nginx
[20:05:04] arrowcircle: Scient, its not a problem
[20:05:16] arrowcircle: Scient, i have busy workers.
[20:05:45] arrowcircle: Scient, if i need to send_file to clients - its easyly fixed with headers. But users upload files to server
[20:06:17] arrowcircle: Scient, is it ok for multipart uploads?
[20:07:15] arrowcircle: Scient, will migration to puma help me?
[20:07:25] arrowcircle: or should i use jruby?
[20:07:51] arrowcircle: how should i behave?
[20:08:00] arrowcircle: run separate evented service?
[20:08:18] arrowcircle: so its up to nginx tuning?
[20:09:13] arrowcircle: Scient, is it hard to add basic or token auth to nginx_upload module?
[20:10:22] arrowcircle: Scient, i see
[20:10:32] arrowcircle: Scient, to measure if unicorn requests are slow
[20:10:50] arrowcircle: but what are other workarounds?
[20:11:05] arrowcircle: its goldfish case
[20:11:13] arrowcircle: and what about auth?
[20:11:30] arrowcircle: what is the difference between rainbows and puma?
[20:11:41] arrowcircle: i think they are boath threaded servers
[20:12:42] arrowcircle: puma now have workers too
[20:13:16] arrowcircle: i will dig into it
[20:13:24] arrowcircle: Scient, thanks for tips

2013-11-11

[16:00:37] arrowcircle: hi! i have a controller and action_name, how i can get route to that controller and action (ie "articles#index" goes to "/articles")

2013-10-30

[06:37:06] arrowcircle: hi! i have defined helper method in my application controller, but cant access it in the view? what i doing wrong? https://gist.github.com/arrowcircle/7215539
[06:39:34] arrowcircle: ravionrails, already tried this. and tried to move method to public from private
[06:41:33] arrowcircle: ravionrails, i got nil
[06:43:02] arrowcircle: sevenseacat, i tried debugger. if i put debugger in controller - i see this method in the inherited controller. but if i put it in the view - its undefined
[06:44:17] arrowcircle: arrowcircle, hm.. if i call seo in the view, it returns nil. i tried call it in debugger - its undefined
[06:44:37] arrowcircle: ie if i make method(:seo)
[06:44:46] arrowcircle: it dont see it
[06:46:37] arrowcircle: sevenseacat, NameError Exception: undefined method `seo' for class `Haml::Buffer'
[06:46:53] arrowcircle: ravionrails, seo.inspect returns nil
[06:49:42] arrowcircle: ravionrails, method name chage helped. but its wiered why i cant use old name
[06:51:42] arrowcircle: ravionrails, same nil. i searched through code and didnt find any seo method definitions

2013-10-29

[14:17:37] arrowcircle: hi! i have helper_method in my application_controller. but when i call it from the view, i get nil always. how can i debug my helper_methoded method?
[14:19:35] arrowcircle: sevenseacat, https://gist.github.com/arrowcircle/7215539
[14:21:09] arrowcircle: sevenseacat, it always shows nil
[14:21:43] arrowcircle: arrowcircle, and if i add logger to seo method in controller - i never see logged message
[14:22:40] arrowcircle: elaptics, no, but its that simple
[14:23:04] arrowcircle: sevenseacat, i have activerecord model called Seo
[14:32:21] arrowcircle: sevenseacat, any ideas how to see how this method gets called?
[14:34:00] arrowcircle: sevenseacat, how can i do this?

2013-09-08

[11:52:57] arrowcircle: hi! i trying to make a gem, that shares some assets, models, controllers and helpers with rails app. i made dummy app inside my spec/dummy directory. dummy app include behaviour from gem. But when i run spec, it crashes on carrierwave uploader from gem with "not connected to database". How to deal with this?

2013-09-03

[19:17:14] arrowcircle: hi! what is the best way to test gem functionality with rspec on live test models? I want to make a tiny rails app with sqlite db and models, that use my gem. What is the best way to integrate it to my gem specs?
[19:18:51] arrowcircle: workmad3, i created it with bundler gem command
[19:19:42] arrowcircle: workmad3, thanks for the info

2013-08-30

[13:49:58] arrowcircle: hi! can anoyone help me with json? I have an API and i send https://gist.github.com/arrowcircle/6390025 request to it. If i read this json from file and put it to post body of request - all is ok. If i read the same string from incoming request - i get JSON::ParserError. Json gisted from logs. How can i fix this?
[13:57:39] arrowcircle: any ideas how to parse escaped json in ruby/rails? I always get JSON::Parser error if have escaped quote inside any parameter
[15:05:55] arrowcircle: hi! i trying to get json from post request body, that is prettified and escaped. how should i modify it to be valid input for JSON.pase?
[15:09:31] arrowcircle: ljarvis, if i put it into jsonlint.org - it seems ok. but when i try to parse it - i get 'JSON::ParserError unexpected token at'
[15:10:38] arrowcircle: https://gist.github.com/arrowcircle/6390025
[15:10:49] arrowcircle: its copy from log
[15:11:02] arrowcircle: if i save it to file and read from it - its ok
[15:11:12] arrowcircle: but if i read it from body of request - error
[15:13:32] arrowcircle: i cracked my head trying to gsub it. stack overflow have answers with files - not working for me
[15:13:46] arrowcircle: any ideas how to eat it properly?
[15:14:19] arrowcircle: body = request.body.read.force_encoding('UTF-8')
[15:14:32] arrowcircle: and file read in test case
[15:15:50] arrowcircle: ljarvis, how rails parsed it for me?
[15:26:20] arrowcircle: ljarvis, now i have dispatch params when trying to print params in log "ActionDispatch::ParamsParser::ParseError"
[15:26:30] arrowcircle: so i think json is invalid
[15:28:40] arrowcircle: ljarvis, any ideas hot to fix this?
[15:30:48] arrowcircle: ljarvis, thats the problem, i only receive json
[15:32:28] arrowcircle: ljarvis, click button in another soft, it makes a request
[15:32:45] arrowcircle: ljarvis, my test specs, that send json from file are ok
[15:34:56] arrowcircle: ljarvis, its my problem to get it working - so i trying all possibilites

2013-07-15

[12:24:27] arrowcircle: hi! i have htm related models. how i can make a search over products for different colors and sizes? all info in gist https://gist.github.com/arrowcircle/5999556
[12:32:01] arrowcircle: mikecmpbll, how to change structure to make search easier?
[12:33:15] arrowcircle: no, no need to reuse
[12:33:44] arrowcircle: i've separated it to make parameters easily editable

2013-06-28

[07:29:48] arrowcircle: hi! what is the easiest way to change value of joining association from one of the parents object in has many through association?

2013-06-04

[06:58:08] arrowcircle: hi! i have a problem with rails autoloading "Expected my_model.rb to define MyModel" https://gist.github.com/arrowcircle/5684586 . any ideas how to fix this error?
[10:30:42] arrowcircle: hi! i have a problem with rails autoloading. its "expected my_model.rb to define MyModel". Here is the gist. https://gist.github.com/arrowcircle/5684586 Any ideas how to deal with this?
[10:40:47] arrowcircle: any ideas about autoloading? https://gist.github.com/arrowcircle/5684586
[10:43:29] arrowcircle: jeebster, what is your problem?
[10:44:33] arrowcircle: jeebster, is it in interactive mode or in some script, like capistrano?
[10:45:26] arrowcircle: so you just type su - deployer and get error
[10:45:46] arrowcircle: what exact output you have?
[10:49:11] arrowcircle: you cant access root from deployer
[10:49:25] arrowcircle: also, what you have in .profile and .bash_profile?
[10:51:42] arrowcircle: bashrc is for non-login mode
[10:53:16] arrowcircle: try to login as deployer
[10:53:26] arrowcircle: do you have valid ruby with rbenv?
[10:53:38] arrowcircle: btw, do you have rbenv initializer in bash_rc and bash_profile?
[10:53:47] arrowcircle: inside deployer home dir?
[10:54:40] arrowcircle: and whats in bash_profile?
[10:54:45] arrowcircle: also, where you have these files?
[10:59:14] arrowcircle: any guru of rails autoload? i have a problem with my models. here is the gist https://gist.github.com/arrowcircle/5684586
[11:00:57] arrowcircle: i have this annoying problem "expected my_model.rb to define MyModel"
[11:02:14] arrowcircle: DouweM, actual error is in the gist. "Expected app/models/redditor/text_block.rb to define TextBlock"
[11:04:40] arrowcircle: so any ideas?
[11:05:15] arrowcircle: also, i can access this model with Redditor::TextBlock in rails console
[11:06:21] arrowcircle: DouweM, already tried
[11:08:23] arrowcircle: https://gist.github.com/arrowcircle/5684586
[11:08:36] arrowcircle: here is uodated gist. i have error, when i trying to access it via controller
[11:08:44] arrowcircle: and its not the table name problem
[11:10:09] arrowcircle: just simple get to /admin/redditor/text_blocks/new
[11:10:56] arrowcircle: "admin/redditor/pages/1/text_blocks/new"
[11:12:55] arrowcircle: DouweM, wise idea. will try now
[11:15:42] arrowcircle: DouweM, ah yeah! it helped!!!! thanks a lot!
[12:11:02] arrowcircle: hi! If i have model Redditor::TextBlock, then when i make link_to "", @text_block it will go to "/redditor/text_blocks/1". how i can remove leading "redditor" from url generation?
[12:19:31] arrowcircle: DouweM, sorry for bothering again, but maybe you know how to solve routing problem with namespaced models?
[12:22:14] arrowcircle: DouweM, its more complex. I use poly has_many association, and i use something like "[:admin, p.object, content_block]", where content block connected with p.object and p.object can change its class
[12:22:56] arrowcircle: and for this string [:admin, p.object, content_block] i get admin_redditor_page_redditor_content_block_path(content_block)
[12:23:27] arrowcircle: DouweM, is that method used for url generation
[16:08:36] arrowcircle: DouweM, could you please answer another annoying question? can i use STI on input class to connect digital and text inputs to category? https://gist.github.com/arrowcircle/5707191
[16:10:05] arrowcircle: DouweM, ie if i catch category.inputs - it will get me array of digits and texts model objects?
[16:12:11] arrowcircle: DouweM, ok, and what to add to this class structure, to have an ability to add predefined arrays of values? ie introduce new class Input::Predefined, that will have another association with predefined values?
[16:13:14] arrowcircle: also, thats the best way to connect this properties to notice? now i use postgres hstore to store inputs valiues like notice.params[input_id] = value
[16:13:33] arrowcircle: arrowcircle, should i use another table with classic data types?
[16:16:07] arrowcircle: btw, any sidekiq competitors working on beanstalk message queue?
[16:16:43] arrowcircle: zmalex, what you mean by dynamic hierachy?
[16:21:06] arrowcircle: DouweM, its not celluloid driven
[16:23:33] arrowcircle: btw, how you restart sidekiq on deploys? with sitekiqctl?
[16:24:27] arrowcircle: avril14th, in production i mean
[16:25:41] arrowcircle: DouweM, and how to deal with jobs, that takes more time, than in timeout? will my deploy take 60 (timeout) seconds longer?

2013-05-24

[11:37:17] arrowcircle: hi! In app, that i wiil work, i have an ugly db structure. parameter bt category_value. parameter hm parameter_values, parameter_values are predefined in db and linked with notice(main model) with habtm table notices_parameter_values. here is the gist with full info https://gist.github.com/arrowcircle/5642861 . What is the best way to add ability to add user inputed parameter_values for notices with this ugly structure?

2013-05-08

[08:50:29] arrowcircle: hi! how can i get input name in rails view inside form?
[08:55:00] arrowcircle: rushed, here is the gist of my forms with nested attributes https://gist.github.com/arrowcircle/5539174
[08:59:33] arrowcircle: rushed, in return of this func i want to get something like article[page_attributes][text_blocks_attributes][1]

2013-04-16

[09:19:12] arrowcircle: hi! i have a strange problem with classes and modules https://gist.github.com/arrowcircle/5394525 . when i user rails c and Api::User.register its ok. when i run rspec - i get error in gist. what i doing wrong?
[09:23:08] arrowcircle: any ideas about my problem?
[09:26:51] arrowcircle: sthetz, now it talks about toplevel constant Registration referenced by Api::User::Registration and next line is the same error
[12:15:15] arrowcircle: hi! i have model registration in app/models and i have module Api::User::Registration in app/modes/api/user/registration.rb. when i include registration in Api::User i get include, that i should include module. it seems, that api user includes top model registration instead of api module. how to deal with it?
[12:24:34] arrowcircle: hi! what is a proper way to include api::user::registration to api::user? i have a problem https://gist.github.com/arrowcircle/5394525
[12:28:52] arrowcircle: sthetz, thx, i already broken my brain with it
[12:29:01] arrowcircle: toertore, where?
[12:30:06] arrowcircle: toertore, thats why i asking
[12:33:03] arrowcircle: sthetz, thanks, but how can i define a api user module for registration in separate file?
[12:35:15] arrowcircle: sthetz, i confused with file structure
[12:35:27] arrowcircle: and file names
[12:36:20] arrowcircle: sthetz: any good articles or books to advise?
[12:37:41] arrowcircle: sthetz, thanks a lot!

2013-01-03

[13:55:22] arrowcircle: hi! i have strange line in logs in my production app in json response: "Completed 200 OK in 162ms (Views: 1.3ms | ActiveRecord: 18.8ms)"
[13:55:29] arrowcircle: where i loose 100+ms?
[14:04:04] arrowcircle: Hates_, its in logs. if AR and view are fast - where i loose in response time?
[14:16:43] arrowcircle: Hates_, do you know why?