naquad

Activity Graph

Page 1 of 2 | Next »

2018-05-31

[14:56:54] naquad: Quit: ZNC - http://znc.in
[14:57:03] naquad: has joined #ruby
[14:57:39] naquad: has left #ruby: ()

2018-05-30

[00:10:42] naquad: has joined #ruby

2018-05-29

[02:46:57] naquad: *.net *.split
[02:47:59] naquad: has joined #ruby
[02:50:09] naquad: *.net *.split
[02:51:45] naquad: has joined #ruby
[18:53:01] naquad: *.net *.split

2018-05-24

[19:36:45] naquad: Ping timeout: 260 seconds
[19:38:40] naquad: has joined #ruby

2018-04-28

[17:21:46] naquad: Quit: ZNC - http://znc.in
[17:22:17] naquad: has joined #ruby

2018-04-25

[12:25:35] naquad: *.net *.split
[12:27:10] naquad: has joined #ruby
[15:01:05] naquad: *.net *.split
[15:04:06] naquad: has joined #ruby

2018-04-24

[15:24:33] naquad: has joined #ruby

2018-04-04

[10:08:09] naquad: Ping timeout: 268 seconds
[10:14:53] naquad: has joined #ruby
[10:19:33] naquad: Ping timeout: 264 seconds

2018-03-22

[20:43:46] naquad: has joined #ruby

2018-03-21

[08:51:13] naquad: Ping timeout: 248 seconds

2018-03-16

[16:06:24] naquad: Ping timeout: 260 seconds
[16:07:57] naquad: has joined #ruby

2018-03-15

[11:29:00] naquad: has joined #ruby
[11:29:00] naquad: Ping timeout: 260 seconds
[11:33:09] naquad: Ping timeout: 260 seconds
[11:33:38] naquad: has joined #ruby

2018-03-13

[21:32:55] naquad: has joined #ruby

2018-02-28

[16:24:33] naquad: *.net *.split

2018-02-09

[17:00:18] naquad: Quit: ZNC - http://znc.in
[17:00:40] naquad: has joined #ruby

2017-12-09

[05:06:20] naquad: *.net *.split
[05:11:08] naquad: has joined #ruby

2017-12-07

[14:48:21] naquad: *.net *.split
[14:55:07] naquad: has joined #ruby

2017-12-01

[02:28:40] naquad: has joined #ruby

2017-11-29

[17:25:26] naquad: Quit: ZNC - http://znc.in
[17:25:48] naquad: has joined #ruby

2017-11-23

[13:06:56] naquad: has joined #ruby

2017-11-14

[21:59:38] naquad: Ping timeout: 250 seconds

2017-11-08

[09:51:27] naquad: Ping timeout: 260 seconds
[09:51:52] naquad: has joined #ruby

2017-11-02

[23:00:13] naquad: Quit: ZNC - http://znc.in
[23:02:57] naquad: has joined #ruby

2017-10-17

[02:36:47] naquad: Ping timeout: 248 seconds
[02:41:52] naquad: has joined #ruby

2017-10-02

[22:00:14] naquad: Quit: ZNC - http://znc.in
[22:06:19] naquad: has joined #ruby

2017-09-19

[23:13:36] naquad: has joined #ruby
[23:14:44] naquad: i've got [[1, [1,2,3,4,5]], [2, [2,3,4,5]]] can i somehow quickly make from it [[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 2], [2, 3], ...]? (that is produce pairs like <key> <value from array>)
[23:20:58] naquad: i've got to that: x.map {|k ,v| v.zip([k].cycle)}.flatten(1)
[23:21:08] naquad: but it doesn't look very elegant :/
[23:28:24] naquad: awezome! thank you :)
[23:44:54] naquad: elomatreb++

2015-01-04

[23:04:20] naquad: is there some overall list of significant changes in rails 4 compared to rails 3.2?
[23:04:44] naquad: in blogs there's lots of small changes like fixed bug or enhancement but i need something more high level
[23:05:53] naquad: Radar, yup, thanks

2014-11-30

[15:29:54] naquad: i'm trying to test page with js using capybara, js submits the form but it looks like capybara doesn't see that (current_path doesn't change). how do i workaround that?

2014-11-07

[16:22:08] naquad: i'm trying to debug a RoR 3 project on production server, i need debugger there, but it is not installed in deps, i can't change Gemfile and Gemfile.lock, how do i still require 'debugger' bypassing the bundler?

2014-11-04

[16:32:16] naquad: i have a path like "/x 1/y 2/z 3/hello, world!" how do url-encode it, but don't touch the /?

2014-10-23

[15:12:57] naquad: is there some kind of gem like CanCan(Can) that will provide me a native in-database permission management? i don't want those Abilities and writing a logic per each role, i want it all to be managed through DB

2014-07-16

[14:36:48] naquad: is there a file browser gem? i've seen el_finder and it didn't fit

2014-07-14

[20:53:48] naquad: i remember there was some method or function that was checking that given key is in hash or raised an error. what is its name?
[20:54:41] naquad: elaptics, thanks!
[21:02:00] naquad: i've got a method in my app that takes options hash and positioned arguments that override values in this hash. i've wrote my own implementation for this: https://gist.github.com/1e5bce7c43e59fecabf8, but it looks like i'm reinveting the wheel. is there something similar in rails?
[21:10:38] naquad: elaptics, refresh
[21:16:17] naquad: ok, thanks. just wanted to make sure
[21:38:41] naquad: https://gist.github.com/34443e9bcc2f6cc40106 - is there any way to refactor this if to something better?
[21:40:50] naquad: centrx, no, model is not used
[21:43:18] naquad: centrx, raises exception
[21:46:47] naquad: https://gist.github.com/34443e9bcc2f6cc40106 pretty look like
[21:47:52] naquad: centrx, thats exactly what i've just thought, but more generic for id in general

2014-07-05

[20:07:08] naquad: how do i disable Sprockets::Rails::Helper::AssetFilteredError ?
[20:18:22] naquad: febuiles, 4.2. because of ckeditor
[20:20:19] naquad: febuiles, i'm getting error that one of the ckeditor resources (part of theme it loads from js) must be added to compiled resources
[20:21:29] naquad: febuiles, yes, there almost 70 such resource
[20:23:35] naquad: febuiles, thats a third party gem, require_tree doesn't work in production. it doesn't generate non-fingerprinted stuff
[20:23:41] naquad: so basically i want to make that thing stfu
[20:26:14] naquad: febuiles, exactly. it generates all its resources with fingerprints, but ckeditor is not aware about any asset pipelines or similar so it gets 404 for all resources. gem is called "ckeditor"
[20:27:39] naquad: febuiles, yes and that doesn't solve my problem. in this section only deployment is described and thats what i already have. no mentions about that annoying sprockets error
[20:27:56] naquad: anyway, i've found how to disable it already
[20:30:00] naquad: febuiles, because of ckeditor i can't use it :(

2014-06-13

[22:54:38] naquad: how do i make Model.includes() do not use joins? my query has group by clause and because of that includes with join doesn't load all associated data
[23:04:19] naquad: found it: preload

2014-06-08

[00:26:50] naquad: is there any way to make controller tests honour rescue_from?
[00:27:23] naquad: i've got a bunch of rescue_from in my controller (3rd party libraries) and i need to test that somehow, but from tests i can see that exception is raised w/o any handling
[00:41:49] naquad: Sakurazaki, request.path, request.full_path, current_page?
[00:42:29] naquad: there isn't
[00:43:09] naquad: btw you also have params[:action] and params[:controller], but they don't point to route, they point to actuall controller action in controller
[00:44:56] naquad: no, params[:controller] == 'user' && params[:action] == 'fiendlist'
[00:46:06] naquad: you're welcome

2014-06-07

[16:41:27] naquad: i have a number of has_many through relations and i would like to get a count of them in query. currently i've came to this: Model.eager_load(:primary_through_relation).select('count(distinct sub_rel.id) sub_cnt, count(distinct sub_rel2.id) sub2_cnt').group('models.id') - and it works until i try to count that
[16:41:33] naquad: any ideas how do i form that correctly?
[16:41:37] naquad: rails 4.1 btw

2014-02-24

[14:59:03] naquad: how do i run byebug in post-mortem mode in rails project? bundle exec byebug --post-mortem rails c - doesn't help

2014-02-18

[16:38:27] naquad: i have a site with 2 uis: desktop and mobile. mobile is the base controller, it contains pretty much everything (site is small), but desktop version needs several additional actions and override couple of existing ones. i've created a desktop controller which inherits mobile controller, but how do i internally pass request to desktop controller when request is for desktop version?

2014-02-05

[10:42:00] naquad: is there any way to changed views search path based on request?

2014-01-17

[17:16:11] naquad: is there any list of tags, attributes and css props that are allowed in emails?
[17:17:46] naquad: Criten, thanks!

2014-01-14

[13:21:14] naquad: is there any way to write this in some better way: https://gist.github.com/8418200
[18:06:02] naquad: how do i check that params[:var] is a file?
[18:06:39] naquad: validating file
[18:07:23] naquad: uploading a csv file for further import
[18:07:47] naquad: params[:file].is_a?(ActionDispatch::Http::UploadedFile) thats my current check. but it doesn't look very smart
[18:15:15] naquad: i think it could be params[:file].is_an_upload_file?
[20:17:31] naquad: is there any gem capable to determine mime type of given file (readonly IO or just path)?
[20:20:04] naquad: FooBarWidget, i'm aware about that command, i just don't want to spawn external processes
[20:20:16] naquad: plus this = external requirement that can't be handled by Gemfile

2013-12-19

[01:34:27] naquad: i've got a pretty odd thing going on with rails 3: thats my helper code: https://gist.github.com/8032852 and thats the error: "(eval):1: `$#' is not allowed as a global variable name" - that happends when i'm trying to run capture in exec method. wtf? i've got even no idea what's wrong with it :(
[01:40:28] naquad: rushed, i've found out what was going on: i've got SimpleDelegator descendant which sends all missing methods to given object, but the problem is tht capture exists in Kernel and because i've used it in wrong context got this cryptic error. Full trace helped and showed me that exception was raised in some very odd place. thanks :)

2013-11-27

[21:45:05] naquad: is there any alternative to meta_search that is compatible with rails 4?
[21:45:53] naquad: oh cheesus
[21:46:08] naquad: i can't figure out how to use it from client side
[21:52:46] naquad: if there would be some kind of component it would be much easier
[21:52:46] naquad: i've googled, but there are only insane forms (http://ransack-demo.heroku.com/) and insane query format
[21:54:20] naquad: Radar, i need to construct search query from javascript. there's no form (and it can't be added), there's no Ransack::Search object. just plain javascript. and i can't find anything that could help me construct search queries at client side
[21:56:14] naquad: whole my code atm looks like this: render json: Message.search(params[:search]).result(distinct: true) - and thats it. now i'm trying to build a request from client side (javascript)
[22:01:44] naquad: Radar, hell! suffixes! not prefixes! i've been doing cont_name... thanks
[22:06:04] naquad: Radar, mmm then i have another stupid question: how do i scope request? when i do current_user.messages.search(params[:search]).result(distinct: true) i lose user_id condition
[22:27:17] naquad: that where before it). how do i do that?
[22:27:17] naquad: i have a scope which can be optionally applied. the question is: how do i return current scope if nothing need to be applied? e.g. i have a method called optional_where that removes conditions which have blank? value. this is a chain: current_user.messages.where('xyz = ?', 1).optional_where(msg_type: params[:type]) - if i return just self from optional_where (that is static method on Message model) i get just Message class, but i need to return it scoped (

2013-11-18

[22:51:57] naquad: is there any way to make specified filter to be executed first in rails 4?
[22:52:46] naquad: THERE'S NO CODE
[22:53:04] naquad: absolute truth! whole code is: before_filter :my_method
[22:53:12] naquad: but omniauth hijacks request before it hits the filter
[22:53:40] naquad: so what should i do? add another action with wrapper?
[22:54:56] naquad: i need to save a sate why user was sent to omniauth
[22:56:20] naquad: this means that page that sent user to omniauth has a reason why it did it (posting somewhere, changing own profile, etc)
[22:59:21] naquad: Radar, i've solved it with another actions that stores passed param in cookie and then just redirect_to user_omniauth_authentication_path(params[:provider])
[23:00:16] naquad: cookie is pretty much the only option. flash can be non-accurate

2013-11-03

[17:15:50] naquad: is there any sane way to make from "01:05:11" (which is a duration) 3911? atm i have this: duration.split(':').map(&:to_i).reverse.each_with_index.reduce(0) {|s, (v, p)| s + v * 60 ** p }- but it isn't the easiest way definitely
[17:19:08] naquad: 01 hours (= 3600 seconds) + 05 minutes (= 300 seconds) + 11 seconds = 3911
[17:26:43] naquad: PPH, rails has its own helpers. see ActionPack::View::Helpers
[17:27:06] naquad: *ActionView::Helpers
[17:27:44] naquad: PPH, and actually padrino helpers are trying to be look like rails api as much as possible
[17:28:07] naquad: at least that what it was look like when i've been looking at padrino last time
[17:29:59] naquad: rails were long before padrino (same as long before sinatra and rack) and its helpers were kind of first in the ecosystem. there were other frameworks, but they eventually died
[17:30:08] naquad: one got emerged in rails and thats it
[17:33:14] naquad: lethjakman, Time.parse('01:05:15.10') - Time.now.midnight - looks to be it
[17:38:49] naquad: momomomomo, x = Time.parse(duration); x - x.duration is even more readable :)
[17:39:51] naquad: momomomomo, oops, i've meant x - x.midnight
[17:40:19] naquad: momomomomo, nothing happens, because model can't be saved
[17:40:57] naquad: validates :duration, ..., format: { with: /^\d+:\d+:\d+$/ }
[17:41:24] naquad: momomomomo, yup, too much typing. but i get your point. in case if data wouldn't be definitely validated i would go with strptime
[17:48:57] naquad: lethjakman, to_s

2013-11-02

[10:57:33] naquad: i have resources :messages, it makes standard routes like /messages, /messages/:id . i would like it to have optional parameter :provider like this: /messages/(:provider)/:id and /messages/(:provider) - how do i do that?
[11:07:31] naquad: it is optional
[11:09:47] naquad: i can't figure out how to put that :provider into route :(
[11:10:06] naquad: w/o manually writing get/post/delete/... again for whole resource
[11:10:55] naquad: resources :messages
[11:11:21] naquad: sevenseacat, https://gist.github.com/7277845
[11:15:59] naquad: krishna, no. ?--- krz (~foo@unaffiliated/krz) has Quit (Read error: Connection reset by peer)
[11:17:45] naquad: mmm, thanks
[11:17:50] naquad: trying it
[12:08:37] naquad: User.select(:id).where(some conditional).map(&:id) - any better way to write this?
[12:09:01] naquad: instantiating potentially large number of objects just to get 1 field doesn't look to be efficient
[12:11:17] naquad: sevenseacat, thanks! just googled it

2013-11-01

[12:05:44] naquad: is there a :if support in validates_attachment (paperclip)?
[12:06:50] naquad: rvanlieshout, nope. it looks like it is there, but either it has bug or my code has some issue
[12:07:32] naquad: because it works even when if method returns false
[12:08:06] naquad: :asdasdasd worked
[12:14:58] naquad: rvanlieshout, looks like i'm not the only one with such problem: https://github.com/thoughtbot/paperclip/pull/1327 - but they didn't release it. worked with simple validate :file, :attachment_...
[12:18:28] naquad: rvanlieshout, yup
[13:15:33] naquad: did someone here try paperclip-ffmpeg? whenever i upload non-video/image file i get exception. can somehow intercept it and add validation error?
[13:20:36] naquad: ravionrails, yeah, figured it out already. i've added separate statement validates_attachment_content_type :file, :content_type => ...

2013-10-31

[14:43:45] naquad: in rails 4 app i did config.assets.paths << "#{config.root}/vendor/assets/fonts" in application.rb, restarted server, but when i try to get http://localhost:3000/assets/fonts/glyphicons-halflings-regular.eot i get 404 :( what am i doing wrong?
[14:45:22] naquad: Radar, thanks. urls was the issue. also removed config part. works fine
[16:02:23] naquad: in rails 4 i've got define_method in controller, first request works as expected, second one says there's no such method. what the hell?
[16:02:47] naquad: https://gist.github.com/7252243
[16:02:51] naquad: gwillen, ^^
[16:04:19] naquad: gwillen, in gist. also added whats going on in console
[16:13:35] naquad: gwillen, it seems that i've found the problem, but i have no idea how to fix it
[16:13:43] naquad: Networks are initialized from initializer :)
[16:14:05] naquad: and when reload! is issued initializers are not reloaded :(
[16:16:11] naquad: gwillen, when there are changes in files or reload! is issued
[16:26:04] naquad: gwillen, whenever i change something (that is causing reload) initializer is not called and Networks is empty
[16:26:53] naquad: in production reloading is not happenning
[16:53:51] naquad: can i call before_filter with same filter name, but different arguments multiple times? kind of before_filter :xyz, only: [ :method_1]; before_filter :xyz, only: [ :method_2 ]
[16:55:14] naquad: breakingthings, hard to try with my code thats why i ask. i'm walking through dynamically defined methods in loop, don't want to add temporary array
[16:56:11] naquad: how will new controller help me?
[16:57:24] naquad: nevermind, i've added array. looks ugly, but works

2013-10-25

[15:48:00] naquad: is there any way to run validation on object? e.g. i have object x with number of fields and i can do stuff like x.validates_presence_of :a, x.validates_numericality_of :y, x.validates_format_of :z, with: /^\d+$/
[15:48:38] naquad: DouweM, there's no code. i'm asking is it possible or not
[15:49:04] naquad: DouweM, plain class inheriting Object
[15:49:19] naquad: elaptics, *external*
[15:49:32] naquad: there's no X/Y problem here
[15:51:05] naquad: DouweM, mmm where can i read about that Validator object?
[15:52:11] naquad: DouweM, oh, you mean like this. thought it would be an ugly hack... but ok

2013-10-16

[14:07:04] naquad: has anyone tried to make dynamic paperclip styles based on model attributes? i'm getting empty object at the moment of style request
[14:08:16] naquad: universa1, what code? has_attached_file :file, styles: lambda {|a| a.instance.styles }
[14:08:19] naquad: thats whole code
[14:09:59] naquad: i have styles attribute
[14:11:19] naquad: universa1, it returns nil because stupid paperclip tries to get styles before attributes are assigned
[14:11:52] naquad: i've been there
[14:11:57] naquad: and the solutions are not for me
[14:13:40] naquad: universa1, can't be done
[14:14:14] naquad: universa1, because i'm within activeadmin and i can't modify controller action accordingly

2013-10-14

[14:31:24] naquad: how do i run a 3rd party script in rails 3 environment (models, db config, etc..)?
[14:35:34] naquad: terrellt, yup, writing it. bare 3 lines of creating objects from csv file

2013-10-05

[18:16:21] naquad: could somebody point me to document describing new things in rails 4.0 and migration from 3.2?

2013-10-01

[14:42:21] naquad: can i somehow marry rails 4 with eventmachine or have websockets connection pool with messages dispatched to controller calls directly?
[17:25:52] naquad: any benchmarks of rails 4? rails 3 performance sucked
[17:29:12] naquad: compared to rails 3 at least
[17:31:20] naquad: tubbo, i want to see requests per second. does it get to 300 or not. conditions are: retrieving one record from database and displaying as json and as html (two separate actions)
[17:35:22] naquad: tubbo, node sucks. i've tried to implement my project in node at first, but its mysql stuff and database in general suck too much
[17:37:04] naquad: tubbo, not good at docs, not good at supporting things, not good at implementing things (in detail)
[17:41:55] naquad: tubbo, i've looked at go and it looks like i can make my project with it, but the problem is that i don't have enough of go experience :(
[17:44:38] naquad: tubbo, well, its older than year or even 2, but it is still too new imho. i've poked it a bit, looks promising, but i would do production on it right now
[17:45:43] naquad: tubbo, agreed with that
[17:45:57] naquad: geez, what's going on with github? can't get into cancan wiki