voidDotClass

Activity Graph

Page 1 of 4 | Next »

2016-07-31

[14:18:36] voidDotClass: has joined #RubyOnRails
[14:20:09] voidDotClass: I need to override the styles found in /home/ali/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bootstrap-sass-3.3.6/assets/stylesheets/bootstrap/_modals.scss , any idea how to do that?
[15:22:40] voidDotClass: Ping timeout: 264 seconds

2016-07-26

[15:10:17] voidDotClass: has joined #RubyOnRails
[15:12:49] voidDotClass: Remote host closed the connection
[17:13:52] voidDotClass: has joined #RubyOnRails
[17:17:33] voidDotClass: I have a date like this: '12/28/2015 11:15:20 AM', I'm trying to parse that into a date but not having much luck. Trying this: DateTime.strptime(s,'%m/%d/%y H:%M:%s %p') but it gives 'Invalid date'
[17:20:05] voidDotClass: Anyone able to help me?
[17:20:27] voidDotClass: has joined #ruby
[17:20:39] voidDotClass: I have a date like this: '12/28/2015 11:15:20 AM', I'm trying to parse that into a date but not having much luck. Trying this: DateTime.strptime(s,'%m/%d/%y %H:%M:%s %p') but it gives 'Invalid date'
[17:25:21] voidDotClass: USvER, that works, what did you change? I know I needed %H
[18:39:28] voidDotClass: Ping timeout: 264 seconds

2016-06-30

[00:20:29] voidDotClass: has joined #RubyOnRails
[00:39:30] voidDotClass: I have an item called Product and ProductData. A product can have multiple ProductData (has_many :product_data). I'm doing a query like: Product.joins(:product_data).where(product_data: {marketplace_id: market_id}). This obviously does a join query and returns those products who have data for the marketplace xxx. Problem is, if I'm later looping over the results, and i try to access product.product_data, it does a second query like Select * from pro
[00:39:31] voidDotClass: duct_data where product_id = xxx. Why can't it cache the results from the prev query and return that?
[02:08:39] voidDotClass: Ping timeout: 276 seconds
[02:09:12] voidDotClass: has joined #RubyOnRails
[10:19:23] voidDotClass: Read error: Connection reset by peer
[10:33:50] voidDotClass: has joined #RubyOnRails
[11:36:45] voidDotClass: Ping timeout: 276 seconds

2016-06-24

[12:48:39] voidDotClass: has joined #RubyOnRails
[12:50:00] voidDotClass: If I'm requiring a css file via app.css (assets pipeline), and the css file refers to foo.png which is the same directory as the css file (app/assets/styles/foo.png), will that work or would i need to do something else to get them to work?
[12:56:01] voidDotClass: Ping timeout: 244 seconds
[13:08:26] voidDotClass: has joined #RubyOnRails
[18:06:03] voidDotClass: Ping timeout: 240 seconds
[18:19:44] voidDotClass: has joined #RubyOnRails
[19:00:40] voidDotClass: Ping timeout: 252 seconds
[19:12:53] voidDotClass: has joined #RubyOnRails
[21:16:31] voidDotClass: Ping timeout: 240 seconds
[21:22:06] voidDotClass: has joined #RubyOnRails

2016-06-23

[00:23:48] voidDotClass: Is it possible to delete the migration history for a project and start over?
[00:25:06] voidDotClass: jhass no i manually deleted all my current tables
[00:25:09] voidDotClass: want to start over
[00:25:45] voidDotClass: havenwood, will that also make it stop telling me i haven't run migrations?
[00:25:55] voidDotClass: there are some migrations i've made but not run, its messy
[00:26:02] voidDotClass: havenwood, i don't want to
[00:26:08] voidDotClass: i have pending migrations i don't want to run
[00:26:13] voidDotClass: i want to start over
[00:26:30] voidDotClass: jhass, just deleting db/migration/* will fix it?
[09:15:18] voidDotClass: Ping timeout: 244 seconds
[09:28:17] voidDotClass: has joined #RubyOnRails
[11:56:02] voidDotClass: Ping timeout: 260 seconds
[12:07:57] voidDotClass: has joined #RubyOnRails
[21:15:06] voidDotClass: Ping timeout: 246 seconds
[21:28:50] voidDotClass: has joined #RubyOnRails
[21:58:25] voidDotClass: Ping timeout: 252 seconds
[22:10:44] voidDotClass: has joined #RubyOnRails
[23:43:59] voidDotClass: Ping timeout: 244 seconds

2016-06-22

[12:14:31] voidDotClass: has joined #RubyOnRails
[12:22:59] voidDotClass: Ping timeout: 260 seconds
[12:35:16] voidDotClass: has joined #RubyOnRails
[21:15:46] voidDotClass: Ping timeout: 272 seconds
[21:28:37] voidDotClass: has joined #RubyOnRails
[21:58:37] voidDotClass: Ping timeout: 244 seconds
[22:11:10] voidDotClass: has joined #RubyOnRails

2016-06-18

[06:07:25] voidDotClass: has joined #RubyOnRails
[10:54:56] voidDotClass: Ping timeout: 272 seconds

2016-06-16

[05:48:21] voidDotClass: Ping timeout: 258 seconds
[06:00:30] voidDotClass: has joined #RubyOnRails
[09:50:24] voidDotClass: Ping timeout: 276 seconds
[10:03:13] voidDotClass: has joined #RubyOnRails
[20:05:57] voidDotClass: Ping timeout: 276 seconds

2016-06-15

[08:42:21] voidDotClass: Ping timeout: 250 seconds
[08:56:08] voidDotClass: has joined #RubyOnRails
[09:49:21] voidDotClass: Ping timeout: 240 seconds
[10:02:37] voidDotClass: has joined #RubyOnRails
[21:49:42] voidDotClass: Ping timeout: 244 seconds
[22:04:22] voidDotClass: has joined #RubyOnRails

2016-06-14

[12:18:46] voidDotClass: has joined #RubyOnRails
[12:18:58] voidDotClass: How do I set foreign key checks to 0 in a migration which deletes a table
[12:20:32] voidDotClass: n_e_o, cuz i dont want my rails migrations to break?
[12:24:53] voidDotClass: n_e_o, yeah, i need to be able to run some migrations on dev and prod
[13:21:03] voidDotClass: n_e_o, there's no schema dump, i'd like to migrate via rake db:migrate
[13:29:06] voidDotClass: Is this the correct way to add a decimal column to a migration? t.decimal :size, precision: 5, scale: 2
[21:49:46] voidDotClass: Ping timeout: 258 seconds
[22:03:00] voidDotClass: has joined #RubyOnRails

2016-05-28

[04:32:57] voidDotClass: Ping timeout: 244 seconds

2016-05-27

[20:59:40] voidDotClass: has joined #RubyOnRails
[21:00:52] voidDotClass: I need to populate my db with some test data, but I don't want to run seed.rb as that also clears existing data (right?). Is it possible to write a one off script and run that?
[21:01:36] voidDotClass: Its not for testing purposes
[21:01:43] voidDotClass: Its not for testing, sorry.
[21:01:51] voidDotClass: It needs to go into the prod db
[21:02:42] voidDotClass: norc, for the 2nd option, 1) where would i put that script, same loc as seed.rb? 2) what's the command to execute it with the rails runner?
[21:03:45] voidDotClass: norc, how do you run them?
[21:03:50] voidDotClass: i don't want to do a rake task
[21:04:38] voidDotClass: norc, that one shows docs for rails new <AppName>
[23:34:24] voidDotClass: Ping timeout: 276 seconds
[23:46:21] voidDotClass: has joined #RubyOnRails

2016-05-20

[01:41:22] voidDotClass: Ping timeout: 252 seconds
[01:54:00] voidDotClass: has joined #RubyOnRails
[08:37:51] voidDotClass: Ping timeout: 276 seconds
[08:50:56] voidDotClass: has joined #RubyOnRails
[11:43:55] voidDotClass: Ping timeout: 244 seconds
[11:55:57] voidDotClass: has joined #RubyOnRails
[15:48:23] voidDotClass: Remote host closed the connection

2016-05-19

[12:28:29] voidDotClass: has joined #RubyOnRails
[12:28:54] voidDotClass: Is it possible to do a query like where('student.school = ' , school)?
[12:29:31] voidDotClass: Inside a scope?
[12:33:42] voidDotClass: this isn't working: scope :reviewable, -> (city, school) { where(city: city, status: REVIEWING).where(student: {school: school}) unless team.nil? }
[12:36:42] voidDotClass: isnt querying on the school table. i had to add a join
[12:38:12] voidDotClass: i prefer chaining
[12:38:17] voidDotClass: this is what i had to end up doing:
[12:38:52] voidDotClass: scope :reviewable, -> (city, school) { where(city: city, status: REVIEWING).where('students.school_id = ?', school.id).joins(:student)
[12:39:00] voidDotClass: any suggestions to clean it up appreciated
[16:43:59] voidDotClass: Ping timeout: 260 seconds
[16:56:30] voidDotClass: has joined #RubyOnRails
[18:51:22] voidDotClass: Ping timeout: 260 seconds
[19:03:35] voidDotClass: has joined #RubyOnRails
[20:36:34] voidDotClass: Ping timeout: 240 seconds
[20:49:43] voidDotClass: has joined #RubyOnRails

2016-05-15

[20:49:53] voidDotClass: has joined #RubyOnRails
[20:50:08] voidDotClass: When you run rake db:<anything>, the default is to use the dev env, right?
[20:50:30] voidDotClass: Good. I nearly had a heart attack.
[20:50:39] voidDotClass: Ran rake:db reset
[20:50:46] voidDotClass: thought it may have run on prod.
[20:51:00] voidDotClass: What's the default alfie_max15, i didn't change the defaults
[20:56:51] voidDotClass: Ping timeout: 276 seconds

2016-05-05

[04:37:51] voidDotClass: How can I have all emails be printed to console during tests?
[08:34:12] voidDotClass: Ping timeout: 246 seconds
[08:34:37] voidDotClass: has joined #RubyOnRails
[08:34:37] voidDotClass: has joined #ruby
[10:58:24] voidDotClass: Ping timeout: 246 seconds
[11:11:23] voidDotClass: has joined #RubyOnRails
[11:11:23] voidDotClass: has joined #ruby
[11:45:14] voidDotClass: Remote host closed the connection

2016-05-04

[10:14:39] voidDotClass: has joined #RubyOnRails
[10:15:52] voidDotClass: If I have a db column of the type Date, and I'm getting date in the form of unix timestamp milliseconds from client side, should I convert that to Date via Date.strptime(sec, '%s') before saving it in db?
[10:17:24] voidDotClass: If I have a db column of the type Date, and I'm getting date in the form of unix timestamp milliseconds from client side, should I convert that to sec = millis / 1000, Date via Date.strptime(sec, '%s') before saving it in db?
[10:18:11] voidDotClass: sevenseacat, can you answer my q?
[10:18:51] voidDotClass: whats not causing problems
[10:19:39] voidDotClass: sevenseacat, i'm not doing anything, i just want to know how i should save incoming unix timestamp milliseconds into a date column in the db
[10:19:52] voidDotClass: should i convert it to Date using Date.strptime ?
[10:20:40] voidDotClass: sevenseacat, I just mean milliseconds since 1970 epoch
[10:21:02] voidDotClass: What's the right way to save them to a db column in rails?
[10:21:30] voidDotClass: Why not? Its a pretty standard way to represent dates?
[10:21:43] voidDotClass: Anyway, how can I get the timestamp out of a Rails date?
[10:21:56] voidDotClass: timestamp = milliseconds
[10:23:51] voidDotClass: has joined #ruby
[10:24:11] voidDotClass: How do I convert a Date to unix milliseconds?
[10:24:26] voidDotClass: How can I get the timestamp out of a Rails date?
[10:30:02] voidDotClass: Caerus, thanks
[10:31:07] voidDotClass: Caerus, if i have an incoming date coming in as unix milliseconds, and i want to save that to a db column in rails, any ideas what the best way to do that is?
[10:32:52] voidDotClass: yeah it has a date column which i'm using
[10:33:05] voidDotClass: question is how to convert the timestamp into the date
[10:33:59] voidDotClass: apeiros, yep, *1000
[10:59:00] voidDotClass: Ping timeout: 276 seconds
[11:10:49] voidDotClass: has joined #RubyOnRails
[11:10:49] voidDotClass: has joined #ruby
[11:11:46] voidDotClass: has joined #ruby
[11:11:46] voidDotClass: has joined #RubyOnRails
[11:12:48] voidDotClass: has joined #ruby
[11:12:48] voidDotClass: has joined #RubyOnRails
[11:13:45] voidDotClass: has joined #ruby
[11:13:45] voidDotClass: has joined #RubyOnRails
[11:33:32] voidDotClass: I have an rspec factory where I have the column: is_private false . In my model I have: validates :is_private, presence: true . Yet if I try to do create(:team) I get 'is private cant be blank'
[11:34:10] voidDotClass: sevenseacat, then how do i just check if its not nil?
[11:35:16] voidDotClass: validates :is_private, allow_nil: false
[11:35:26] voidDotClass: that gives 'you must specify at least one validation'
[11:43:08] voidDotClass: if you have a has_many assoc, can you do a find_by on it?
[16:31:16] voidDotClass: I have a users table + model, a schools table + model, and an invites table + model which stores the user + school, i.e the schools that a user has been invited to. How can I get only those users who haven't been invited to a particular school?
[16:31:52] voidDotClass: e.g something like Select * from user where user id NOT in (select user_id from invites where school_id = xxx)
[17:24:43] voidDotClass: I have a User model. How can I do something like Users.find_where(id, NOT in, [array of ids])?
[17:25:52] voidDotClass: fox_mulder_cp, any cleaner way to do it than building the sql string myself?
[17:29:31] voidDotClass: apeiros, thanks a bunch
[17:29:41] voidDotClass: exactly what i was looking for
[18:29:18] voidDotClass: Ping timeout: 246 seconds
[18:30:02] voidDotClass: has joined #RubyOnRails
[18:30:02] voidDotClass: has joined #ruby
[18:34:54] voidDotClass: Ping timeout: 246 seconds
[18:47:54] voidDotClass: has joined #RubyOnRails
[18:47:54] voidDotClass: has joined #ruby
[22:58:06] voidDotClass: Ping timeout: 246 seconds
[23:11:52] voidDotClass: has joined #RubyOnRails
[23:11:52] voidDotClass: has joined #ruby

2016-04-28

[01:26:33] voidDotClass: has joined #RubyOnRails
[01:26:37] voidDotClass: Question. I have two models: User, School, and I have a 3rd model: UserSchool, which belongs_to user, belongs_to school, and has a few additional metadata fields about the relationship. How can I have a has_many users on the School model, which is mapped to UserSchool instead of users?
[01:32:12] voidDotClass: SeanLazer, I want to alias it to user.schools instead of user.user_schools
[01:41:57] voidDotClass: yeah i sorted it, thanks. used a diff. name
[01:43:47] voidDotClass: user.school_membership
[01:46:52] voidDotClass: Remote host closed the connection

2016-04-07

[09:46:10] voidDotClass: Ping timeout: 244 seconds
[09:59:04] voidDotClass: has joined #RubyOnRails
[21:46:44] voidDotClass: Ping timeout: 268 seconds

2016-04-06

[01:10:45] voidDotClass: Remote host closed the connection
[16:59:16] voidDotClass: has joined #RubyOnRails
[16:59:43] voidDotClass: I have a project which involves managing computer monitors, but on rails g model Monitor, it tells me 'monitor' is taken or a reserved word
[17:13:49] voidDotClass: Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
[17:13:54] voidDotClass: what does that mean?
[17:14:04] voidDotClass: getting that randomly when i run rake db:migrate
[17:14:07] voidDotClass: was working previously
[17:21:17] voidDotClass: tubbo, but i havent changed anything in my environment, so why did it change out of the blue
[17:23:09] voidDotClass: workmad3, so if i change the rake ver in my gemfile, will that work?
[21:45:24] voidDotClass: Ping timeout: 244 seconds
[21:58:18] voidDotClass: has joined #RubyOnRails

2016-04-05

[00:00:38] voidDotClass: that's pretty uglyish
[07:05:16] voidDotClass: Ping timeout: 264 seconds
[11:17:15] voidDotClass: has joined #RubyOnRails
[11:19:29] voidDotClass: I have a class School, with a Jbuilder for it in schools/_school.jbuilder . I have another class, Student, which belongs_to school. I'm trying to load the partial for the school in _student.jbuilder, but its not working. doing: json.school student.school, partial: 'schoolss/school', as: school . Error: ActionView::Template::Error: undefined local variable or method `school' for #<#<Class:0x007fe385c932c0>:0x007fe385c8ece8>
[11:19:41] voidDotClass: if I do "puts #{student.school}" right before that line, it works
[11:24:34] voidDotClass: thank you, workmad3
[13:24:11] voidDotClass: has joined #ruby
[13:24:13] voidDotClass: If I need to get a date object for 1st Jan 2016, how to do that?
[21:01:39] voidDotClass: i have an image in public/images, is there a rails method for getting just the url to that image?
[21:04:46] voidDotClass: Radar, i dont need image tag though
[21:04:49] voidDotClass: i just need the url
[21:13:09] voidDotClass: arup_r, i havent, let me check
[21:13:25] voidDotClass: smathy, i need the full url incl the server address
[21:13:39] voidDotClass: i need the full url incl the current domain
[21:15:11] voidDotClass: arup_r, does that also work if the image gets inlined by that pieline
[21:45:27] voidDotClass: Ping timeout: 244 seconds
[21:58:27] voidDotClass: has joined #RubyOnRails
[21:58:27] voidDotClass: has joined #ruby

2016-04-04

[13:55:23] voidDotClass: #<Rack::Test::UploadedFile:0x007fa0d88d9db8 @content_type="image/jpeg", @original_filename="demon.jpg", @tempfile=#<Tempfile:/tmp/demon.jpg20160404-1777-1bdd4m7 (closed)
[13:55:37] voidDotClass: IOError: closed stream
[13:58:51] voidDotClass: oddly the file still gets uploaded
[13:58:56] voidDotClass: but i still see that error
[13:59:33] voidDotClass: https://gist.github.com/aliakhtar/e771fe335b4c2d4b87299339b0969bdc
[13:59:37] voidDotClass: that's the upload method
[13:59:57] voidDotClass: ahhhhhhhhh, got it
[14:00:02] voidDotClass: i was re-using the file, i think
[14:00:08] voidDotClass: using it multiple times
[20:32:00] voidDotClass: Ping timeout: 276 seconds
[23:57:45] voidDotClass: has joined #RubyOnRails
[23:58:53] voidDotClass: I have a class School, and school has_and_belongs_to_many students. How can I write a scope which takes a student id and returns those schools where school.students.include? student
[23:59:55] voidDotClass: Radar, I do have a modeless join table. Why?