Activity Graph

Page 1 of 2 | Next »


[02:47:37] fp-: has joined #RubyOnRails
[02:47:55] fp-: Client Quit


[06:02:23] fp-: has joined #RubyOnRails
[06:26:18] fp-: Quit: Textual IRC Client: www.textualapp.com


[06:27:34] fp-: has joined #RubyOnRails
[06:31:25] fp-: has joined #ruby
[06:34:06] fp-: Quit: WeeChat 1.4


[20:23:37] fp-: has joined #ruby
[20:24:16] fp-: Client Quit


[20:26:44] fp-: has joined #ruby
[20:26:44] fp-: has joined #RubyOnRails
[20:27:16] fp-: hey guys... anyone here using multitenancy have advice on how to allow the user to edit the settings for the tenant
[20:27:23] fp-: do you just do a tenants_controller
[20:39:39] fp-: Quit: Lingo: www.lingoirc.com


[22:38:54] fp-: has joined #ruby
[22:38:54] fp-: has joined #RubyOnRails
[22:40:00] fp-: Rails 5 is doing some kind of really strange caching of a module/concern I have that sets a default scope based on Thread.current. Does anyone have any advice of where I can investigate? It's like it's caching the module for some reason and calling the default_scope regardless of whether it should (based on presence of account_id in Thread.current)
[22:49:53] fp-: i keep tweaking things and it just seems that default_scope within a Concern is just not working
[22:50:14] fp-: I have default_scope { raise 'wtf' } and it never calls
[22:52:01] fp-: if I move it out of default_scope into the included() block, it calls
[23:08:54] fp-: yeah even in the console, I can't get a concern to set a default_scope in Rails 5
[23:18:24] fp-: ok it looks like in Rails 5, you have to define default scopes as def self.default_scope
[23:18:40] fp-: the previous method is no longer working for me at least
[23:19:39] fp-: default_scope { with_account } # does nothign
[23:19:58] fp-: def self.default_scope() with_account; end # works
[23:24:41] fp-: Quit: Lingo: www.lingoirc.com


[04:30:16] fp-: has joined #RubyOnRails
[04:30:17] fp-: has joined #ruby
[04:30:18] fp-: Remote host closed the connection
[04:30:30] fp-: has joined #ruby
[04:30:30] fp-: has joined #RubyOnRails
[04:31:56] fp-: is there a way to make it so that when you generate a route via link_to [@account, @invoice] it would automatically call [@account.company, @invoice] instead?
[04:35:31] fp-: Quit: Lingo: www.lingoirc.com


[00:23:35] fp-: Quit: Lingo: www.lingoirc.com


[23:58:59] fp-: has joined #ruby
[23:58:59] fp-: has joined #RubyOnRails


[00:07:58] fp-: has joined #RubyOnRails
[00:07:59] fp-: Remote host closed the connection
[00:07:59] fp-: has joined #ruby
[00:08:20] fp-: has joined #ruby
[00:08:20] fp-: has joined #RubyOnRails
[00:11:59] fp-: Client Quit


[03:55:41] fp-: has joined #RubyOnRails
[03:55:42] fp-: has joined #ruby
[19:25:34] fp-: Quit: Lingo: www.lingoirc.com


[07:07:37] fp-: has joined #RubyOnRails
[07:07:37] fp-: has joined #ruby
[07:08:21] fp-: is there anyone who can tell me why local_time (github.com/basecamp/local_time) keeps giving me time that's 4 hours in the future?
[07:08:59] fp-: is there anyone who can tell me why local_time (github.com/basecamp/local_time) keeps giving me time that's 4 hours in the future?
[07:11:00] fp-: my application config is leaving the default timezone of :utc
[07:11:12] fp-: a logged in use has Time.zone = current_user.time_zone
[07:11:37] fp-: which in my case is 'Eastern Time (US & Canada)'
[07:12:11] fp-: anytime I render e.g. @payment.created_at i have the correct time, however when I use Basecamp's local_time, it's always throwing me 4 hours ahead
[07:12:24] fp-: I've tried disabling my set_time_zone before_action and I still get the same thing
[07:17:38] fp-: has left #ruby: ("Be back later ...")
[07:17:40] fp-: has left #RubyOnRails: ("Be back later ...")


[06:55:46] fp-: has joined #ruby
[06:55:46] fp-: has joined #RubyOnRails
[06:55:55] fp-: hey all
[06:56:39] fp-: I'm looking for a best practice for selecting records belonging to a polymorphic association
[06:56:58] fp-: example: Recording.where(recordable: [Company.last, Person.last])
[06:57:05] fp-: this doesn't work as I expected it
[06:57:25] fp-: i'm wanting to get back all the recordings belonging to Company.last OR Person.last
[07:00:00] fp-: ok that's basically what I'm doing
[07:00:05] fp-: just seeing if there's a simpler way
[07:15:07] fp-: has left #RubyOnRails: ("Be back later ...")
[07:15:09] fp-: has left #ruby: ("Be back later ...")


[01:36:29] fp-: hey all
[01:36:36] fp-: ever since Rails 4.2 and Ruby 2.0, my views are taking an extra ~500ms to render
[01:36:43] fp-: Completed 200 OK in 659ms (Views: 643.8ms | ActiveRecord: 3.3ms)
[01:36:51] fp-: that used to be like ~70ms
[01:37:02] fp-: is there a way I can somehow figure out what's taking so long?
[01:37:10] fp-: my partials all render under 10ms
[01:45:18] fp-: bourbon: it seems that profilers are for tests... is there a way to profile views?


[00:00:38] fp-: maybe I was doing it wrong, but I researched for hours and just couldn't get autoloading and development reloading working
[00:00:48] fp-: created a directory called gems
[00:00:52] fp-: moved the libs there
[00:01:19] fp-: created gems, referenced them via Gemfile
[00:01:35] fp-: it was just a royal pain in the ass trying to make edits to them while developing the rest of the app
[00:02:54] fp-: lol my testing involves editing the refreshing
[00:04:04] fp-: the basic structure of my API libraries is basically a base class that includes a lot of ActiveModel functionality
[00:04:20] fp-: then I have a separate class/file that descends from the base class
[00:04:24] fp-: for each object of the API service
[00:04:32] fp-: I put validations and everything in there and work with them like AR models
[00:04:39] fp-: forms post directly to them
[00:04:49] fp-: so, it's quite possible my design is bad
[00:05:34] fp-: there's nothing out there I can really find that's similar
[00:05:37] fp-: to what I'm doing
[00:06:08] fp-: it's basically like using ActiveResource back in the day
[00:06:18] fp-: but these API services don't use REST or even XML
[00:06:26] fp-: it's all parsing CSV data and plain text crap
[00:06:42] fp-: so I basically mimicked ActiveResource
[00:09:09] fp-: web services running on proprietary internal servers
[00:14:18] fp-: lol I have absolutely no control over the remote web servers I'm pulling data from
[00:14:24] fp-: if I did, life would be wonderful
[00:15:20] fp-: my API client libraries I've written are basically modeled after ActiveResource, but instead of parsing nice XML and following REST, it deals with these 2 web services' APIs and parses their data
[00:15:38] fp-: and I have CRUD methods that are implemented by each descending child/model
[00:15:48] fp-: I pull in validations from ActiveModel, etc.
[00:15:55] fp-: so each model resembles an AR object
[00:16:15] fp-: for the purpose of controllers and views, they are treated like AR models
[00:16:30] fp-: but the models are pretty fat with a lot of custom logic for create/update/destroy/all/etc.
[00:16:49] fp-: i'm just trying to figure out how to organize this stuff within my app
[00:16:54] fp-: whether it all belongs in app/models
[00:16:56] fp-: or another folder


[05:44:16] fp-: ever since upgrading to Rails 4.2, I'm getting weird queries
[05:44:44] fp-: like I've got id columns trying to be found by strings
[05:44:54] fp-: I'm guessing this is the adequare record stuff
[05:44:57] fp-: but it's clearly buggy
[23:27:53] fp-: my app relies heavily on 2 API services and my lib directory has gotten pretty darn big... is there a better folder naming idea for these api clients?
[23:33:06] fp-: yeah i've got the 2 of them organized into subfolders with lib
[23:33:13] fp-: they are nearly gemmable
[23:33:27] fp-: this is for proprietary stuff though, so no sense in making it a gem to release
[23:58:55] fp-: i spent the better part of yesterday trying to figure out how to make them gems while developing in rails
[23:59:04] fp-: had nothing but trouble with autoloading issues
[23:59:11] fp-: ended up moving them back to lib/


[08:56:53] fp-: is there a way to disable the adequate record enhancements?
[08:57:08] fp-: I have code that was working perfeclty fine on Rails 4.1, and now I'm getting StatementInvalid errors
[08:57:35] fp-: it's very oddly trying to look up an ID by a string


[02:05:41] fp-: is anyone familiar with pundit?
[02:05:49] fp-: I'm struggling with permissions through a join table


[11:27:54] fp-: i can't seem to figure out why ActiveRecord is trying to find associated records of an object when they don't exist
[11:30:01] fp-: I'm doing something like Company.includes(:president, :vice_president, :secretary).all and if the Company doesn't have a VicePresident or Secretary, when I'm looping through @companies and calling company.secretary or company.vice_president, AR is doing another query/lookup to try to find the VP / Secretary
[11:30:37] fp-: if all 3 associations exist, there are no more SQL queries generated
[11:30:52] fp-: but if any do not exist, AR tries to look them again


[05:23:01] fp-: i'm trying to build a small app similar to 37signals' Highrise in functionality, but more industry specific. Anyhow, poking around their API, it looks like they are using single table inheritance from a "parties" table with Company and Person < Party
[05:23:06] fp-: but I'm not entirely sure
[05:23:59] fp-: where I'm confused is how they're returning "name" on a company record, but "first_name" and "last_name" on a person record, via the /parties.xml api
[05:24:02] fp-: http://pastie.org/9753311


[03:54:09] fp-: is anyone else having trouble accessing .local domains on Safari 8 / Yosemite?
[04:19:45] fp-: i got it working by installing pow
[04:20:51] fp-: i'm headed to bed... night


[01:19:54] fp-: I apologize if this has been asked already, but does anyone know how to get webrick to accept incoming connections on Yosemite? I just upgraded and it???s not working.
[01:29:22] fp-: can???t use thin, unicorn, webrick
[01:29:36] fp-: it???s like yosemite is ignoring my firewall approval of ruby
[06:19:26] fp-: So, Safari 8 in Yosemite won't resolve .local domains


[20:34:18] fp-: is there a way to do this yet? Recording.where(recordable: company).or(Recording.where(recordable: company.member_ids))
[20:35:31] fp-: I didn???t want to have to write the SQL because Company is STI, so recordable_type IN (???Company???, ???Client???, ???Reseller???)
[20:35:35] fp-: which I???d rather not hard code
[20:35:41] fp-: is there a way to get a list of STI classes?
[20:37:42] fp-: yeah i see that :/
[20:40:08] fp-: doesn???t look like arel handles polymorphic association
[20:40:14] fp-: where(arel_table[:recordable]).eq(company).or(arel_table[:recordable]).in(company.member_ids)
[20:41:22] fp-: hmm.. how would I do it?
[20:42:16] fp-: yeah i see, you???re having to spell out recordable_type and recordable_id


[18:23:05] fp-: hey guys, I???m trying to run ???rails server??? from my app directory and it???s not detecting I have an app there
[18:23:10] fp-: happend after a bundle update
[18:23:58] fp-: but i get more error output
[18:23:59] fp-: one sec
[18:24:00] fp-: i???ll do a pastie
[18:24:20] fp-: http://pastie.org/9196733
[18:25:27] fp-: I can???t figure out where it???s detecting sqlite more than once
[18:25:31] fp-: it???s only in my Gemfile once
[18:26:32] fp-: and I???ve been getting this since upgrading to 4.1 ???bin/rails:6: warning: already initialized constant APP_PATH"
[18:29:09] fp-: it was a gem
[18:29:11] fp-: commented it out


[17:35:29] fp-: hey guys??? ever since Rails 4.1, I have two models that no longer work because of their class names. One is called Task, the other Status
[17:35:36] fp-: is this a known issue?
[17:37:18] fp-: oh sure on sec
[17:37:48] fp-: well, Task.new is working from the console
[17:38:15] fp-: in the web server, I get SystemStackError (stack level too deep):
[17:38:22] fp-: only those 2 models
[17:38:25] fp-: since rails 4.1
[17:38:54] fp-: the only solution I???ve found is to just rename the models to something else
[17:41:22] fp-: looks like it bombs out on save
[17:41:43] fp-: oh well, I???ll just rename them
[17:41:51] fp-: Rails 4.1.0beta1 worked
[17:41:55] fp-: started failing on beta2
[17:43:50] fp-: looks like the breakdown is somewhere in the validator
[17:44:15] fp-: if I pass validation, it saves
[17:44:34] fp-: but if I don???t pass validation, I get the SystemStackError
[17:46:54] fp-: does anyone know of a way I can debug this?
[17:49:24] fp-: yeah, I just did that and there are no problems
[17:49:30] fp-: for some reason this is only happening on the server
[17:53:32] fp-: poliphox: http://pastie.org/9182444
[17:56:09] fp-: i know right
[17:56:16] fp-: this one is driving my crazy for 2 days no
[18:05:52] fp-: looking like my problem is with simpleform
[22:46:45] fp-: ok, I???ve got more info on my issue from earlier
[22:46:53] fp-: It???s something in Rails (4.1.1) with form_for
[22:47:00] fp-: preparing a pastie...
[22:47:45] fp-: http://pastie.org/9183088
[22:49:08] fp-: it just seems that because the model is named Status, Rails doesn???t seem to like it
[22:49:14] fp-: this started with Rails 4.1.0beta1
[22:49:16] fp-: er beta2 sorry
[22:53:37] fp-: yeah it just seems that Rails 4.1 does not like the use of a model named Status or Task, at least in my app??? I guess I can try creating a blank app and seeing if it???s still there.
[22:54:00] fp-: I can???t figure out how debug a SystemStackError
[22:54:17] fp-: there???s like nothing there to go on
[22:55:43] fp-: right, but this is totally behind my code
[22:55:45] fp-: it???s deep in rails somewhere
[22:55:57] fp-: my model can be empty other than the class definition


[06:25:24] fp-: I've got a strange one here... http://pastie.org/8763977
[06:28:32] fp-: if I call valid? before save, it will simply return false
[06:29:22] fp-: one sec
[06:30:03] fp-: rvanlieshout: the only thing I left was the validates_presence_of line and it still does this stack level too deep error
[06:30:31] fp-: rvanlieshout: yep, even quit and came back in just to be sure
[06:30:47] fp-: it's strange as hell, because none of my other models are doing this
[06:31:34] fp-: i'll try downgrading from rails 4.1rc1
[06:33:43] fp-: rvanlieshout: yep, it's rails 4.1rc1
[06:33:58] fp-: I downgraded back to rails 4.1beta1 and don't have that problem


[01:10:44] fp-: hey guys, I have a Company model, and Client < Company. In my ClientsController, I can pull just Clients just fine, but I'm wondering if I want to use the base class (Company) to store businesses that haven't become customers yet, how can I filter out the Clients?
[01:11:12] fp-: is Company.where(type: nil).all bad design?
[01:23:06] fp-: thanks rhizome


[00:10:27] fp-: ok, it's the use of method_missing in an AR model
[00:10:40] fp-: i don't know why this is not working in Rails 4.1, but that's what it is


[23:39:51] fp-: rails 4.1 is killing me
[23:40:09] fp-: almost all of my controllers are throwing SystemStackError stack level too deep
[23:40:29] fp-: with absolutely no trace to even look through
[23:41:40] fp-: actionpack (4.1.0.beta1) lib/action_dispatch/middleware/reloader.rb:70
[23:41:52] fp-: is there anything I can do to dig deeper?
[23:44:51] fp-: all this has been working fine in 4.0
[23:47:13] fp-: oh yeah, i did all of that
[23:47:30] fp-: i think it's a before_action
[23:51:53] fp-: well, whatever this is, i think it's going to be a more widespread issue
[23:52:29] fp-: probably a gem


[03:35:55] fp-: hey all
[03:36:27] fp-: i'm kinda having a conundrum where i'm having to choose between better software design vs efficiency


[08:35:46] fp-: can anyone tell me the importance of having a base class when using STI
[08:36:03] fp-: I have a Person object and an Agent object, sharing the single table people
[08:36:09] fp-: Person.new.type = nil
[08:36:17] fp-: Agent.new.type = "Agent"
[08:36:38] fp-: is it bad design that a person type is nil?
[08:37:17] fp-: right, but in my app a Person is a non-admin, and an Agent is an admin
[08:37:20] fp-: so I have a mix of people and agents
[08:37:40] fp-: i think typically you'd have a base class that both person and agent inherit from
[08:38:01] fp-: that's correct
[08:38:35] fp-: so, even though I create non-admin users as people, it's all copasetic?
[08:39:35] fp-: ok great
[08:39:59] fp-: i never saw documentation where the base class was actually used
[08:40:18] fp-: i usually saw something more like User < ActiveRecord::Base, Person < User, Agent < User, etc.
[08:41:44] fp-: well it is 4am here, so i'm finally off to bed
[08:41:45] fp-: thanks for the help
[08:41:52] fp-: see ya!


[21:23:35] fp-: i can't figure out why it's bypassing my method
[21:23:47] fp-: seems like it's just going straight to Collection#each and won't call my to_xml
[21:27:38] fp-: respond_to { |format| format.xml { render xml: @collection } }
[21:27:50] fp-: this code runs deep
[21:28:14] fp-: i've verified my Collection is being instantiated and has my objects
[21:28:26] fp-: but the xml renderer is not playing ball
[21:32:47] fp-: i think i just figured it out
[21:32:56] fp-: sort_by is changing it back in to a plain old array