yottanami

Activity Graph

Page 1 of 5 | Next »

2019-08-09

[10:31:15] yottanami: has joined #ruby
[10:32:01] yottanami: I want to create a new game that the name contains dash character and it creates a directory in another. is anyway to disable this feature?
[10:45:15] yottanami: tobiasvl, I just need initialize a simple CLI ruby application but the problem is the name of the project contains dash `-` and using `bundle gem` it converts each dash to a subdirectory
[10:45:51] yottanami: tobiasvl, for example `bundle gem test-project` will crate lib/test/project
[11:08:51] yottanami: Ping timeout: 248 seconds
[11:12:48] yottanami: has joined #ruby
[12:13:27] yottanami: Remote host closed the connection

2019-05-22

[11:28:49] yottanami: has joined #RubyOnRails
[11:29:56] yottanami: How can I use `Rails::Generators.invoke ..., :behavior => :revoke` for destroying a generator of a Gem?
[11:44:10] yottanami: Something like this: ` Rails::Generators.invoke 'devise:install', :behavior => :revoke`
[13:31:04] yottanami: Remote host closed the connection

2019-05-20

[10:26:46] yottanami: has joined #RubyOnRails
[10:29:11] yottanami: I am trying to write a custom generator. Is anyway to add a generator template file into an existing class?
[10:30:33] yottanami: Something like inject_into_file but accept a template file except a striing variable
[13:21:38] yottanami: Remote host closed the connection

2019-01-23

[09:44:44] yottanami: has joined #RubyOnRails
[09:45:46] yottanami: Is it a good idea to use Active Storage for local disk and not any cloud storage service in production?
[11:34:28] yottanami: Remote host closed the connection
[11:34:46] yottanami: has joined #RubyOnRails
[14:21:59] yottanami: Remote host closed the connection
[14:22:21] yottanami: has joined #RubyOnRails
[14:22:28] yottanami: Remote host closed the connection

2018-11-26

[06:47:10] yottanami: has joined #RubyOnRails
[06:47:47] yottanami: Is there any solution to create an automatic REST api from model entities?
[07:31:20] yottanami: dionysus69, Does Scaffolds helps to create REST API?
[15:08:16] yottanami: Quit: Leaving

2018-07-29

[06:18:50] yottanami: has joined #RubyOnRails
[06:20:52] yottanami: I have a project on a docker and trying to access it using nginx as proxy. the problem is the header in docker is 127.0.0.1:3020 but I access it using a domain
[06:21:21] yottanami: so I got this error HTTP Origin header (http://mydomain.com )didn't match request.base_url (http://127.0.0.1:3010)
[06:21:31] yottanami: ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)
[06:21:59] yottanami: I also tried to use `protect_from_forgery with: :null_session` but I got error yet, how can I fix it?
[12:42:36] yottanami: Quit: Leaving

2018-07-28

[11:21:19] yottanami: has joined #RubyOnRails
[11:24:10] yottanami: I am trying to use my project on production but I got this error
[11:24:26] yottanami: .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x000055e9b3429350>
[11:24:34] yottanami: What is the reason?
[12:02:07] yottanami: tbuehlmann, No, I dont thing so
[14:04:27] yottanami: tbuehlmann, I fixed the problem it was because of creating database
[14:04:54] yottanami: Now the problem is my project can not create session when I am using chrome but it works on firefox
[14:05:23] yottanami: I think it is because I am using a docker and using a proxy on web server
[14:33:07] yottanami: Quit: Leaving

2018-07-07

[07:07:56] yottanami: has joined #RubyOnRails
[07:08:40] yottanami: Is anyway to handle this query using rails orm? `select user_id,sum(score) as rank from leaders group by user_id order by rank desc`
[07:13:26] yottanami: tbuehlmann, tnx
[07:28:58] yottanami: tbuehlmann, I tried the query but I got this error `ActiveRecord::StatementInvalid (PG::WrongObjectType: ERROR: WITHIN GROUP is required for ordered-set aggregate rank)`
[07:29:07] yottanami: LINE 1: ...M "leaders" GROUP BY "leaders"."user_id" ORDER BY "leaders"....
[07:35:46] yottanami: LINE 1: SELECT COUNT(user_id, SUM(score) AS rank) AS count_user_id_...
[07:35:46] yottanami: tbuehlmann, ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "AS")
[08:02:20] yottanami: tbuehlmann, you mean removing sum? but the sum of scores is important for me
[13:19:29] yottanami: Quit: Leaving

2018-07-04

[05:37:43] yottanami: has joined #RubyOnRails
[05:40:19] yottanami: Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
[05:40:19] yottanami: I am trying to create a cronjob using whenever gem. it created this job in crontab `/bin/bash -l -c 'cd /var/www/pabetoop && RAILS_ENV=production bundle exec rake board:update --silent` now the problem is I got bundler: failed to load command: rake (/usr/local/bin/rake)
[05:40:37] yottanami: I am trying this in a git container and I have rake in my Gemfile
[05:41:10] yottanami: I also tried to change the bundle path to --path vendor/cache
[07:18:33] yottanami: Ping timeout: 256 seconds

2018-07-02

[09:42:07] yottanami: has joined #RubyOnRails
[09:42:39] yottanami: I am trying to create a cron job using whenever gem it creates this job /bin/bash -l -c 'cd /var/www/pabetoop && RAILS_ENV=production bundle exec rake board:update --silent
[09:42:57] yottanami: But the problem is I got this error Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
[10:39:35] yottanami: Ping timeout: 276 seconds

2018-07-01

[06:51:47] yottanami: has joined #RubyOnRails
[12:36:04] yottanami: I just created a job using active job and trying to run it using whenever gem
[12:36:22] yottanami: but it seems it can not access models and active model
[12:36:36] yottanami: how should I include it?
[12:52:03] yottanami: Quit: Leaving

2018-06-26

[06:52:14] yottanami: has joined #RubyOnRails
[06:52:44] yottanami: Here is my query, but I got syntax error: ` Bet.joins(:game).where("games.expire_date > bets.created_at").where("(games.team1_score \ NULLIF(bets.team1_score, 0)) = (games.team2_score \ NULLIF(bets.team2_score, 0)").where("games.team1_score <> bets.team1_score and games.team2_score <> bets.team2_score")
[06:52:57] yottanami: What is going wrong?
[07:27:10] yottanami: It seems I can not use divide using `\` in active model. How should I use divide in different way?
[13:05:49] yottanami: Quit: Leaving

2018-06-18

[11:46:31] yottanami: has joined #RubyOnRails
[11:47:56] yottanami: I am trying to deploy a api-only Rails 5 project using Capistrano after the deploy there is no public directory and so I got 404 error. Is it because my project is api-only or it is because of passenger setting?
[12:33:08] yottanami: jlebrech, No, after deploy. when I trying to brows. it is trying to find public directory but there is no public directory
[12:38:32] yottanami: jlebrech, It is ok on development version on local machine but on production I just got that error
[12:45:24] yottanami: Here is the only production log http://dpaste.com/219CA9S
[13:01:15] yottanami: jlebrech, No, it seams web server can not call the app
[13:01:27] yottanami: here is the output of capistrano http://dpaste.com/115TX5S
[13:04:07] yottanami: jlebrech, cors?
[13:23:46] yottanami: Ping timeout: 264 seconds

2018-06-17

[06:40:34] yottanami: has joined #RubyOnRails
[06:40:50] yottanami: How can I change this query to works? `Bet.joins(:game).where(game.expire_date > :created_at)`
[06:49:55] yottanami: Radar, the time of creating the table
[06:51:10] yottanami: Radar, Game and Bet are two different tables, Bet belongs_to Game and Game has_many Bets. Game has a field named expire_date. I need find Bets that created_at after expire_date of game
[06:54:34] yottanami: Radar, Thanks
[06:58:54] yottanami: Radar, is there any chance to change created_at + 2.hours in coundition?
[14:18:02] yottanami: Remote host closed the connection

2018-06-11

[13:40:21] yottanami: has joined #RubyOnRails
[13:41:02] yottanami: I am trying to deploy a production version of my project using Docker but I got this error http://dpaste.com/3RRCGXH how should I fix it?
[13:51:51] yottanami: It is trying to call `has_one_attached` from a class!
[14:46:22] yottanami: Quit: Leaving

2018-05-30

[07:02:58] yottanami: has joined #RubyOnRails
[07:08:28] yottanami: Here is my Concern methods https://github.com/yottanami/indie-otp/blob/master/lib/user_helper.rb and I am trying to call the method in my main app so I used it like this http://dpaste.com/0MZGRPC but the current_user is undefined.
[07:14:01] yottanami: sevenseacat, I also tried change it to this http://dpaste.com/1M4RS4R but does not work yet and There is no error during include
[07:20:20] yottanami: Ping timeout: 260 seconds
[07:23:38] yottanami: has joined #RubyOnRails
[07:23:50] yottanami: sevenseacat, Sorry I disconnected
[07:25:47] yottanami: sevenseacat, Did I miss your message?
[07:26:13] yottanami: Do you have any idea how can I solve it?
[07:32:03] yottanami: Remote host closed the connection
[07:37:58] yottanami: has joined #RubyOnRails
[07:50:48] yottanami: tbuehlmann, Thanks for your help, I moved the module to sub directories it seems there is no problem during include but current_user is undefined yet
[07:59:48] yottanami: tbuehlmann, sure let me push it
[08:05:42] yottanami: tbuehlmann, Here is the module https://github.com/yottanami/indie-otp/blob/master/lib/indie/otp.rb and here is the controller https://gist.github.com/yottanami/85de2d8bdc7b084b6ac991e83eb368b4
[08:09:50] yottanami: tbuehlmann, it was for the previews module that I removed
[08:10:04] yottanami: tbuehlmann, I just need to use current_user from that Gem
[08:10:27] yottanami: tbuehlmann, Now should I include it in my controller?
[08:11:30] yottanami: should it be concern?
[08:17:54] yottanami: tbuehlmann, It is in my engine, and I need to use it in main application controllers
[08:18:01] yottanami: tbuehlmann, you can see the whole project here: https://github.com/yottanami/indie-otp/
[08:27:24] yottanami: tbuehlmann, You mean I need something like this in my controller? `include Indie::Otp`
[08:28:59] yottanami: tbuehlmann, Yes it works in this way. thank you very much
[09:37:25] yottanami: Ping timeout: 260 seconds

2018-05-29

[10:22:12] yottanami: has joined #RubyOnRails
[10:23:00] yottanami: How can I access an action from application controller of a Gem?
[10:23:29] yottanami: for example how can I access current_user from this controller http://dpaste.com/15H7VMW
[10:24:00] yottanami: I also can move these actions to another controller and it is not important for me to be in ApplicationController
[12:13:25] yottanami: Ping timeout: 256 seconds

2018-05-26

[10:01:02] yottanami: has joined #RubyOnRails
[10:07:14] yottanami: I am trying to authenticate user by text message, using `active_model_otp` gem now I want know is it safe to put user id in cookie to remember login?
[10:22:42] yottanami: Ping timeout: 245 seconds
[10:32:49] yottanami: has joined #RubyOnRails
[10:46:35] yottanami: tbuehlmann, What about create a hash for each user and put it in database? and use it as user token?
[10:48:49] yottanami: tbuehlmann, So how can I make it secure?
[10:50:41] yottanami: tbuehlmann, even if the expire time is long? for example more than 30 days?
[10:54:14] yottanami: tbuehlmann, Should I use an specific encryption method?
[10:55:03] yottanami: tbuehlmann, and how check it when it is encrypted and is not encoded? how figure out the user id?
[10:57:10] yottanami: tbuehlmann, Sorry, I can not understand what do you mean by #session? do you mean using ActionDispatch::Session::CookieStore ?
[10:57:30] yottanami: tbuehlmann, Is it diffrent from cookie['']
[10:59:11] yottanami: tbuehlmann, As I know session will save on server and I can not use it for long term, is it right?
[11:03:27] yottanami: tbuehlmann, So if it will encrypt it automatically and has a expire date by default should I just set session[user.id]
[11:03:33] yottanami: Am I right?
[11:08:00] yottanami: tbuehlmann, In this tutorial I can not understand why it used cookie https://github.com/lvnilesh/rails-tutorial-markdown/blob/master/8-sign-in-sign-out.md#821-remember-me
[11:13:06] yottanami: Remote host closed the connection
[11:13:29] yottanami: has joined #RubyOnRails
[11:15:06] yottanami: tbuehlmann, You mentioned I can handle `remember me` by using session but it that example mentioned that if need to remember password you should use cookie['']
[11:26:45] yottanami: tbuehlmann, What is the different when session can store for long time?
[11:37:06] yottanami: Remote host closed the connection
[11:44:06] yottanami: Remote host closed the connection
[11:44:06] yottanami: has joined #RubyOnRails

2018-05-23

[10:05:38] yottanami: has joined #RubyOnRails
[10:08:01] yottanami: Remote host closed the connection
[10:08:01] yottanami: How can I fix it?
[10:08:01] yottanami: I created a new mountable engine but the problem is controllers are not load the main application_controller and also can not load main layout here is the application controller of the Gem https://github.com/yottanami/indie-otp/blob/master/app/controllers/indie/otp/application_controller.rb
[10:10:17] yottanami: has joined #RubyOnRails
[10:42:25] yottanami: Ping timeout: 252 seconds

2018-05-19

[09:22:37] yottanami: has joined #RubyOnRails
[09:23:01] yottanami: I tried to generate an scaffold it just show text box for a relation (refrences). Is any solution to generate a drop down list in ui for one to many relations automatic?
[09:27:08] yottanami: Remote host closed the connection

2018-04-10

[07:13:56] yottanami: has joined #ruby
[07:14:08] yottanami: Is any chance to use raw query in Mongoid?
[07:14:16] yottanami: I need to run a query like this db.users.find({"rounds.score": 20}, {"phone_number": 1, "rounds": { $elemMatch: { score: 20 } }})
[08:32:24] yottanami: Quit: Leaving

2018-02-04

[08:44:37] yottanami: has joined #ruby
[10:53:47] yottanami: What is correct way to create this string? "#{item["PLZ"]}, #{item["Strasse"]}, #{item["ORT"]}"
[13:53:11] yottanami: Quit: Leaving

2018-02-03

[14:17:18] yottanami: has joined #ruby
[14:17:53] yottanami: I am trying to read a csv file using ```CSV.foreach('filialstamm.csv', :row_sep => "\n", :col_sep => ";", encoding: 'ISO8859-1', skip_blanks: true, headers: true) do |row|...``` but I got this error Unquoted fields do not allow \r or \n (line 1)
[14:19:06] yottanami: first line is like this `Item1;Item2;Filialname;Strasse;PLZ ;ORT
[14:22:27] yottanami: apeiros, I am not sure, someone else sent it to me.I also tried row_sep: :auto and '\r\n'
[14:24:00] yottanami: apeiros, I also tried "\r\n" and "\r"
[14:24:33] yottanami: apeiros, I can open the file in libreoffice without any problem
[14:26:48] yottanami: apeiros, This is first part of my file http://dpaste.com/2JVEV1D
[14:29:50] yottanami: apeiros, here is the complete file https://expirebox.com/download/11f0e3c175781e48bb4b70822971fec2.html
[14:32:06] yottanami: apeiros, So, How should I parse it?
[14:32:32] yottanami: I also tried using `skip_blanks: true`
[14:33:50] yottanami: apeiros, But when I use utf-8 I got this error ``=~': invalid byte sequence in UTF-8 (ArgumentError)`
[14:36:39] yottanami: apeiros, :-( Any chance to parse?
[14:39:20] yottanami: apeiros, wow it works, thank you very much. it was a big help
[14:39:34] yottanami: apeiros, lol. Sure.
[14:53:43] yottanami: Quit: Leaving

2018-02-02

[09:05:41] yottanami: has joined #ruby
[09:30:48] yottanami: Ping timeout: 252 seconds

2018-02-01

[22:22:10] yottanami: has joined #ruby
[23:11:45] yottanami: Ping timeout: 264 seconds

2017-12-24

[06:58:12] yottanami: has joined #RubyOnRails
[13:38:04] yottanami: Quit: Leaving

2017-12-19

[07:23:49] yottanami: has joined #RubyOnRails
[07:25:14] yottanami: I am trying to deploy project on prodution it seems precompile works currectly project can load css file but I got 404 during load js file
[07:46:53] yottanami: pwnd_nsfw, actually I have problem in loading uglified version of application.js
[07:47:37] yottanami: ..../assets/application-5d2cc9b6ed0970834c28f80c6e2449c7f4b225372d4832c8f64fb2331252f53b.js 404 (Not Found)
[07:51:53] yottanami: pwnd_nsfw, Unfortunately it is on a private network but I can share a file if it helps
[07:52:58] yottanami: pwnd_nsfw, Here are assets and env files http://dpaste.com/2MWXK0X http://dpaste.com/3BX1DNE
[07:53:33] yottanami: pwnd_nsfw, It is <%= javascript_include_tag 'application' %>
[09:06:46] yottanami: I am using docker and the wired that css loads completed in production but can not find js manifest file
[09:21:49] yottanami: error in log file is here
[09:22:03] yottanami: F, [2017-12-19T09:21:19.207636 #1] FATAL -- : [8bf8e6ce-e0c6-40cc-b79b-de495fec5834] ActionController::RoutingError (No route matches [GET] "/assets/application-5d2cc9b6ed0970834c28f80c6e2449c7f4b225372d4832c8f64fb2331252f53b.js"):
[10:30:30] yottanami: dminuoso, It creates a volume and it seams file exists in directory even css can works without any problem
[10:33:54] yottanami: dminuoso, maybe file is not generating
[10:34:27] yottanami: dminuoso, Here are assets and env files http://dpaste.com/2MWXK0X http://dpaste.com/3BX1DNE
[10:36:08] yottanami: dminuoso, I use nginx to handle it and here is the config http://dpaste.com/3WAPY6C
[10:36:41] yottanami: dminuoso, but how it load css content?
[10:37:39] yottanami: dminuoso, I think the js file is not generated
[10:44:10] yottanami: dminuoso, I was wrong the file is not there and it was the oldest version file
[10:44:21] yottanami: I mean older docker images
[10:49:05] yottanami: dminuoso, Yes, I tried to rebuild and precompile, logs shows it is working on js files but I can not find the .js file with the hash that browser is trying to find
[12:18:24] yottanami: dminuoso, I removed the assets volume from docker and now it works correctly
[12:18:42] yottanami: dminuoso, But it save assets inside docker
[14:27:43] yottanami: Ping timeout: 265 seconds

2017-12-16

[06:28:19] yottanami: has joined #RubyOnRails
[06:28:53] yottanami: After a deployment I got this error message unable to open image `public/emails/57a28fe86290da21c255086c84d196d9.jpg': @ error/blob.c/OpenBlob/2587 how should I fix it?
[08:03:08] yottanami: I am trying to precompile my project but I got this error 'Sass::SyntaxError: Undefined variable: "$alert-padding".'
[08:03:50] yottanami: I tried to change the `Rails.application.config.assets.precompile` to = %w( *.css *.js ) but I have error yet
[09:02:04] yottanami: I fixed it by adding *.scss to assets compile list
[14:08:45] yottanami: Ping timeout: 264 seconds

2017-12-02

[05:52:18] yottanami: has joined #RubyOnRails
[05:53:01] yottanami: I need to use a MongoDB in my Rails project that I did not generated, Is anyway to create model from exists collection?
[10:25:42] yottanami: Here are my params http://dpaste.com/2EWP0FX how can I use strong_parameter to access :choice items?
[11:55:17] yottanami: Read error: Connection reset by peer

2017-11-29

[08:38:49] yottanami: has joined #RubyOnRails
[08:39:21] yottanami: I am using Monoid as ORM
[08:39:42] yottanami: Now how should I create my collection in DB?
[08:40:14] yottanami: when I try to create I got this error http://dpaste.com/3M5T898
[08:40:44] yottanami: should I include Mongoid::Attributes::Dynamic ?
[08:41:29] yottanami: Sorry the error is here http://dpaste.com/1H446CC
[13:30:56] yottanami: Quit: Leaving

2017-11-28

[09:12:30] yottanami: has joined #RubyOnRails
[09:14:43] yottanami: I need to connect to a MongoDB without model. I tried using `Mongoid::Sessions.default` but Sessions does not exists
[09:15:37] yottanami: I can access database using `Mongoid::Clients.default` but using this method limits collection queries for example I do not have .all
[13:41:37] yottanami: Ping timeout: 268 seconds

2017-11-26

[11:49:52] yottanami: has joined #RubyOnRails
[11:50:27] yottanami: Hey all. Is any way to use two ORM (Default and Mongoid) in different methodes?
[13:35:17] yottanami: Ping timeout: 260 seconds

2017-11-11

[09:08:28] yottanami: has joined #RubyOnRails
[09:09:29] yottanami: I have `:dependent => :destroy` in one of my models. now it destroied the records because of this relation. is it anyway to undelete?
[12:07:21] yottanami: Ping timeout: 240 seconds

2017-10-31

[09:19:29] yottanami: has joined #ruby
[09:20:10] yottanami: Whatis the different between def class_name.method_name and def method_name in Ruby?
[12:23:13] yottanami: Is any way to do sum two numbers without removing zeroes before each number? for example 002 + 1 = 003
[12:51:58] yottanami: Ping timeout: 255 seconds
[17:44:43] yottanami: has joined #ruby
[17:48:58] yottanami: Ping timeout: 255 seconds

2017-10-25

[20:50:35] yottanami: has joined #ruby
[20:51:12] yottanami: Is any way to step by step debug just current file using byebug?
[20:51:45] yottanami: I mean do not go to other files and back when another method calls
[21:09:30] yottanami: Ping timeout: 246 seconds

2017-06-17

[16:57:57] yottanami: Ping timeout: 240 seconds