alecs

Activity Graph

Page 1 of 2 | Next »

2016-04-26

[07:36:03] alecs: has joined #ruby
[08:12:04] alecs: Remote host closed the connection
[08:56:02] alecs: has joined #ruby
[08:59:57] alecs: Read error: Connection reset by peer
[09:00:36] alecs: has joined #ruby
[09:20:22] alecs: Remote host closed the connection
[10:09:12] alecs: has joined #ruby
[10:09:25] alecs: Remote host closed the connection
[10:09:37] alecs: has joined #ruby

2016-04-25

[14:59:55] alecs: has joined #ruby
[17:15:09] alecs: Remote host closed the connection
[17:15:27] alecs: has joined #ruby
[17:17:07] alecs: Remote host closed the connection

2015-11-04

[07:24:17] alecs: has joined #ruby
[07:24:35] alecs: Client Quit

2015-09-18

[11:06:00] alecs: has joined #RubyOnRails
[11:08:15] alecs: i am using Rails 3.2 and Rspec and i am trying to build a test suite for my app to be able to upgrade ...
[11:08:38] alecs: however, i have few tests that are failing with this message "expected result to have changed by -0.73, but was changed by -0.7300000000000004"
[11:09:01] alecs: "expected result to have changed by -0.73, but was changed by -0.7300000000000004 (RSpec::Expectations::ExpectationNotMetError)"
[11:09:35] alecs: how could i fix this kind of error ?
[11:15:30] alecs: habitullence: i can see that ... but i don't undestand how
[11:15:31] alecs: https://gist.github.com/alecslupu/8396deb90c1e583c6fde
[11:18:07] alecs: Burgestrand: i can see that, but how could i change to make sure is not failing anymore
[11:18:57] alecs: FailBit: ?
[11:19:22] alecs: habitullence: what do u mean ?
[11:20:36] alecs: universa1: is there any way of doiing that automatically ?
[11:23:36] alecs: universa1: to change to what ? i am using mysql and the field type is Decimal(10,2)
[11:24:48] alecs: because the tests were failing before ... with exactly the same error
[11:30:38] alecs: universa1: thank you .... i will try now to run the test suite and see what's happening
[12:14:58] alecs: Ping timeout: 246 seconds

2015-03-26

[19:57:31] alecs: Hello! I am trying to upgrade a rails 3.2 application from ruby 1.9.3 to ruby 2.2, and i get a strange error : "Missing helper file helpers//users/alecslupu/sites/proect_name/app/helpers/proect_name_helper.rb_helper.rb"
[19:57:41] alecs: any ideeas how to fix it ?
[19:59:48] alecs: twilling: using 2.x version: "helper :all" ... if i remove that, i get the exactly same error
[20:00:16] alecs: batasrki: same code runs ~ perfectly on 1.9.3 with no erors
[20:01:43] alecs: batasrki: my real filename is: app/helpers/proect_name_helper.rb should i remove _helper ?
[20:04:01] alecs: batasrki: cannot put gist (internal project)
[20:07:02] alecs: morenoh149: instantiate a new Logger Instance with full path to file as argument in constructor
[20:13:29] alecs: batasrki: i have managed to replicate the error ... here is the code
[20:13:30] alecs: https://github.com/alecslupu/test
[20:26:43] alecs: batasrki: twilling any ideeas for my issue ?
[20:29:33] alecs: batasrki: On that clean project upon the server start i get an error like : Missing helper file helpers//users/alecslupu/sites/*****/testapp/app/helpers/application_helper.rb_helper.rb , however on page refresh it is ok ...
[20:31:32] alecs: weaksauce: what ruby version ?
[20:32:19] alecs: weaksauce: https://gist.github.com/alecslupu/0d572b94202bf6d6ff44
[20:37:25] alecs: weaksauce: strange ... are you using RVM or rbenv ?
[20:49:41] alecs: weaksauce: i think i have fixed it ... 2.2.0 is broken on my comp
[20:51:41] alecs: weaksauce: i know ... i had that segfault myself

2015-02-18

[15:26:06] alecs: any ideea how could i write this as an expression using Arel ?
[15:26:49] alecs: SELECT ROUND(SUM() / SUM()) from ?
[15:27:06] alecs: mostly, i dunno how to do the division part
[15:36:44] alecs: mikecmpbll: thanks

2015-02-08

[20:00:56] alecs: mkc: try http://ruby-toolbox.com
[23:34:42] alecs: fp-: you can make them gems and use it from your private git

2015-02-07

[09:35:13] alecs: I am using a rails 3 app, and i would like setup my app to use multiple Gemfiles. Any ideeas how to do that ?
[09:42:53] alecs: dopie: I have a big GEmfile, and i would like to split it in Test and Production
[09:43:38] alecs: 208 lines
[09:44:29] alecs: But also, i am trying to clean it up., as i have a lot of gems that are commented,
[09:50:12] alecs: sevenseacat: dopie xibalba Thnaks
[09:53:49] alecs: Not opensource
[15:43:41] alecs: BAMbanda: I dunno ... I wonder the same thing
[15:43:50] alecs: arup_r: what do you need ?
[15:47:16] alecs: arup_r: sorry :( ...
[15:51:56] alecs: BAMbanda: depends what is the output of ruby_code
[19:49:52] alecs: Does anyone knows how to use devise for authentication in rspec request specs: i get : " undefined method `env' for nil:NilClass" in "gems/devise-3.4.1/lib/devise/test_helpers.rb:24:in `setup_controller_for_warden"

2015-01-10

[13:11:28] alecs: infoget: use a custom validator
[13:15:35] alecs: infoget: try https://gist.github.com/alecslupu/22111497316d5a860cf8
[13:16:53] alecs: infoget: then : validates :email, presence: true, email_exclusion: true (and ofc, you must be sure is included )
[13:17:14] alecs: infoget: a good place for the file would be in app/validators/
[13:18:36] alecs: Guys, i have a small issue... I am trying to validate an associated model, and in case of errors on the main object, i would like be able to display the errors as json ...
[13:19:59] alecs: I have used validates_associated :my_assoc , but when i call "my_main_object.errors" i only get [my_assoc] => is invalid
[13:21:01] alecs: infoget: sorry, eng is not my rimary lang, can you rephrase ?
[13:21:06] alecs: * primary
[13:22:29] alecs: infoget: you thought on using: http://guides.rubyonrails.org/active_record_validations.html#exclusion ?
[13:29:13] alecs: infoget: Well this is the first thing i thought when i've seen your question :) i am not saying is the best, nor there aren't other versions ... however, i think your request is pretty specific, so, you could use a custom validator , or a custom method to validate the record :)
[13:29:41] alecs: infoget: meaning http://guides.rubyonrails.org/active_record_validations.html#custom-methods
[14:21:40] alecs: tetraktys: Also, you're skipping registration controller (you should not do that)
[14:22:21] alecs: 'cause devise won't generate the routes for registration

2015-01-02

[21:42:57] alecs: Hello! Is there any Gem that i could use to check if my app is upgradable from ruby 1.9.3 to ruby 2.0 ? or 2.2 ?
[21:44:31] alecs: jordanm: thanks, but unfortunately no test suite :|

2014-10-27

[17:12:49] alecs: I have an ecoding problem with my Ruby / Rails app
[17:14:43] alecs: My database stores the correct values using utf8 encoding and utf8_general_ci colation, but when i am trying to fetch results from my database using rails or irb, i get broken chars. Somewhere mysql2 gem or my ruby is performing a second encode('utf-8')
[17:14:47] alecs: any ideeas ?
[17:15:56] alecs: i'm using : Rails 3.2.19, percona mysql + ruby 1.9.3p547
[17:17:34] alecs: workmad3: but what else? My resultset is behaving like i would automatically call "SET NAMES utf8;", however, My General_log, doesn't do that
[17:21:12] alecs: sylvain959: I am running using general_log = ON (all queries logged) but i cannot find any utf8 call. Also, if i run from my mysql console the same query, i get the right result
[17:22:59] alecs: ok, but it would convert the result to utf8 ?
[17:26:39] alecs: sylvain959: Damn... http://www.rubydoc.info/gems/mysql2/0.3.11/file/README.md "It also forces the use of UTF-8 [or binary] for the connection [and all strings in 1.9, unless Encoding.default_internal is set then it'll convert from UTF-8 to that encoding] and uses encoding-aware MySQL API calls where it can."
[17:33:10] alecs: sylvain959: from my understanding mysql2 would force the utf8 encoding when it can ...

2014-08-02

[15:55:25] alecs: can you giime a hint regardin why paperclip saves the attachments in Ddevelopment, but does not saves in production ? The file path is writable by the user, and imagemagick installed
[15:55:35] alecs: however the sile is not saved
[15:56:10] alecs: zly: pastebin or gist your model declaration and controller
[16:05:04] alecs: zly: what your log says ?
[16:07:15] alecs: can you post the log ?
[16:07:29] alecs: zly this is my log stuff https://gist.github.com/alecslupu/107c63559145f05f08c7
[16:09:15] alecs: zly: ok, if i am not helping, then i will stop answer your questions, i have to ask you, because i cannot see your code ... so i need to perform a blind degug
[16:10:35] alecs: zly: I might actually think that you're not sending the right params to your controller, or your sanitizer is not using the right keys ...
[16:10:45] alecs: pontiki: [19:02] <zly> https://gist.github.com/anonymous/dad0cb3adfa5fcdfbdbb

2014-05-24

[17:28:45] alecs: Has anyone tried the combination of "jquery-file-upload", rails 4 and carrierwave ?
[17:31:04] alecs: If i try to send a post with: "picture"=>{"image"=>[#<ActionDispatch::Http::UploadedFile ... ] } }, and i have this kind of permit rule params.require(:picture).permit(:image) , i get "Unpermitted parameters: image "
[17:32:19] alecs: however if i change my strong params to : params.require(:picture).permit(image: []) I do not get the error anymore ... but instead i get a "Validation failed: Image You are not allowed to upload nil files, allowed types: jpg, jpeg, png:" error
[17:32:27] alecs: Any ideeas ?
[17:34:43] alecs: sormontes: this is what i am sending: http://pastebin.com/qS1fdC1G
[17:36:52] alecs: The funny thing is the fact if i am not sending array, is perfect
[17:37:07] alecs: sormontes: i am not sure if the other message reached to you : http://pastie.org/9206998
[17:38:11] alecs: sormontes: to send a hash ?
[17:38:24] alecs: can you gimme an example ?
[17:40:47] alecs: spychalski: maybe you want to put your root link at the end ?
[17:44:14] alecs: sormontes: if i send this : params.require(:picture).permit(image: {}), my error disappears, but the image is not preset
[17:45:58] alecs: dopie, try to : user.letter.destroy , or user.destroy (but add in your association a "dependent: :destroy")
[17:47:03] alecs: ahh ... letter is the file ?
[17:47:25] alecs: dopie: permission errors ?
[17:48:03] alecs: ls -alh on your file ?
[17:48:21] alecs: sormontes: Unpermitted parameters: image...
[17:48:39] alecs: sormontes: now i will try to see if i can help u with your problem
[17:53:55] alecs: letter is the field that holds the image ?
[17:54:09] alecs: sormontes: question : what "console.log(PaymillResponseHandler); " returns ?
[17:54:57] alecs: dopie: and what do you want to achieve by "user.destroy!.letter ?"
[17:56:17] alecs: ok ... so basically want to do user.letter = nil user.save!
[17:56:22] alecs: ^^^ dopie
[17:57:30] alecs: sormontes: maybe because of line 47 in your example ?
[17:59:54] alecs: dopie: check this ::: https://github.com/carrierwaveuploader/carrierwave#removing-uploaded-files
[18:01:21] alecs: sormontes: https://gist.github.com/brabackobama/5d9fa20c6401782a3f3f#file-paymill-js-L47
[18:09:50] alecs: dopie: the filename remained in db ?
[18:12:58] alecs: dopie: are you sure is still in db ? try to do a u.save! then fetch the object from db
[18:13:19] alecs: dopie: by the way are you using "jquery file upload" ?
[18:21:05] alecs: dopie: https://gist.github.com/staycreativedesign/0f895a7bd306839c3c6d
[18:21:22] alecs: sormontes: I have fixed it :)
[18:21:31] alecs: params[:picture][:image] = params[:picture][:image].first if params[:picture] and params[:picture][:image].is_a?(Array) params.fetch(:picture).permit(:image)
[18:23:20] alecs: skyjumper: what do you mean ?
[18:23:37] alecs: sormontes: do you still have any issues ?
[18:24:00] alecs: skyjumper: are you sure you're in dev mode ?
[18:24:45] alecs: then ... sorry, i cannot help you :( i did not encountered that behavior
[18:25:51] alecs: skyjumper: maybe you'd like to check and see if you don't have "config.cache_classes = true " in your config/environments/development.rb file ?
[18:26:53] alecs: skyjumper: new project or legacy from someone else ?
[18:27:52] alecs: skyjumper: maybe someone was smart enough and put that kind of setting somewhere else ?
[18:29:05] alecs: dopie ... save the object
[18:29:37] alecs: u.save after removing for the letter
[18:30:45] alecs: dopie: http://pastie.org/9207117
[18:31:13] alecs: This thing is working on my machine ... also ... u.destroy! will delete your user from db
[18:32:06] alecs: dopie: ^^ + you will have to reload from db because will remain instantiated ... so if you call "u.destroy.letter" will use the old object
[18:33:03] alecs: dopie: what did i put ?
[18:35:25] alecs: dopie: sorry ... typo ...
[18:36:04] alecs: see the last pastie i gave it to you (is from my rails4 + carrierwave + jquery-file-upload)

2014-04-02

[21:01:42] alecs: I have a problem with my app: I am using rails 3.2.17, Delayed Job 3.0.2 and delayed_job_active_record 4.0.0, for some reason, i get : "{undefined method `Method' for #<Class:0x00000007ab58b8>"
[21:02:12] alecs: i a using syck as serializer for both web and delayed jobs

2014-02-25

[10:37:02] alecs: is there any ruby tool that might help me extract hardcoded strings into internationalization keys ?
[10:37:54] alecs: for instance: <h1>Alecs</h1> to be converted in <h1><%= t('string) %></h1>

2013-10-15

[20:49:14] alecs: what gems would you use for a ror application that needs to have replication on db layer ?
[20:49:27] alecs: ** using RoR 3.2.12
[20:52:46] alecs: joelmeador: yes
[20:55:58] alecs: joelmeador: i am looking for replication ... maybe on a controller level would suffice ... I have found octopus .. but does not have the desired behavior (mainly seems to be Bugged, or do not understand AR connections :( )
[20:58:23] alecs: bricker: i have something like 90% reads and 10% writes ... memcaching is also the solution ... however, i need to use replication (to read from a R/O server)
[20:59:36] alecs: tubbo: mysql (i knwo that i could use proxy or Cluster ... ) but is not the case ...
[21:04:29] alecs: bricker: I have a master. slave replication in place ... but how the hell i can read from slave ???? This is my problem ... Also i cannot use app servers with 2 db.yml files, because almost every action has a write ... so i cannot connect directly to slave
[21:05:17] alecs: bricker: i did not said that i need to write twice ... I wnted to say that i need to write in a location and read from another ....

2013-09-11

[14:38:50] alecs: I am having a little problem with a new rails 4 project installation
[14:39:42] alecs: I have chosen to use mysql, and now, when i try to run "rek db:create:all" ... i get thi error : "can't convert nil into String" ...
[14:40:56] alecs: any ideeas how to fix it ? i have tried this : https://github.com/rails/rails/issues/11513 but the error is still there ...
[14:43:22] alecs: mwlang: https://gist.github.com/alecslupu/6524627
[14:43:29] alecs: crankharder https://gist.github.com/alecslupu/6524627
[14:45:28] alecs: workmad3: my bad
[14:46:52] alecs: workmad3: mwlang crankharder i have added as comment my ruby, rails, mysql versions and my gem list ...
[14:50:00] alecs: mwlang: i still have the problem after creating the databases by hand in mysql
[14:51:05] alecs: mwlang: any ideeas ?
[14:54:51] alecs: mwlang: yes ... apparently the problem resides somewehere in mysql2 gem ...last version is : 0.3.13 released in July 17th ... but if i put in my gemfile mysql2 v 0.3.12 it just works ...
[14:55:07] alecs: can anyone confirm this behavior ?
[14:58:56] alecs: mikecmpbll: https://gist.github.com/alecslupu/6524627 I have added my db.yml file ...
[15:06:13] alecs: workmad3: when i am using 0.3.13 i get that error ...
[15:09:34] alecs: mwlang: still does not help it ...
[15:11:11] alecs: mwlang: using "secure_auth: false" in my db.yml file does not solve it ...
[15:12:12] alecs: mwlang: can you reproduce this error ? the bug ?
[15:14:12] alecs: mwlang: then apparently i'm the only one who has the error ... then ... it might be my system ..
[15:16:58] alecs: mwlang: that is me :)
[15:25:22] alecs: mikecmpbll: the issue is on the github, but it is closed ..
[15:28:40] alecs: mikecmpbll: apparently it worked at that time, but now (even after i have copied the database yml from the other project i still get the error ... )
[15:28:59] alecs: mikecmpbll: so that ticket must be reopened ...
[15:30:42] alecs: mikecmpbll: somehow ... /mysql2-0.3.13/lib/mysql2/client.rb:17:in `initialize' the connection parameters the database key is nil ...
[15:33:45] alecs: 4.0.0 ... the stacktrace shows 4.0 as well ...
[15:35:28] alecs: guys... if i go to /mysql2-0.3.13/lib/mysql2/client.rb and before the connect method call in initialize method i raise a opts.inspect ... i get this : {:host=>"localhost", :adapter=>"mysql2", :database=>nil, :password=>"aiurea", :username=>"root", :flags=>2}
[15:35:48] alecs: mikecmpbll: mwlang ^^
[15:43:32] alecs: mwlang: what did you see ? the test result ?
[15:44:27] alecs: mikecmpbll: yes
[15:46:14] alecs: mikecmpbll: aparently no ... i get "can't convert nil into String " ... in the same place
[15:47:20] alecs: mikecmpbll: sorry ... i get that error when running db:migrate
[15:49:52] alecs: connect method is called with the following params: connect user, pass, host, port, database, socket, flags .... i have raised exception on raise [user, pass, host, port, database, socket, flags].inspect .... and got this as an output : ["root", "myPassword", "localhost", 3306, "myProject_development", nil, 2147525127]
[15:50:30] alecs: mikecmpbll: only variable which is nil is my socket (check ^^ )
[15:51:14] alecs: mikecmpbll: yes ...
[15:52:41] alecs: mikecmpbll: if i run "rake db:create" this is my result (after adding sockets to db.yml) ["root", "myPassword", "localhost", 3306, nil, "/tmp/mysql.sock", 2147525127]
[15:53:07] alecs: so, again the DB is empty :|
[15:55:31] alecs: mikecmpbll: apparently always ... i get the db empty ... (i mean i have commented out the socket), not i get ["root", "myPassword", "localhost", 3306, nil, nil, 2147525127]
[15:58:46] alecs: mikecmpbll: Fuck ... i do not have enough experience to fix this bug ...
[16:02:01] alecs: banas: @model.cache_key ?
[16:03:18] alecs: mikecmpbll: thanks ... maybe is my ruby version that is causing problems ?
[16:06:08] alecs: installing 2.0.0-rc2 ...
[16:25:41] alecs: horror, try order("x - #{y}")
[16:27:12] alecs: horrror: however you might wanna try where(x > (10 - y)).order('x') ....
[16:29:22] alecs: horrror: to ptimize your query ... use the second one "move the - y" into the where ... as it will be translated to "SELECT * FROM ... where x > .... ORDER BY x" instead of "SELECT * FROM ... where x > 10 ORDER BY x - y "

2013-07-15

[14:12:04] alecs: i have a model that handles a wizard, and my problem is that this wizard is responsible for 2 different models (2 different steps) . how can i make conditional validation depending on my step ?

2013-06-17

[20:14:33] alecs: LucasTT: no ...
[20:15:35] alecs: LucasTT: there are symbols ( in ruby :symbol ), strings, arrays , hashes ... etc ... but the interesting is there are all objects
[20:16:06] alecs: LucasTT: maybe you mean the fact that there are a lot of guys who are using textmate / sublime or Vim ...
[20:16:37] alecs: There is an IDE named RubyMine ...
[20:17:33] alecs: LucasTT: do you have an other primary language ?
[20:18:02] alecs: LucasTT: i meant primary programming language ?
[20:19:37] alecs: LucasTT: have you any other programming experience ? PHP? Java? ASP ?
[20:21:09] alecs: JimmyAtCMU: somewhere in your model or your code you might have AUD.send :include AUDHelper ... A nobrainer would be to move that method in your model
[20:23:07] alecs: LucasTT: how good do you you know javascript ?
[20:24:15] alecs: LucasTT: Then ... Get a book of basic programming ... a 30 days trial of rubyMine ... then start to work ... but Rails must be ran form a Linux / OSX box
[20:25:43] alecs: ssvo: i think is not ready for Ruby or Pyton ...
[20:26:03] alecs: if you want to learn something easy ... go to PHP ... ( download xampp from http://www.apachefriends.org/en/index.html ) it has a win wersion ...
[20:26:54] alecs: then search on google netbeans (as IDE / GUI ) or plain Dreamweaver ...
[20:28:24] alecs: ssvo: ner0x i use TextMate and sublime ...
[20:29:31] alecs: lantins: maybe you are looking for friendly_id gem ?
[20:31:47] alecs: ssvo: are you doing remote programming :O ...
[20:32:44] alecs: ssvo: youre a geek :)))
[20:34:00] alecs: LucasTT: stilll don't know what are you trying to do :)
[20:36:09] alecs: LucasTT: yeah... that is ok :) if you are going to do Frontend developement ... :P it get's tricky when you switch to server side ... but i don't wanna scary you
[20:41:06] alecs: LucasTT: if you are a designer ... then start learning javascript ... try to learn frontend programming (Javascript) ... after that move to backend (php, Ruby, Java, etc ) ... for your needs i think javascript is the best at this very moment ...
[20:42:01] alecs: scyllinice: maybe index.html ?
[20:42:57] alecs: LucasTT: then LEARN javascript ... Then Node .... Node is primarily javascript ...
[20:45:07] alecs: well ... as long you don't start to code using the editor, you won't be able to learn just by clicking buttons ...
[20:46:06] alecs: Eiam: that is what i said to him :P
[20:46:38] alecs: LucasTT: Try this: Get your friend, give him a beer ... and then ask him to configure your machine ... to use node ... then start making a blog app ... or something ...
[20:47:28] alecs: Eiam: *** windows
[20:49:03] alecs: Eiam: allways i recommend to RTFM ... :) if he comes to me and says he read kamasutra ... i'll know he's not ready =))
[20:50:07] alecs: Eiam: first i have recomended php with binaries from xampp
[20:52:45] alecs: LucasTT: as you wish
[20:53:33] alecs: lantins: in your cosole type: "rake routes" to see your routes ... maybe it will help you
[20:58:05] alecs: Apane: http://railscasts.com/episodes/168-feed-parsing?view=asciicast
[20:59:12] alecs: Guys, can you gimme a hint on this ? https://gist.github.com/anonymous/99fe3274c4a9aab1979c
[20:59:55] alecs: i am trying to translate my validation messages ... however .. it seems that there is a problem .. .
[21:01:22] alecs: lantins: cool then ... let's beak it now :D try a subdomain :P