Activity Graph

Page 1 of 1


[08:22:18] dazonic: has joined #RubyOnRails
[08:23:59] dazonic: Can someone please tell me why my strptime is failing with the %3N part?
[08:24:01] dazonic: Time.strptime "2017-08-10", "%Y-%m-%d %H\.%M\.%S\.%3N"
[08:28:31] dazonic: ArgumentError: invalid strptime format - `%Y-%m-%d %H.%M.%S.%3N'
[08:28:43] dazonic: Ok I’ll read more on milliseconds
[08:39:27] dazonic: Thanks man. %3N to print,
[08:39:35] dazonic: %L to parse
[08:56:00] dazonic: Quit: dazonic


[07:23:49] dazonic: has joined #RubyOnRails
[07:25:34] dazonic: Remote host closed the connection
[07:26:23] dazonic: has joined #RubyOnRails
[07:30:25] dazonic: has left #RubyOnRails: ()
[07:30:54] dazonic: has joined #RubyOnRails
[07:33:25] dazonic: has left #RubyOnRails: ()
[07:34:16] dazonic: has joined #RubyOnRails
[07:34:32] dazonic: I???m using git as a source for a gem, like github: ???daz/repo??????.. it???s not updating the source, just using an old version based on the version number. How do i force it to update, or delete the old one?
[07:57:18] dazonic: sevenseacat yep i ran bundle update gem_name, it???s still using the old version
[07:58:21] dazonic: it???s like the version number takes precedence over ref in Gemfile.lock
[07:58:31] dazonic: yes it???s my repo!
[07:59:00] dazonic: the version number in the gem???s gemspec
[07:59:49] dazonic: my gemfile just has this: gem 'f1results', github: 'daz/f1results'
[08:00:09] dazonic: Gemfile.lock refers to the latest ref
[08:01:00] dazonic: but it also has the version number in Gemfile.lock under specs:
[08:01:34] dazonic: the gem itself isnt being required, it???s using an old version
[08:02:54] dazonic: sorry, i misread??? the Gemfile.lock revision: is the latest ref, definitely
[08:04:28] dazonic: thats the thing, it definitely isn???t, i???m getting no method errors on APIs i just added
[08:05:14] dazonic: i???ve run into it before??? if i manually clear out the old gem versions from my .rbenv dir, it works
[08:05:53] dazonic: could it be because i have require: false on the gem
[08:06:01] dazonic: yes, everything
[08:06:49] dazonic: correct, sorry
[08:07:26] dazonic: so that???s it?
[08:16:54] dazonic: Quit: dazonic


[02:12:43] dazonic: iinvoice.update_column :flights_rate, 95
[02:12:53] dazonic: spits out SQL (21.5ms) UPDATE "invoices" SET "flights_rate" = 95 WHERE "invoices"."id" = 53
[02:13:21] dazonic: but invoice.flights_rate is nil!
[02:13:51] dazonic: after i set it, it???s still nil i mean
[02:14:47] dazonic: yeah even when i go Invoice.find 53???. flights_rate is nil
[02:14:59] dazonic: it???s weird as
[02:16:21] dazonic: ahem??? yes, thankyou???.
[02:16:53] dazonic: i had an old attr_accessor called flights_rate lingering
[02:17:50] dazonic: haven???t even tested but obv thats it??? what an idiot??? irc is always last resort for me i hate asking for help lol
[02:17:55] dazonic: cheers mate
[02:19:18] dazonic: interesting that update_column doesn???t directly hit the db
[02:20:08] dazonic: oh so it was saved, just reading for the attr
[02:21:10] dazonic: not on the ball today


[08:56:46] dazonic: Payment model, amount column is a decimal??? why do I need to convert to array or risk getting whack values when I convert to float?
[08:58:28] dazonic: @payments.sum(:amount) == 2128; @payments.to_a.sum(&:amount) == 1832
[09:04:38] dazonic: @Wolland_ 1832, the correct value
[09:07:12] dazonic: @Wolland_ column is a decimal


[03:11:21] dazonic: I???ve got Invoice belongs_to Client???.. How do I get all Clients who have at least one Invoice?
[03:12:18] dazonic: I want a more efficient version of Invoice.all.to_a.map(&:client).uniq
[03:14:59] dazonic: Client.joins(:invoices).uniq even adds distinct, that???s sick
[03:15:46] dazonic: thanks fellas
[03:19:45] dazonic: SELECT DISTINCT "clients".* FROM "clients" INNER JOIN "invoices" ON "invoices"."client_id" = "clients"."id"
[06:56:56] dazonic: i???ve got ghost associations???. i forgot to ???dependent: :destroy??????..
[06:58:51] dazonic: yeah or a rake task
[06:59:39] dazonic: just loop through and look for nil? I???ve got a shitload of records
[07:00:04] dazonic: is there a better term to google other than ???ghost records???


[06:30:00] dazonic: anyone got ideas why my application.css is just spitting out the raw manifest, it's like sprockets isn't working at all? Rails 3.2.13
[06:32:09] dazonic: same with application.js it's just rendering the commented lines, not spitting out coffeescript
[06:33:34] dazonic: Radar: any ideas what to check? i updated sass-rails, sprockets, coffee-script… really baffled
[06:37:33] dazonic: radar:rhizome: yeah it def looks like a sprockets issues… Gemfile.lock says sprockets (~> 2.1.3)…… application.rb has config.assets.enabled = true…… i'm stumped
[06:39:25] dazonic: rhizome: it's not in Gemfile just a dep of actionpack
[06:40:52] dazonic: rhizome: thanks anyway bud, will keep banging my head


[02:11:23] dazonic: rails 3.2, my assets aren't being manifested, application.css is just spitting out the commented requires
[02:13:23] dazonic: i've ran into this before, i forget how i fixed it… assets is enabled, public/assets doesn't exist…. it's an old app and it was working last time i played with it
[02:31:34] dazonic: config.assets.paths << Rails.root.join("app", "assets", "flash")
[02:31:51] dazonic: in ur application.rb


[01:30:21] dazonic: any SQL beasts know how to get distinct years from a column? rails 3.2 + postgres
[01:32:16] dazonic: Event.group('year(start_time)') throws this: ERROR: function year(timestamp without time zone) does not exist
[01:32:47] dazonic: yeah i've been googling for a while now
[01:33:31] dazonic: start_time is the column i'm after, year is apparently an sql function
[01:43:31] dazonic: i'm not sure rhizmoe
[01:45:36] dazonic: option.try(:humanize)
[01:47:26] dazonic: i'm having some luck with this, fetching all years… i don't like it though…. Event.select("date_part('year', start_time)")
[02:05:42] dazonic: ACTION dunno if this is IRC protocol or not but I sussed out getting distinct years….. #datetime is stored as type timestamp in postgres, so you need to use date_part to get the year...
[02:05:53] dazonic: Event.select("date_part('year', start_time)").uniq


[08:38:51] dazonic: I've got an ResultObserver< ActiveRecord::Observer with an after_save action, it's not being triggered by @event << Result.new
[08:38:59] dazonic: should it be?
[08:40:49] dazonic: correction….. it's not being triggered by @event.results << Result.new


[08:02:02] dazonic: I'm running about 5 rack apps and 5 rails apps, all relatively small with low traffic, and i keep spiking massive IO errors from Linode mailer…. nginx + unicorn
[08:02:57] dazonic: just got an alert, averaging 8000+ for the last 2 hours


[08:00:16] dazonic: with jquery_ujs, how would i interrupt, or unbind an ajax event? this didn't work https://gist.github.com/7f63147e439ad4f25ed8
[08:03:33] dazonic: cheers universal, but i kind of need a custom confirm. I want to delete the row as the OK button is hit, not after the ajax callback in destroy.js.erb
[08:05:14] dazonic: sevenseacat i'm not too bothered if the delete fails, i've got the need for speed
[08:07:04] dazonic: universal yep it certainly does work with remote… i've been reading through jquery_ujs, i'll keep digging though, cheers