« Back to channel list

#RubyOnRails - 04 June 2015

« Back 1 day Forward 1 day »
[00:00:09] mark[oz]: has joined #RubyOnRails
[00:00:35] hnanon: I guess I'll try again tomorrow.
[00:01:20] juni0r: has joined #RubyOnRails
[00:01:22] mariusz: has joined #RubyOnRails
[00:01:24] kinduff: has joined #RubyOnRails
[00:01:24] kinduff: has joined #RubyOnRails
[00:01:46] victorkohl: has joined #RubyOnRails
[00:02:22] neanderslob: bricker: hey, I think that worked (at least it's on to the next error now) thanks!
[00:03:22] cnk: has joined #RubyOnRails
[00:05:01] SteenJobs: still no solution - i???m getting a NoMethodError in Devise::SessionsController#create that there???s an undefined method ???admin???? for user???although .admin? works in console.
[00:05:44] jfarmer: has joined #RubyOnRails
[00:05:45] Aeyrix: hnanon: Scoping.
[00:05:52] baweaver: has joined #RubyOnRails
[00:06:36] sevenseacat: has joined #RubyOnRails
[00:06:40] cryptocronus: has joined #RubyOnRails
[00:07:24] dseitz: has joined #RubyOnRails
[00:07:26] bricker: SteenJobs: please gist your error and relevant code
[00:07:30] SteenJobs: I???m trying to implement after_sign_in_path_for(resource) in my application controller
[00:07:33] SteenJobs: bricker: aright one sec
[00:08:35] SteenJobs: bricker: https://gist.github.com/SteenJobs/9b780f130f7b9a6cc17b - thanks man
[00:08:58] SteenJobs: bricker: mind you, the vast majority of the code is not mine - i just inherited this project and i???m not a fan of the guy that wrote it before i took over
[00:10:22] Scripore: has joined #RubyOnRails
[00:10:23] bricker: SteenJobs: does your Users table have an 'admin' attribute?
[00:10:43] SteenJobs: bricker: yessir. it???s called clients for now, but my clients table has the admin attribute
[00:10:49] SteenJobs: which is what???s weird, because it works in console
[00:11:03] sleungcy: has joined #RubyOnRails
[00:11:04] SteenJobs: bricker: don???t say it
[00:11:10] SteenJobs: bricker: that???s why
[00:11:14] kinduff: has joined #RubyOnRails
[00:11:36] SteenJobs: bricker: actually nvrm - the users table which i plan on getting rid of (there???s both a users and clients table) does not have the admin attr, but it shouldn???t matter
[00:11:45] SteenJobs: because the current_user when i login is part of the clients table
[00:11:58] SteenJobs: and when i check that client.admin? in console it works fine
[00:12:02] bricker: So your User class is pointing to the clients table?
[00:12:23] larissa: has joined #RubyOnRails
[00:12:24] SteenJobs: i???m not even dealing with the User class now - i plan on removing it.
[00:12:38] bricker: SteenJobs: Yes you are, current_user is an instance of User
[00:12:42] bricker: as you can see from the error message
[00:12:55] sleungcy: How can i add dirty flags to a non activeRecord model?
[00:13:06] SteenJobs: bricker: ahh, but i figured if i???m loggging in as a member of the clients table, current_user would point to a client not a user
[00:13:09] bricker: sleungcy: ActiveModel::Dirty can be mixed into any ruby class
[00:13:23] bricker: sleungcy: you just have to provide some hooks, it's documented pretty well in the ActiveModel::Dirty documentation
[00:13:56] bricker: SteenJobs: guess not
[00:14:05] yfeldblum: has joined #RubyOnRails
[00:14:14] SteenJobs: bricker: weird. not sure that makes sense though..
[00:14:21] SteenJobs: bricker: i???ll be back in a sec. trying one thing.
[00:14:22] bricker: SteenJobs: It's doing User.authenticate()
[00:14:26] bricker: not Client.authenticatE()
[00:14:28] SteenJobs: bricker: ahhh
[00:14:48] SteenJobs: but then whenever someone that???s a client logs in, there???s no authentication??
[00:15:01] SteenJobs: i thought current_user would just apply to whomever is logging in
[00:15:24] goodcodeguy: has joined #RubyOnRails
[00:15:35] _seanc_: has joined #RubyOnRails
[00:17:28] codepete: has joined #RubyOnRails
[00:17:33] MEATCHICKEN: has joined #RubyOnRails
[00:17:41] bricker: SteenJobs: if someone who is a Client is successfully logging in, then that record must also exist in the User table
[00:17:46] [H]unt3r: has joined #RubyOnRails
[00:17:52] bricker: SteenJobs: unless the authentication is overridden to check both classes
[00:18:07] sleungcy: Hey for activemodel:dirty. Looks like i have to call attr_will_change method in my writer method? But i used attr_accessor to generate my writers. I cant add that line unless I add a bunch of setter methods
[00:18:11] SteenJobs: bricker: ok i???ll look into that, because i???m pretty sure the client record is only in the client table
[00:18:30] bricker: SteenJobs: Well you've got a User object
[00:18:41] sleungcy: It would be nice if i can pass a proc into attr_accessor
[00:18:56] SteenJobs: bricker: i know for sure that the client record does not exist in the user table
[00:18:57] bricker: sleungcy: lol
[00:19:13] bricker: sleungcy: you think a proc is easier than an easy two lines of code?
[00:19:20] sleungcy: But I have a ton of attributes
[00:19:38] bricker: sleungcy: use define_method and a loop
[00:19:51] foucist: SteenJobs: if you're getting rid of the user table, then perhaps you want to switch over to something like current_client
[00:20:03] delianides: has joined #RubyOnRails
[00:20:06] sleungcy: Cool thx bricker ur awesome
[00:20:12] bricker: sleungcy: I know
[00:20:41] SteenJobs: foucist: that???s what i just plugged in before you said that and i???m no longer getting the .admin? error, but now i???m hitting a doubleRender error
[00:21:02] ogpastaling: has joined #RubyOnRails
[00:22:15] foucist: you might want to familiarize yourself with devise by the way
[00:23:02] foucist: current_user is defined by devise library here for example.. if you're switching over to client, then probaby want to replace the devise settings to use client table instead of user table
[00:23:08] foucist: so :authenticate_client, current_client, etc
[00:23:12] foucist: just a thought
[00:24:08] quazimodo: has joined #RubyOnRails
[00:24:26] Anakat: has joined #RubyOnRails
[00:24:56] Parker0: has joined #RubyOnRails
[00:28:20] iamjarvo: has joined #RubyOnRails
[00:29:02] iamjarvo: has joined #RubyOnRails
[00:29:51] iamjarvo: has joined #RubyOnRails
[00:31:39] fgo: has joined #RubyOnRails
[00:31:46] iamjarvo: has joined #RubyOnRails
[00:32:24] devdazed: has joined #RubyOnRails
[00:32:31] iamjarvo: has joined #RubyOnRails
[00:33:19] shyshy: has joined #RubyOnRails
[00:34:18] widith_: has joined #RubyOnRails
[00:35:37] jstanton: has joined #RubyOnRails
[00:36:08] jstanton: hey, can anyone here give me some advice on creating a rest-api?
[00:36:47] simplyianm: has joined #RubyOnRails
[00:37:20] TinkerTyper: has joined #RubyOnRails
[00:40:22] tubbo: jstanton: what do you need help with?
[00:41:08] MEATCHICKEN: I have a team model that can only have 5 registrations
[00:41:14] MEATCHICKEN: How do I ensure only 5 registrations are created?
[00:41:37] MEATCHICKEN: I can do this in ruby code but it isn't safe when 2 ruby processes are doing interleaved work
[00:41:53] MEATCHICKEN: I looked into pessimistic locking. Is this the way to go?
[00:42:03] zendrix: has joined #RubyOnRails
[00:43:02] jstanton: tubbo, so I am pretty new to ruby/rails. I am creating a script that will collect various info on physical/virtual assets. A lot of this data will be the same. from a design perspective would it be better to have the script do all the validation in the script or have the api server do it?
[00:43:33] zendrix: has joined #RubyOnRails
[00:43:55] barnex: Ok, I have fucked up.
[00:44:35] nickfausnight: jstanton: depends on how the script is going to be used
[00:44:44] barnex: I have some nice class methods like 'money: "field_name"' that were supposed to automatically decorate field with that name to money format???
[00:44:51] allcentury: has joined #RubyOnRails
[00:44:57] jstanton: it will be kicked off several times a day
[00:44:58] barnex: And I have all those defined in the parent class, then some classes inheriting from that class.
[00:45:08] nickfausnight: jstanton: will either one ever be used without the other?
[00:45:12] barnex: And things I set in one class get somehow set in the others?
[00:46:28] barnex: ie. I set class variable in subclass SummaryReportTablePresenter < ReportTablePreseneter and it influences the class variable in CashierShiftReportTablePresenter < ReportTablePresenter
[00:46:34] barnex: and I have no idea how to fix it :<
[00:46:50] robustus|Off: has joined #RubyOnRails
[00:46:59] nickfausnight: jstanton: You definitely want your server to validate any data it receives, but I don't see any reason to repeat yourself in your script in this case
[00:47:00] jstanton: btw this will all be written to a db, with several foreign keys. I was thinking about doing updates if the data exists and something changed
[00:48:09] tubbo: jstanton: you should definitely have validation on the server level at some point
[00:48:19] sleungcy: How can i add a custom method that i can use at the top of the class? Like before_filter, attr_accessor.. Etc?
[00:48:21] tubbo: so you might as well only write it once
[00:48:27] sleungcy: What are those called?
[00:48:38] nickfausnight: jstanton: as a general rule, nothing should touch your data in between validations and writing to the DB
[00:49:00] tubbo: sleungcy: they're sometimes referred to colloquially as "macros" because they basically just define functionality or methods for you on the instance.
[00:49:07] simplyianm: has joined #RubyOnRails
[00:49:08] tubbo: sleungcy: but they actually are just class methods
[00:49:13] nhhagen: has joined #RubyOnRails
[00:50:02] jstanton: nickfausnight, tubbo: does it make sense to use a get from the script to to see if the entry exists, then in the script compare the json from the api to the json in the script, if anything has changed do an put or post if it does not exist?
[00:50:18] tubbo: barnex: first of all, class variables are not thread safe. you should be aware of that.
[00:50:20] Lightsword: has joined #RubyOnRails
[00:50:35] barnex: tubbo: I wasn't, but I'm fine with that
[00:50:40] nickfausnight: jstanton: you could just send a PATCH to the server and it will change anything that's d ifferent
[00:50:47] yaymukund: has joined #RubyOnRails
[00:50:50] workmad3: has joined #RubyOnRails
[00:50:59] barnex: I'm using them to declaratively say stuff about class that shouldn't ever change
[00:51:01] jstanton: nickfausnight, really?
[00:51:10] tubbo: barnex: a class variable is going to do that, it's attached to the class, not the class instance (eigenclass)...those are two different things
[00:51:16] jstanton: nickfausnight, how does that handle foreign keys?
[00:51:26] tubbo: http://madebydna.com/all/code/2011/06/24/eigenclasses-demystified.html
[00:51:59] tubbo: barnex: if you have activesupport installed (you do if you're using rails), you can use cattr_accessor to define attr_accessors on the eigenclass
[00:52:04] tubbo: so self.class.your_attr = '' works
[00:52:38] BlissOfBeing: has joined #RubyOnRails
[00:53:10] CyborgCygnus: has joined #RubyOnRails
[00:53:26] tubbo: barnex: a lot of people follow this pattern https://gist.github.com/tubbo/d794e78d6ea37e9fe4eb
[00:53:43] quazimodo: has joined #RubyOnRails
[00:53:52] barnex: thanks tubbo.
[00:54:30] tubbo: barnex: updated to show you what cattr_accessor is doing
[00:55:04] barnex: oh, that actually helps a lot
[00:55:08] jstanton: hmmm.. how do you do a patch with rest-client?
[00:55:16] barnex: because I'd rather have that class instance variable private
[00:55:29] barnex: and if I define accessors I'll get that
[00:55:30] bruno-: has joined #RubyOnRails
[00:56:04] barnex: well, protected obviously
[00:56:19] nickfausnight: jstanton: A PATCH request to /resource/:id/ will be directed to resourceController#update, how it behaves is up to the update method
[00:56:39] tubbo: jstanton: where does the script get its data initially?
[00:57:08] jstanton: tubbo, pretty much I am using facter and some other commands to gather the data.
[00:57:42] tubbo: so you get the data from facter first, then you compare it against your own api if anything changed
[00:58:08] thebatu1: has joined #RubyOnRails
[00:58:23] nickfausnight: jstanton: If PATCH doesn't exist, I'm pretty sure PUT is a synonym
[00:58:43] jstanton: well that is what I am trying to figure out. should I compare the data in the script or on the api?
[00:58:53] nickfausnight: I'd put it in the api
[00:59:13] nickfausnight: Then there's only one transaction
[00:59:51] charliesome: has joined #RubyOnRails
[01:00:05] jstanton: so, do a get in the script to see if there is an entry already. if there is issue a put with that id and move on?
[01:01:14] drupald: has joined #RubyOnRails
[01:01:27] k_89: has joined #RubyOnRails
[01:01:42] tubbo: yeah i would have the script just blindly grab data from facter and PATCH it to the API
[01:02:03] tubbo: oh yeah, and do a GET first to make sure one exists, otherwise create it :)
[01:02:16] jstanton: cool :) thanks for the help.
[01:03:13] SalexW: has joined #RubyOnRails
[01:03:32] k_89: over time, I discovered that it is better to keep validations completely separate from your models. IE, even model validations, which are a given in rails, should exist only because the project requires that an api has to be exposed for them
[01:03:44] k_89: now that I am trying out rails
[01:04:09] k_89: I'd like to follow the same pattern with it.
[01:04:41] k_89: I googled quite a lot, but still haven't found out how to create a separate class which contains all the validations for a particular model
[01:05:22] m0r0n: has joined #RubyOnRails
[01:05:37] nickfausnight: k_89: what's the benefit of doing it that way? Why shouldn't a model know how to validate itself?
[01:05:49] k_89: I mean like, an Order::Validator corresponding to and Order::Model which contains validations for various business processes that can happen on an Order
[01:05:55] _seanc_: has joined #RubyOnRails
[01:06:22] SteenJobs: tubbo: still working on this devise thing - if i have clients and users (our end of things), and i want one login page that directs the user to two different landing pages depending on whether they???re a client or user, would you recommend having two separate tables or one users table with an admin: true/false attribute?
[01:06:51] k_89: nickfausnight, as soon as an api faces the "real world" various operations come into place which deal with data in bulk
[01:07:39] k_89: and the errors that have to be generated should be in response to the format of data the user is sending, and not your models
[01:08:16] k_89: this is specially very prevalent in enterprise software where excel is still a big part of the workflow
[01:08:40] tubbo: SteenJobs: i would recommend keeping User just for authentication and devise stuff, because devise adds so much code to that end of things.
[01:08:53] k_89: I hope that cleared up my reasons
[01:08:59] SteenJobs: tubbo: what do you mean just keeping User?
[01:09:00] Papierkorb: has joined #RubyOnRails
[01:09:20] tubbo: SteenJobs: you could break that functionality off into a belongs_to :profile, polymorphic: true, and have an AdminProfile and ClientProfile which you'd then have controllers for and redirect to
[01:09:35] SteenJobs: tubbo: sounds like much more trouble
[01:09:37] tubbo: because you'll probably want to store differing information based on whether they're an admin or a client
[01:09:47] k_89: so I come back to my question again, Is there some way for me to create a class like Order::Validator (corresponding to an Order::Model) which contains validations for various business processes related to orders ?
[01:10:05] SteenJobs: right - that???s what i thought, but honestly the clients attributes include the user attributes+ so i???ll just leave those extra attributes nil
[01:10:11] SteenJobs: tubbo: and combine into one table
[01:10:42] rhizome: k_89: yes. google rails 3 validations
[01:10:44] SteenJobs: tubbo: the problem with having a separate admin and client profile is i won???t be able to use one login view for both. they would each have to have their own login page???i think.
[01:11:00] tubbo: SteenJobs: i still think User just has too many responsibilities here.
[01:11:08] tubbo: SteenJobs: that's not true, you can use a common form partial
[01:11:09] rhizome: it's not automatic, but you can create validator classes
[01:11:29] tubbo: you can load partials from wherever you want, app/views/shared, whatever
[01:11:31] SteenJobs: tubbo: right but i want them to be able to both login using the same URL
[01:11:40] orikremer: has joined #RubyOnRails
[01:11:51] tubbo: SteenJobs: not sure where your problem is then
[01:11:54] nickfausnight: k_89: not sure I fully understand the use case, but I upgraded a legacy app a year or so back and it did something similar. I'll see if I still have the code / access to the repo
[01:12:14] SteenJobs: tubbo: lemme think about it for a few minutes???i???ll be back if i???m still stuck
[01:12:20] rhizome: SteenJobs: i'm not sure i like it, but i manage something like that with two login forms on one page
[01:12:29] simplyianm: has joined #RubyOnRails
[01:12:42] tubbo: SteenJobs: but, i definitely think separating those concerns is a good idea...having two different objects at least. i still think you're putting too many responsiibilties on User, but maybe not
[01:12:49] rhizome: "kids login here" "parents login here" basically
[01:12:51] SteenJobs: yea you???re probs right
[01:12:57] k_89: rhizome, I checked this out: http://guides.rubyonrails.org/v3.2.13/active_record_validations_callbacks.html#performing-custom-validations, I don't think that's what I am looking for
[01:13:03] k_89: nickfausnight, thanks !
[01:13:13] SteenJobs: rhizome: right so i want to avoid that - i want one single login that redirects depending on the type of account being accessed
[01:13:28] tubbo: having null values for attributes in your database is usually bad news
[01:13:29] rhizome: k_89: yes, that's what i was talking about. there's blog posts and stuff
[01:13:31] dopie: has joined #RubyOnRails
[01:13:38] tubbo: eventually you are going to have to refactor that out. why start off on the wrong foot?
[01:13:51] SteenJobs: tubbo: yea i agree. gonna keep them separate
[01:14:17] nickfausnight: k_89: found it, its kinda ugly. let me create an example file so I don't give out anyone else's code
[01:15:06] rhizome: SteenJobs: you should use one table and not worry about what kind of user they are until after authentication
[01:15:08] Papierkorb: has joined #RubyOnRails
[01:15:57] SteenJobs: rhizome: tubbo makes a good point though
[01:15:59] k_89: nickfausnight, rhizome, the use case is that the flow I want in my actions which modify data is "validate input data -> if it fails, send appropriate error messages, otherwise do whatever that action should do"
[01:16:12] SteenJobs: it???ll be convenient to have two different objects
[01:16:25] rhizome: SteenJobs: i'm only half paying attention
[01:16:38] SteenJobs: rhizome: only half?! i???m insulted
[01:16:48] rhizome: i'm coming into this at the middle
[01:16:51] rhizome: if not the end :P
[01:16:56] k_89: rhizome, In the first step, models are only used to fetch data and all, and in the second step, they do the crud stuff
[01:17:27] rhizome: k_89: validations only run when things change anyway
[01:17:35] rhizome: not sure what the kink is here
[01:18:11] TheNet: I get this error with passenger: https://gist.github.com/net/c8ace0d093430dff4e21
[01:18:22] k_89: example: a warehouse management system, warehouse guys add a new client, your module only handles their workflow, they still do billings using excel because of "reasons"
[01:18:24] simplyia_: has joined #RubyOnRails
[01:18:32] k_89: an excel is prepared of clients inventory
[01:18:34] TheNet: I read the recommended article, still confused
[01:18:35] leafac: has joined #RubyOnRails
[01:18:56] k_89: and that excel is then uploaded on your system
[01:19:08] k_89: now your error messages should point out the flaws in that excel
[01:19:34] k_89: and the format of that excel can be *very* different from your db schema
[01:19:42] k_89: rhizome, get the idea ?
[01:20:04] djbkd_: has joined #RubyOnRails
[01:20:15] rhizome: yes, ETL. just write your own class that cleans things the way you want them. doesn't sound like it's necessary to involve activerecord at that stage at all.
[01:20:45] hmnhf_: has joined #RubyOnRails
[01:21:01] k_89: ahh, but you need to validate and generate error messages, and the format of error messages has to match the format of error messages generated by active record's validators
[01:21:05] rhizome: WinstonWolf.new(some_excel_upload)
[01:21:20] k_89: and after a certain point of time doing this becomes a PITA
[01:21:37] k_89: i mean, I can imagine it becoming a PITA
[01:21:52] jfarmer: k_89 You can include the validations in a standalone module
[01:21:53] nickfausnight: k_89: It was pretty much like this: http://sprunge.us/MSAb?ruby
[01:21:54] nickfausnight: The file I'm basing it off of is well over 2k lines, so if there's anything fundamental missing I can take another look
[01:21:56] k_89: other platforms I have worked with had decent separate validation libs
[01:21:57] rhizome: well but the upload is outside of AR at the checking stage
[01:21:57] jfarmer: And the DB-backed stuff can go to AR
[01:22:20] jfarmer: And the excel-backed stuff can go to, I dunno, some class that includes Active Model
[01:22:31] jfarmer: and both can include the module
[01:22:43] nickfausnight: I hope that's what you're talking about at least
[01:23:00] widith_: has joined #RubyOnRails
[01:23:00] jfarmer: k_89 http://guides.rubyonrails.org/active_model_basics.html
[01:23:29] jfarmer: k_89 Many (if not most) of the "magic" things that ActiveRecord does are actually implemented by ActiveModel
[01:23:39] rhizome: good point
[01:23:41] jfarmer: and you can include them piecemeal
[01:23:52] k_89: cool, looking into it!
[01:23:52] braincrash: has joined #RubyOnRails
[01:23:58] jfarmer: Your module would have identical AR-style validations in them
[01:24:05] jfarmer: validates :name, presence: true
[01:24:19] jfarmer: and both your AR model and AM model would include that module
[01:24:59] jfarmer: I'm just jumping in at the end, so apologies if I'm talking without sufficient context.
[01:25:26] pontiki: has joined #RubyOnRails
[01:25:52] jfarmer: The harder thing are the schema / attribute requirements, I suppose.
[01:25:59] jfarmer: Because AR pulls those dynamically from the database
[01:26:22] jfarmer: And you'd want your AM model to respect the same schema, albeit one that's somehow encoded in Excel.
[01:26:35] rhizome: i have a feeling that's a completely separate task
[01:26:45] rhizome: the mapping
[01:26:53] k_89: yeah, it comes after validations
[01:27:26] nickfausnight: I might be missing something fundamental here with this idea, but isn't it safest to validate your data immediately before writing to db?
[01:27:29] rickmasta: has joined #RubyOnRails
[01:27:37] SteenJobs: rhizome: i???m stuck :(
[01:28:02] k_89: but still, what i was able to make out of this was that i'd have to use ActiveModel thing to create a "model" corresponding to each different "format" of excel, and use that just to validate stuff
[01:28:13] SteenJobs: rhizome: assuming i want to keep two separate models, clients and users, do you have any idea how to use the same login window to direct to two separate locations?
[01:28:15] jfarmer: nickfausnight As i read it, k_89 is imagining someone uploading a spreadsheet (say) and wanting to ask the question, "Does this respect all the same validation requirements as our DB-backed models?"
[01:28:30] rhizome: k_89: read up on workflows. your excel parsing is one stage that will be passed along in the process
[01:28:31] k_89: not quite
[01:28:36] jfarmer: Maybe not "all the same"
[01:28:39] willharrison: has joined #RubyOnRails
[01:28:55] jfarmer: But some combination of overlapping validations + format-specific validations
[01:29:06] DCio: has joined #RubyOnRails
[01:29:17] DCio: im back friends
[01:29:22] rhizome: SteenJobs: that's tubbo's idea :)
[01:29:25] k_89: btw that not quite was for jfarmer
[01:29:31] RegulationD: has joined #RubyOnRails
[01:29:31] SteenJobs: rhizome: haha i know but he???s gone!!!
[01:29:35] jfarmer: Anyhow, hopefully that was helpful!
[01:30:25] rhizome: SteenJobs: one form, two models means you have to auth against both of them to figure out what kind of user they are, but before that you have to have a way of enforcing uniqueness between them, whcih is where my idea came in
[01:30:25] pontiki: hi, folks, i have a question. gist at https://gist.github.com/tamouse/30ed157a20749c4201c5
[01:30:28] DCio: does anyone know how hash tables are represented in the rails console, like if i was running update all and wanted to update all the "pay_info" columns with a a hashtable?
[01:30:32] k_89: I guess creating a different type of Model for the excels is the way to go
[01:30:45] k_89: gonna read up on ActiveModel, thanks guys
[01:30:49] pontiki: i'm wondering how to white list the hash keys in each element of the array in the parameters...
[01:30:49] SteenJobs: rhizome: not sure i even know where to start when implementing that
[01:31:00] rodfersou: has joined #RubyOnRails
[01:31:13] SteenJobs: rhizome: i figured there should be a decently simple way of implementing it using cancancan
[01:31:22] delianid_: has joined #RubyOnRails
[01:31:27] unreal_: has joined #RubyOnRails
[01:31:55] SteenJobs: rhizome: i would redo it and just have one user table and an association for any additional attributes for specific types of users, but the person that built this used two different models so i???d rather not redesign everything
[01:32:40] jfarmer: SteenJobs Two separate models and two separate tables, too?
[01:32:48] jfarmer: Or two separate models sharing a single table?
[01:32:52] SteenJobs: jfarmer: the former
[01:33:09] BlissOfBeing: has joined #RubyOnRails
[01:34:15] dopieee: has joined #RubyOnRails
[01:34:46] SteenJobs: i???m absolutely stumped
[01:35:21] WillAmes: has joined #RubyOnRails
[01:35:44] DCio: has joined #RubyOnRails
[01:35:46] jstanton: has joined #RubyOnRails
[01:36:47] zorak8: has joined #RubyOnRails
[01:36:48] dseitz: has joined #RubyOnRails
[01:37:29] GriffinHeart: has joined #RubyOnRails
[01:37:56] duderonomy: has joined #RubyOnRails
[01:38:08] DCio: Anyone able to help me out with some basic ActiveRecord stuff?
[01:38:41] k_89: DCio, don't ask to ask, just ask
[01:38:57] SeanLazer: has joined #RubyOnRails
[01:39:10] DCio: i did already lol
[01:39:25] k_89: well ask again :P
[01:39:37] fgo: has joined #RubyOnRails
[01:39:39] DCio: Im trying to update an existing database with a new column, i did the migration, but the existing users dont have the column added
[01:39:50] DCio: Im assuming the command is Users.update_all
[01:39:50] beauby: has joined #RubyOnRails
[01:39:50] goodcodeguy: has joined #RubyOnRails
[01:40:01] SalexW: has joined #RubyOnRails
[01:40:13] DCio: but, im trying to update the new column, pay_info, with a nested hashtable, and i dont know how that is represented in the rails console
[01:40:18] sevenseacat: wait, are you trying to update user records, or add a new column to a table?
[01:40:33] DCio: hold on ill copy and paste the migration
[01:40:38] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:40:43] k_89: update the records after adding the column I guess
[01:41:27] DCio: https://gist.github.com/dciotoli/b3ef14c1d8a1603dea44
[01:41:45] DCio: woops no syntax highlighting
[01:42:28] DCio: so basically its a nested hashtable, with the key paypal or creditcard, which wall have keys of dates and values of amounts
[01:42:28] sevenseacat: mmm storing code in a text field
[01:42:38] sevenseacat: this sounds like a bad, bad idea
[01:42:48] sevenseacat: all of your users will now have that default set, yes.
[01:42:57] DCio: i googled how to store hashtables and it said put it in a text field, and then add serializable to the model
[01:43:13] DCio: is there a better way?
[01:43:17] rhizome: oh nice, old project uses spec syntax :/
[01:43:27] sevenseacat: i wouldn't 'store hashtables' personally
[01:43:34] sevenseacat: rhizome: as opposed to?
[01:43:54] DCio: what would you do?
[01:44:06] sevenseacat: make associations for the data
[01:44:21] sevenseacat: store them as records so i can filter, search, etc.
[01:44:23] bmurt: has joined #RubyOnRails
[01:44:34] DCio: i guess its time to google again!
[01:44:39] echosystm: has joined #RubyOnRails
[01:44:43] k_89: DCio, are you on postgres 9.4+ by any chance
[01:44:44] GriffinHeart: Hallo, is there a way to do some sort of "inheritance" on routes? like routes not in `namespace :v2` will try to find routes in `namespace :v1`?
[01:44:46] rhizome: sevenseacat: testunit
[01:44:58] k_89: why use text field then, why not use json ?
[01:45:01] sevenseacat: simple hashes are fine, but when you start talking about nested hashes of records - hell no
[01:45:08] sevenseacat: rhizome: rspec ftw :)
[01:45:10] jfarmer: has joined #RubyOnRails
[01:45:14] k_89: you can even query on that
[01:45:27] DCio: oooh shit yeah thats true
[01:45:34] echosystm: can someone explain to me the concurrency implications for using SSEs via ActionController::Live? What rack server do I need to use and how do i need to write my code to ensure the server can handle many connections?
[01:45:47] DCio: json for nested hash though? or should i try and figure out what associations are and do that?
[01:46:05] sevenseacat: !associations
[01:46:05] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[01:47:02] darrik: has joined #RubyOnRails
[01:47:26] echosystm: all the examples i've seen use one thread per SSE request. that won't scale, so i'm wondering how people use ActionController::Live in the real world.
[01:47:38] sevenseacat: echosystm: i dont know anyone that does use it.
[01:47:42] k_89: use node.js :P
[01:47:53] Brozo: has joined #RubyOnRails
[01:48:05] echosystm: is there any way to use fibers and some kind of reactor instead?
[01:48:11] zorak8: has joined #RubyOnRails
[01:49:20] joaomdmoura: has joined #RubyOnRails
[01:49:32] echosystm: i remember reading about some unofficial rack thing that allows you to selectively switch from a thread to an event based solution
[01:49:35] echosystm: but i can't find it now
[01:49:47] echosystm: it's what FAYE etc rely upon to work
[01:49:50] Hobogrammer: has joined #RubyOnRails
[01:50:25] nhhagen: has joined #RubyOnRails
[01:52:07] echosystm: basically i want a rack server that is event-machine based (or similar), but creates a thread per request and allows you to go back to event-based on a per-controller basis
[01:52:25] echosystm: that way i can unwind the stack for SSE controllers
[01:53:26] jwaldrip_: has joined #RubyOnRails
[01:54:23] coderkatze: has joined #RubyOnRails
[01:55:00] dhosterman: has joined #RubyOnRails
[01:55:36] kinduff: has joined #RubyOnRails
[01:56:52] earthquake: has joined #RubyOnRails
[01:58:52] wwalker: recommendations for handling tables with multi-column primary keys?
[01:59:32] wwalker: I've tried the composite_primary_key gem but it seems to not work (throws a 500 error yet no backtrace)
[01:59:41] merryfett: has joined #RubyOnRails
[02:00:04] iamjarvo: has joined #RubyOnRails
[02:00:48] iamjarvo: has joined #RubyOnRails
[02:01:31] iamjarvo: has joined #RubyOnRails
[02:01:46] Brozo: has joined #RubyOnRails
[02:01:57] michael_mbp: has joined #RubyOnRails
[02:06:10] willharrison: has joined #RubyOnRails
[02:06:38] chintanparikh: has joined #RubyOnRails
[02:08:05] SteenJobs: has joined #RubyOnRails
[02:08:47] beauby: has joined #RubyOnRails
[02:09:04] jenrzzz: has joined #RubyOnRails
[02:09:34] leslie1: has joined #RubyOnRails
[02:10:06] Lightsword: has joined #RubyOnRails
[02:11:23] Valien: has joined #RubyOnRails
[02:12:19] Lightsword: has joined #RubyOnRails
[02:12:46] goodcodeguy: has joined #RubyOnRails
[02:12:59] ivanskie: has joined #RubyOnRails
[02:14:12] philcrissman: has joined #RubyOnRails
[02:14:36] PlasmaStar: has joined #RubyOnRails
[02:14:41] varunwachaspati: has joined #RubyOnRails
[02:16:30] tubbo: has joined #RubyOnRails
[02:17:06] GriffinHeart: has joined #RubyOnRails
[02:17:08] Lightsword: has joined #RubyOnRails
[02:20:56] ogpastaling: has joined #RubyOnRails
[02:22:26] rhizome: rails and composite keys are not the best of friends
[02:24:10] Rubie: has joined #RubyOnRails
[02:24:19] paulcsmith__: has joined #RubyOnRails
[02:26:17] baweaver: has joined #RubyOnRails
[02:27:06] GriffinHeart: Is there a strategy to avoid copy pasting all routes and controllers when doing API versioning?
[02:30:29] mark[oz]: has joined #RubyOnRails
[02:31:29] cornerma1: has joined #RubyOnRails
[02:33:23] Lightsword: has joined #RubyOnRails
[02:35:00] Spami: has joined #RubyOnRails
[02:35:49] beauby: has joined #RubyOnRails
[02:36:21] mark[oz]: has joined #RubyOnRails
[02:36:41] madebymarkca: has joined #RubyOnRails
[02:37:05] iamjarvo_: has joined #RubyOnRails
[02:37:49] iamjarvo_: has joined #RubyOnRails
[02:38:12] paulcsmith__: has joined #RubyOnRails
[02:40:46] givanse: has joined #RubyOnRails
[02:41:00] RegulationD: has joined #RubyOnRails
[02:41:12] delianides: has joined #RubyOnRails
[02:41:55] mark[oz]: has joined #RubyOnRails
[02:46:11] rhizome: how can i have guard run a model's unit test when the model is saved?
[02:47:04] thebatu1: has joined #RubyOnRails
[02:50:43] mark[oz]: has joined #RubyOnRails
[02:50:50] baweaver: rhizome: Set up the watcher for it
[02:51:13] baweaver: https://github.com/guard/guard-rspec#typical-rails-app
[02:51:30] Lightsword: has joined #RubyOnRails
[02:52:06] nhhagen: has joined #RubyOnRails
[02:52:11] rhizome: ah right. just checked and it was still looking in test/unit rather than test/models
[02:52:25] rhizome: looking *for
[02:52:47] Lightsword: has joined #RubyOnRails
[02:53:24] stardiviner: has joined #RubyOnRails
[02:57:20] baweaver: rhizome: No problem mate.
[02:57:26] baweaver: Look into terminal notifier as well
[02:57:29] baweaver: handy if you have a mac
[02:57:46] rhizome: yeah, i use all that, just had to tweak my dirs. this app started in 2.x days
[03:00:41] Lightsword: has joined #RubyOnRails
[03:00:43] willharrison: has joined #RubyOnRails
[03:01:19] kinduff: has joined #RubyOnRails
[03:01:19] kinduff: has joined #RubyOnRails
[03:02:29] mark[oz]: has joined #RubyOnRails
[03:03:54] mheld: has joined #RubyOnRails
[03:05:04] Trynemjoel: has joined #RubyOnRails
[03:07:38] mark[oz]: has joined #RubyOnRails
[03:09:39] beauby: has joined #RubyOnRails
[03:10:21] hahuang65: has joined #RubyOnRails
[03:11:48] Rubie: has joined #RubyOnRails
[03:14:55] mark[oz]: has joined #RubyOnRails
[03:15:23] chagel: has joined #RubyOnRails
[03:15:29] braincrash: has joined #RubyOnRails
[03:16:12] n80: has joined #RubyOnRails
[03:17:20] TommyTheKid: has joined #RubyOnRails
[03:17:32] tubbo: has joined #RubyOnRails
[03:19:12] scottmatheina: has joined #RubyOnRails
[03:20:39] conanza: has joined #RubyOnRails
[03:20:43] jpstokes: has joined #RubyOnRails
[03:23:15] fgo: has joined #RubyOnRails
[03:25:20] webguynow: has joined #RubyOnRails
[03:28:18] asheinfeld: has joined #RubyOnRails
[03:32:02] yfeldblum: has joined #RubyOnRails
[03:34:04] pepelui: has joined #RubyOnRails
[03:35:20] gniquil: has joined #RubyOnRails
[03:36:04] mark[oz]: has joined #RubyOnRails
[03:37:11] cryptocronus: has joined #RubyOnRails
[03:37:14] ramfjord: has joined #RubyOnRails
[03:38:37] sp1rs: has joined #RubyOnRails
[03:39:00] SalexW: has joined #RubyOnRails
[03:42:20] Valien: has joined #RubyOnRails
[03:45:05] jenrzzz: has joined #RubyOnRails
[03:50:39] baweaver: More on the design end here, but does anyone think Bootstrap has too much whitespace?
[03:51:28] djbkd: has joined #RubyOnRails
[03:53:06] nhhagen: has joined #RubyOnRails
[03:53:48] MuffinPimp: has joined #RubyOnRails
[03:54:15] rhizome: not sure about BS per se, but there's definitely a whitespace bubble these days
[03:54:28] nvll1: has joined #RubyOnRails
[03:54:32] deavidsedice: has joined #RubyOnRails
[03:54:50] GriffinHeart: has joined #RubyOnRails
[03:56:20] Siyo: has joined #RubyOnRails
[03:56:20] Siyo: has joined #RubyOnRails
[03:56:29] sevenseacat: a little more than I'd like. but not excessively so.
[03:57:02] baweaver: Making a thinline version of it for displaying dense data
[03:57:21] rhizome: i'm on dribbble, sellin ur themez
[03:57:41] hoodow: has joined #RubyOnRails
[03:57:41] hoodow: has joined #RubyOnRails
[04:00:09] baweaver: I tend to opensource things I do on my own time.
[04:00:53] melonstorm: has joined #RubyOnRails
[04:01:05] echosystm: i need to send some data from the current user to an external web service
[04:01:10] echosystm: would it be bad to put that in the user model?
[04:01:26] baweaver: context needed
[04:01:50] x44x45x41x4E: has joined #RubyOnRails
[04:01:50] x44x45x41x4E: has joined #RubyOnRails
[04:01:54] x44x45x41x4E: has left #RubyOnRails: ()
[04:01:57] echosystm: the current user has some properties, like the number of posts and so on
[04:02:01] jfarmer: echosystm Yes
[04:02:11] echosystm: i need to do a call to an external web service to send those values through
[04:02:13] jfarmer: The model should not be communicating directly with some external API
[04:03:08] PsYChiC: has joined #RubyOnRails
[04:03:10] echosystm: ok ok so where should that code go?
[04:03:15] echosystm: somewhere in lib?
[04:03:16] BlissOfBeing: has joined #RubyOnRails
[04:03:25] echosystm: its shared between controllers, so i dont want to put it in the controller
[04:03:28] jfarmer: http://en.wikipedia.org/wiki/Command_pattern
[04:03:55] jfarmer: The "best" way is to have a standalone class that represents the work to be done (or "command" to be executed).
[04:04:20] jfarmer: You'd initialize it with the relevant data ??? perhaps an instance of some API client and your model ??? and it would facilitate the work you want to perform.
[04:04:39] Mia: has joined #RubyOnRails
[04:04:39] Mia: has joined #RubyOnRails
[04:04:41] hoodow: has joined #RubyOnRails
[04:04:41] hoodow: has joined #RubyOnRails
[04:04:42] jfarmer: And expose interfaces that allow other parts of your system (like the controller) to see whether the command succeeded, failed, and so on.
[04:05:32] eggoez: has joined #RubyOnRails
[04:06:00] merryfett: has joined #RubyOnRails
[04:06:22] jfarmer: Does that make sense?
[04:06:30] Elion: has joined #RubyOnRails
[04:06:33] jfarmer: Where that class goes varies a bit, but lib/ is a not-crazy place to put it
[04:06:40] mark[oz]: has joined #RubyOnRails
[04:08:05] Lightsword: has joined #RubyOnRails
[04:10:26] tjbiddle: has joined #RubyOnRails
[04:12:14] w0rd-driven: has joined #RubyOnRails
[04:16:00] braincra-: has joined #RubyOnRails
[04:18:21] tubbo: has joined #RubyOnRails
[04:19:12] roolo: has joined #RubyOnRails
[04:23:36] SalexW: has joined #RubyOnRails
[04:24:57] leslie1: has joined #RubyOnRails
[04:29:35] duhhhsty: has joined #RubyOnRails
[04:30:09] RegulationD: has joined #RubyOnRails
[04:31:58] n3b: has joined #RubyOnRails
[04:33:17] bruno-: has joined #RubyOnRails
[04:35:58] thebatu1: has joined #RubyOnRails
[04:36:26] gniquil: has joined #RubyOnRails
[04:38:05] fgo: has joined #RubyOnRails
[04:45:49] hahuang65: has joined #RubyOnRails
[04:46:36] Lightsword: has joined #RubyOnRails
[04:48:24] euphoriaa: has joined #RubyOnRails
[04:50:50] x44x45x41x4E: has joined #RubyOnRails
[04:50:50] x44x45x41x4E: has joined #RubyOnRails
[04:51:01] mark[oz]: has joined #RubyOnRails
[04:51:05] acti0nman: has joined #RubyOnRails
[04:51:33] x44x45x41x4E: Is using OpeDNS and DNSCrypt safe? And better than using my ISPs DNS?
[04:52:57] varunwachaspati: has joined #RubyOnRails
[04:53:08] x44x45x41x4E: Ummm. Wrong channel. Sorry
[04:53:41] GriffinHeart: has joined #RubyOnRails
[04:53:51] x44x45x41x4E: has left #RubyOnRails: ()
[04:54:17] Aeyrix: You have a name like that and you don't know whether or not OpenDNS is safer than using your ISPs DNS?
[04:54:43] Aeyrix: I mean that name just screams "I am a hacker". :^)
[04:56:26] nhhagen: has joined #RubyOnRails
[04:57:19] Dreamer3: has joined #RubyOnRails
[04:57:41] Obfuscate: has joined #RubyOnRails
[04:58:55] jenrzzz: has joined #RubyOnRails
[05:03:43] snappahead: has joined #RubyOnRails
[05:04:56] olegtc: has joined #RubyOnRails
[05:06:26] bobbobbi_: has joined #RubyOnRails
[05:09:21] stardiviner: has joined #RubyOnRails
[05:11:09] randomizer: has joined #RubyOnRails
[05:13:15] Cache_Money: has joined #RubyOnRails
[05:16:39] mark[oz]: has joined #RubyOnRails
[05:23:32] funnymanva: has joined #RubyOnRails
[05:25:22] mark[oz]: has joined #RubyOnRails
[05:25:28] random: has joined #RubyOnRails
[05:25:35] hahuang65: has joined #RubyOnRails
[05:26:09] djbkd: has joined #RubyOnRails
[05:26:29] djbkd: has joined #RubyOnRails
[05:29:27] sandelius: has joined #RubyOnRails
[05:29:51] lxsameer: has joined #RubyOnRails
[05:34:06] yfeldblum: has joined #RubyOnRails
[05:35:25] rvanlieshout: has joined #RubyOnRails
[05:35:38] KamalKaur: has joined #RubyOnRails
[05:36:50] tagrudev: has joined #RubyOnRails
[05:39:00] KamalKaur: This is my first experience with RoR, I have got a little task to add CSS and improve the PDF file. Which I know that the view I need to ad styles is: intervals.pdf.erb. I just need to add a stylesheet in it. I am not getting how to add? Here only 1 file is added.. style.css but I don't find i anywhere in the project structure. Please help to add the css file using SASS. Is there anything I need to do separately?
[05:39:36] sarink: has joined #RubyOnRails
[05:39:58] michael_mbp: has joined #RubyOnRails
[05:40:34] KamalKaur: All the styles are in assets/stylesheets
[05:40:37] djbkd_: has joined #RubyOnRails
[05:41:29] srinidhi: has joined #RubyOnRails
[05:42:43] rvanlieshout: what's the content of the controller and that view?
[05:43:10] metus_violarium: has joined #RubyOnRails
[05:43:38] KamalKaur: The view generates a PDF, let me show you the code snippet
[05:45:23] ivanskie: has joined #RubyOnRails
[05:50:14] starfox_sf: has joined #RubyOnRails
[05:50:35] starfox_sf: quick question, what are the situations when a user session (regular cookie based session) might change besides login or logout and cookie expiration? For instance, if I restart the rails app will all the sessions change?
[05:51:03] starfox_sf: has joined #RubyOnRails
[05:52:14] latemus: has joined #RubyOnRails
[05:53:05] KamalKaur: rvanlieshout: Here is the controller: http://paste.ubuntu.com/11558345/
[05:55:04] KamalKaur: rvanlieshout: Ping
[05:55:12] KamalKaur: The view: https://gist.github.com/KamalKaur/b4a7708417d5193e3213
[05:55:53] rvanlieshout: KamalKaur: and app/views/layouts/pdf.html.erb
[05:56:51] KamalKaur: here: http://paste.ubuntu.com/11558482/
[05:57:12] rvanlieshout: KamalKaur: ok. that file indicates it just includes the application stylesheet
[05:57:48] KamalKaur: So if I add the styles in application.scss, it should work?
[05:58:02] rvanlieshout: or in one of the files it includes
[05:58:20] KamalKaur: no, this file is empty, only with default comments
[05:58:32] KamalKaur: i mean application.scss
[05:59:16] KamalKaur: Once I had little experience with SASS, that time, I had to compile it to css and to make it working, Is something like this required in ror?
[05:59:28] rvanlieshout: that happens automatically
[05:59:41] KamalKaur: ok, I am trying to add my styles in application.scss
[06:00:19] mark[oz]: has joined #RubyOnRails
[06:01:36] Rubie: has joined #RubyOnRails
[06:06:04] latemus: how do I make rails generate sass assets rather than scss?
[06:06:17] Brozo: has joined #RubyOnRails
[06:07:11] djbkd: has joined #RubyOnRails
[06:08:29] sevenseacat: latemus: https://github.com/rails/sass-rails/#configuration
[06:09:12] Brozo: has joined #RubyOnRails
[06:10:29] KamalKaur: rvanlieshout: Well, it did nothing
[06:10:45] KamalKaur: Can't I add a separate file and just add its link to my view/
[06:11:23] randomizer: has joined #RubyOnRails
[06:11:43] rvanlieshout: find out what command is executed for wkhtmltopdf
[06:12:24] rvanlieshout: and try to locate the url it uses to generate the pdf
[06:12:30] rvanlieshout: so we can verify your css is actually in there
[06:12:47] abuzze: has joined #RubyOnRails
[06:14:37] existensil: has joined #RubyOnRails
[06:16:25] KamalKaur: rvanlieshout: Can't I get something from server logs? ps ww doesn't give any such info
[06:16:53] rvanlieshout: that ps should only work in the second it's generating
[06:17:30] KamalKaur: Sorry to ask but How to do it?
[06:18:07] Lightsword: has joined #RubyOnRails
[06:18:36] KamalKaur: rvanlieshout: Ok, I got this: 9972 pts/14 Sl+ 0:00 /home/kamaljeet/.rvm/gems/ruby-2.2.1/gems/wkhtmltopdf-binary-0.9.9.3/bin/wkhtmltopdf_linux_x64 -q file:///tmp/wicked_pdf20150604-9405-71rid4.html /tmp/wicked_pdf_generated_file20150604-9405-11xpoyz.pdf
[06:19:01] RegulationD: has joined #RubyOnRails
[06:19:16] rvanlieshout: ah. so it saves it to a file
[06:19:29] rvanlieshout: are those files still available in /tmp?
[06:19:31] KamalKaur: And this is also there: ruby /home/kamaljeet/.rvm/gems/ruby-2.2.1/bin/wkhtmltopdf -q file:///tmp/wicked_pdf20150604-9405-71rid4.html /tmp/wicked_pdf_generated_file20150604-9405-11xpoyz.pdf
[06:20:01] KamalKaur: This PDF is sent as an email
[06:20:04] dideler: has joined #RubyOnRails
[06:20:29] KamalKaur: BUt not there in /tmp
[06:20:59] rvanlieshout: cat /tmp/*.hml
[06:21:06] rvanlieshout: while that command is running
[06:22:52] KamalKaur: While the pdf is being generated?
[06:23:00] patie: has joined #RubyOnRails
[06:23:27] KamalKaur: No, it says "No such file or directory" everytime
[06:23:37] ogpastaling: has joined #RubyOnRails
[06:23:49] benhuda: has joined #RubyOnRails
[06:24:50] thebatu1: has joined #RubyOnRails
[06:25:16] KamalKaur: rvanlieshout: Can the rails server logs help anyhow?
[06:25:44] jeanre: has joined #RubyOnRails
[06:25:44] jeanre: has joined #RubyOnRails
[06:25:47] rvanlieshout: maybe there are debugging options for wicked pdf
[06:26:24] jeanre: rvanlieshout how goes :)
[06:26:47] KamalKaur: rvanlieshout: How to find if the CSS is there or not?
[06:30:09] rvanlieshout: KamalKaur: it should be in that html file
[06:30:12] rvanlieshout: jeanre: awesome
[06:30:26] choke: has joined #RubyOnRails
[06:30:32] sleungcy: has joined #RubyOnRails
[06:30:33] XThief: has joined #RubyOnRails
[06:30:45] KamalKaur: rvanlieshout: Which html?
[06:31:38] rvanlieshout: that one that exists for split second in /tmp
[06:31:48] rvanlieshout: so similar to running the ps run cat /tmp/*.html
[06:32:24] djbkd: has joined #RubyOnRails
[06:33:32] jenrzzz: has joined #RubyOnRails
[06:34:12] KamalKaur: rvanlieshout: But the css added in style tags, even inline css doesn't work
[06:34:22] rvanlieshout: what css are you adding?
[06:35:26] dvdchr: has joined #RubyOnRails
[06:36:35] KamalKaur: In the intervals.pdf.rdb, I tried adding sample CSS, jsut to check.. oh it worked this time
[06:38:04] KamalKaur: But can't afford to add that much inline css. .I just want to add a separate file. I tried this: <p style="font-size:36px;"> kamal </p>
[06:38:05] riotjones: has joined #RubyOnRails
[06:42:39] aufi: has joined #RubyOnRails
[06:42:52] sIeungcy: has joined #RubyOnRails
[06:44:28] rvanlieshout: KamalKaur: iirc wicked-helpers place it inline
[06:45:17] Obfuscate: has joined #RubyOnRails
[06:45:44] KamalKaur: I mean to say, one should not practice using inline CSS in views
[06:45:53] KamalKaur: or it's fine?
[06:46:02] TommyTheKid: it seems like "rake assets:precompile" compiles all assets even if none have changed, if the path has changed that I am compiling in (datestamp'd releases directory for example)
[06:46:24] TommyTheKid: is there a way to override that behavior? maybe make it use a "checksum" or something?
[06:46:58] rvanlieshout: what rails version?
[06:46:59] mark[oz]: has joined #RubyOnRails
[06:47:26] rvanlieshout: and how often would you change the path?
[06:47:46] TommyTheKid: every deploy (capistrano creates a new .../releases/(*DATESTAMP*) each time
[06:48:03] rvanlieshout: arent assets symlinked to shared by default?
[06:48:08] maz-dev: has joined #RubyOnRails
[06:48:14] TommyTheKid: tmp/cache and public/assets is symlinked
[06:48:19] IanVorn: has joined #RubyOnRails
[06:48:28] rvanlieshout: did you add your own task for compiling assets?
[06:48:40] TommyTheKid: no, I am using the "rails/assets" stuff
[06:48:49] gauke: has joined #RubyOnRails
[06:49:05] rvanlieshout: hm.. that's strange. i didn't see that happen for my projects yet
[06:49:11] TommyTheKid: capistrano is creating the situation, but you can reproduce it locally, just rename the "railsroot" directory
[06:49:15] rvanlieshout: so your precompile takes a long time _every_ time?
[06:49:34] TommyTheKid: not if I run it subsequent times
[06:49:42] TommyTheKid: only when its a new directory name
[06:49:51] rvanlieshout: for each new deploy
[06:50:05] rvanlieshout: what capistrano version?
[06:50:12] chintanparikh: has joined #RubyOnRails
[06:50:13] edwinrozario: has joined #RubyOnRails
[06:51:07] rvanlieshout: and the log output shows you it's recompiling everythign?
[06:51:21] TommyTheKid: yea, and it takes ~7 mins instead of ~5 seconds ;)
[06:51:50] sleungcy: has joined #RubyOnRails
[06:52:13] rvanlieshout: and it's not the deploy:assets:update_asset_mtime task?
[06:52:23] sleungcy: has joined #RubyOnRails
[06:52:49] sleungcy: has joined #RubyOnRails
[06:52:55] rvanlieshout: https://github.com/capistrano-plugins/capistrano-faster-assets
[06:53:40] TommyTheKid: sure that helps a bit
[06:54:04] rvanlieshout: isn't that the exact problem you're having?
[06:54:33] TommyTheKid: sortof, the problem is that "rake assets:precompile" is compiling *all* assets not just the changed ones
[06:55:46] fp-: has joined #RubyOnRails
[06:55:55] fp-: hey all
[06:56:24] puya: has joined #RubyOnRails
[06:56:33] latemus: sevenseacat: hey thanks
[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
[06:57:34] KamalKaur: rvanlieshout: Hey, if I directly place css in an scss file, it should work, right?
[06:57:39] rvanlieshout: KamalKaur: yes
[06:58:33] puya: has left #RubyOnRails: ()
[06:59:13] rvanlieshout: fp-: Recording.where("(recordable_type = 'Company' AND recordable_id = :company_id) OR (recordable_type = 'Person' AND recordable_id = :person_id", company_id: Company.last.id, person_id: Person.last.id)
[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:06:34] arBmind: has joined #RubyOnRails
[07:06:48] nhhagen: has joined #RubyOnRails
[07:07:18] ivanskie: has joined #RubyOnRails
[07:07:47] KamalKaur: rvanlieshout: Well, I have added it in style tag because application.scss didn't show anything :/
[07:08:00] aditya432: has joined #RubyOnRails
[07:08:38] aditya432: How can I make something like fb chat for my website?
[07:09:11] Lightsword: has joined #RubyOnRails
[07:13:13] GriffinHeart: has joined #RubyOnRails
[07:15:07] fp-: has left #RubyOnRails: ("Be back later ...")
[07:15:20] aganov: has joined #RubyOnRails
[07:17:57] comrad: has joined #RubyOnRails
[07:18:51] jeanre: has joined #RubyOnRails
[07:18:51] jeanre: has joined #RubyOnRails
[07:18:56] anti-freeze: has joined #RubyOnRails
[07:19:00] srinidhi: has joined #RubyOnRails
[07:19:55] squiercaster: has joined #RubyOnRails
[07:20:08] rickmasta: has joined #RubyOnRails
[07:22:22] nhhagen: has joined #RubyOnRails
[07:29:48] Macaveli: has joined #RubyOnRails
[07:32:40] kerunaru: has joined #RubyOnRails
[07:32:47] Pathfinder: has joined #RubyOnRails
[07:33:50] simmerz: has joined #RubyOnRails
[07:34:05] artto: has joined #RubyOnRails
[07:34:59] echosystm: if i need something to happen every time a model is created and that model can be created from many different places in the app, what is the best way to do that without using observers?
[07:35:18] echosystm: everyone talks about observers being an anti-pattern, but there doesn't seem to be any good alternative
[07:35:40] tvw: has joined #RubyOnRails
[07:35:51] Rubie: has joined #RubyOnRails
[07:35:53] sevenseacat: define 'something to happen'
[07:36:08] sevenseacat: and are you sure it's *every time* a model is created?
[07:36:26] echosystm: yeah, it's every time
[07:36:44] echosystm: every time a Message is created, the recipient should be emailed
[07:36:44] thebatu1: has joined #RubyOnRails
[07:36:48] sevenseacat: so, when you do it in the console, when you do it in tests, when you do it in a rake task...?
[07:37:12] echosystm: ok, almost every time :P
[07:37:24] sevenseacat: sounds like a good place for a service object.
[07:37:27] hamster88: has joined #RubyOnRails
[07:37:31] nhhagen: has joined #RubyOnRails
[07:37:33] hamster88: Hello People :D
[07:37:38] echosystm: ok now i've been reading about service objects
[07:37:45] sevenseacat: you can couple the behaviour together, for when you need it
[07:38:13] echosystm: but that means i still need to remember to go Service.send_notification every time i create a model
[07:38:40] sevenseacat: because you'd wrap up the create/send into one object, the service object
[07:38:45] echosystm: or should the service be like "Service.create_model_and_send_notification"
[07:38:46] sevenseacat: and you'd call that instead
[07:39:04] tbuehlmann: I don't understand why observers should be an antipattern
[07:39:14] hamster88: I have added the paperclip to enable file upload and generated migrations and everything. When i go to /posts/new, (where the user will be able to post) i get following error. "undefined method `image' for #<Post:0x007f8dcd80bf08>" . Gist at https://gist.github.com/thedesignable/4b090c0d27c360ca83a5
[07:39:15] tbuehlmann: can you enlighten me?
[07:39:17] echosystm: what's the best way to write a service object? all required data injected into constructor and then a "run" method?
[07:39:31] echosystm: or just a class method like Service.do_the_thing ?
[07:39:36] sevenseacat: tbuehlmann: because why should your data persistence object, an AR model, know about business logic like sending emails
[07:39:38] echosystm: the latter seems less OOP
[07:40:00] tbuehlmann: sevenseacat, it wouldn't, that's why I use observers
[07:40:11] jeanre: has joined #RubyOnRails
[07:40:11] jeanre: has joined #RubyOnRails
[07:40:27] sevenseacat: oh i misread the question. i'm having some kind of day
[07:40:39] sevenseacat: because you never want something to be observed *all the time*
[07:41:02] bruno-: has joined #RubyOnRails
[07:41:02] tbuehlmann: like.. active support notifications?
[07:41:15] sevenseacat: and it couples together the complete behaviour of the observer, and the complete behaviour of the object being observed
[07:41:28] sevenseacat: instead of just putting the two operations you want to be coupled, together into one place
[07:41:47] sevenseacat: and making it explicit
[07:42:13] echosystm: ok sevenseacat , what happens when i need to create the model, send the email, then do something else, or some arbitrary combination of things
[07:42:40] tbuehlmann: using observers is pubsub to me, only hitting the observer method on certain callbacks
[07:43:01] karimb: has joined #RubyOnRails
[07:43:15] sevenseacat: echosystm: if all the behaviour should be done when a message gets created in your interface, then it all goes into the service object
[07:43:29] sevenseacat: the idea is to only couple things *when they need to be coupled*
[07:43:30] lxsameer: guys I read some blog posts about dynamic router (routes from db) how do you implement this ?
[07:43:34] echosystm: but what about in different contexts?
[07:43:46] hamster88: any idea why is that error coming up? :/
[07:43:49] sevenseacat: as soon as you introduce something like observers, you introduce 'but what about when I need to skip the callback for reason X Y or Z"
[07:44:37] echosystm: now if this code doesn't get duplicated in other areas, should it just be put straight in the controller?
[07:44:42] tbuehlmann: sevenseacat, that's the observers task to do
[07:44:44] echosystm: lets say the models only get created in one place
[07:45:03] tbuehlmann: "unless object.mail_sent?; ...; end" as example
[07:45:05] sevenseacat: tbuehlmann: what, be littered with ten tonnes of conditional logic to make sure that it only gets executed when you need it to be?
[07:45:14] sevenseacat: instead of only running it at all when you need it to be run
[07:46:00] sevenseacat: 'i'm going to incur the overhead of running this callback every time I save an object, but its okay because I put a conditional in there so it hardly ever actually gets executed'
[07:46:11] sevenseacat: its poor design
[07:47:22] echosystm: sevenseacat: what is the best style for writing services; class methods requiring all necessary objects as parameters, or a class with a constructor that takes all the needed objects and has a "run" method?
[07:47:58] maz-dev: has joined #RubyOnRails
[07:48:25] sevenseacat: i'd say a service shouldnt be instantiated, but thats just me.
[07:48:43] livathinos: has joined #RubyOnRails
[07:49:00] echosystm: ok now last question
[07:49:32] echosystm: say the model only gets created in one controller method
[07:49:40] ndrei: has joined #RubyOnRails
[07:49:42] echosystm: do you just write the email code directly in the controller?
[07:50:00] echosystm: it seems the project would get out of control if you wrote services for everything
[07:50:15] sevenseacat: i'd put the call to the mailer in the controller, if i wasn't backgrounding it.
[07:50:32] sevenseacat: well no, you'd have very well defined actions that should take place at certain stages of the lifecycle
[07:50:55] saimancroy: has joined #RubyOnRails
[07:52:21] krz: has joined #RubyOnRails
[07:52:41] tbuehlmann: I don't think it's poor design. what's the other option? adding a service object call in the controller to send an e-mail? it won't work in the console then, I have to remember to call it. an observer will do that. what's another option? having an after_create callback in the model (same as observer, but inside the model), but that's not the right place to do something like sending an
[07:52:41] tbuehlmann: e-mail. you'd have to write a service object for creating the model _and_ sending the e-mail, that's a valid approach and I use it. tasks that HAVE to run after certain model actions are a perfect example for observers, though
[07:53:29] AlHafoudh: hi guys, should I try to change foreman log output format or do it somehow else? I want to centralize the logs, but foreman has awful format :(
[07:53:30] sevenseacat: tbuehlmann: thats exactly what I said, create a service for creating the model and sending the email. that way you can run it when you need to, and can still interact with the model when you need to.
[07:53:31] tbuehlmann: observers are service objects, if you will. you just don't have to call them manually
[07:53:41] sevenseacat: and thats why they're bad design.
[07:53:48] Aeyrix: >offload email to mandrill
[07:53:50] Aeyrix: >problem solved
[07:53:58] sevenseacat: Aeyrix: wrong problem.
[07:54:05] Aeyrix: It solves all problems.
[07:54:15] scc: has joined #RubyOnRails
[07:55:09] hamster88: resolved it xD
[07:55:38] mikecmpbll: has joined #RubyOnRails
[07:56:17] GriffinHeart: has joined #RubyOnRails
[07:56:24] maz-dev_: has joined #RubyOnRails
[07:57:38] tbuehlmann: sevenseacat, I want to understand you, but all I read is "not having to call some code manually is bad design"
[07:57:50] jsrn_: has joined #RubyOnRails
[07:58:15] sevenseacat: tbuehlmann: no, bad design is coupling two things together always, and then writing logic inside them to decouple them when necessary.
[07:58:21] sevenseacat: (which is your conditional logic)
[07:59:03] Brozo: has joined #RubyOnRails
[07:59:27] michael_mbp: has joined #RubyOnRails
[08:00:57] tbuehlmann: okay, so, what do you do when you want to do certain things upon creating a model? it's important, like, validating cache or something. you don't want to forget about it. will you then always use the CreateModelAndInvalidateCache service instead of the model?
[08:01:53] sevenseacat: though i'd name it better than that.
[08:02:36] sevenseacat: if the two operations go together, then they should be located together and called together.
[08:02:53] sevenseacat: not keeping one piece over here in a mysterious observer that has no direct reference to anything and automagically gets called
[08:03:49] mikecmpbll: i like automagicalness
[08:04:21] Maya_: has joined #RubyOnRails
[08:04:43] yfeldblum: has joined #RubyOnRails
[08:04:59] sevenseacat: except when you have no idea that its running because you have no reference to it in your code
[08:06:30] mikecmpbll: it's a balance, everything's a balance
[08:07:39] neanderslob: hi all, I was wondering where I might find the rails native form_for helper methods (wanted to understand better how the framework is written)
[08:07:42] arup_r: has joined #RubyOnRails
[08:07:46] neanderslob: anyone know off the top of their head?
[08:07:55] RegulationD: has joined #RubyOnRails
[08:08:06] tomkadwill: has joined #RubyOnRails
[08:08:17] sevenseacat: ACTION goes to google "form_for"
[08:08:18] sevenseacat: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html
[08:08:19] mikecmpbll: ActionView::Helpers::FormHelper
[08:08:32] sevenseacat: it was literally the first hit.
[08:10:54] GriffinHeart: has joined #RubyOnRails
[08:11:32] neanderslob: sevenseacat: would the location then be actionview/lib/action_view/helpers/form_helper.rb?
[08:11:54] coin3d: has joined #RubyOnRails
[08:12:06] sevenseacat: neanderslob: you can click to view any of the methods in that file on GitHub.
[08:12:06] ur5us: has joined #RubyOnRails
[08:12:46] sevenseacat: neanderslob: you can also click that link and then see that entire file on GitHub.
[08:13:29] darutoko: has joined #RubyOnRails
[08:14:25] chagel: has joined #RubyOnRails
[08:15:33] neanderslob: sevenseacat: ok, so I'm gathering that all of rails' core files live in a system directory outside of my app's root directory then?
[08:16:15] sevenseacat: they do, they live inside the gem.
[08:16:25] adre: has joined #RubyOnRails
[08:17:08] charliesome: has joined #RubyOnRails
[08:19:39] neanderslob: sevenseacat: ok, I'm seeing now; so when I add a gem to my Gemfile, it's installed elsewhere in the system and is then that outide location is referenced by my app?
[08:20:05] sevenseacat: then bundler will add the folders in that gem to your ruby load path
[08:20:10] mikecmpbll: neanderslob: bundle show <gem_name> is useful.
[08:21:09] azool: has joined #RubyOnRails
[08:21:11] mikecmpbll: bundle open <gem_name> too.
[08:21:26] neanderslob: mikecmpbll: oh wow, that was illuminating
[08:21:39] leslie1: has joined #RubyOnRails
[08:21:52] hamster88: I have a question related to implementation of paperclip gem .. I have installed that, the medium size is showing up but when it comes to small size on index page its not showing image.
[08:21:56] neanderslob: sevenseacat: ok this makes sense; thanks for the tip
[08:22:15] neanderslob: mikecmpbll: thanks to you as well
[08:24:06] azool: hi, http://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html#autoloading-and-initializers says: Because of that, it is not a good idea to autoload constants on application initialization. Is that really true in such a generic way? Isn't the problem described there one of assigning an autoloaded constant to a new constant? I would like to use an initializer to configure some settings on
[08:24:11] azool: a model. So that would autoload it.
[08:24:58] azool: But from the guides it sounds like that is not a good idea.
[08:26:36] tbuehlmann: sevenseacat, wrote another ten sentences about the topic, but they wouldn't further improve the discussion, just making my argument clearer. so I'll leave it at is
[08:26:54] KamalKaur: has joined #RubyOnRails
[08:27:41] chagel: has joined #RubyOnRails
[08:27:47] SteenJobs: has joined #RubyOnRails
[08:27:48] coin3d: has joined #RubyOnRails
[08:28:02] SteenJobs: sevenseacat: hey!!
[08:28:19] sevenseacat: SteenJobs: evenin'
[08:28:28] SteenJobs: sevenseacat: been too long
[08:28:57] SteenJobs: sevenseacat: and i came with a question, wouldn???t want to disappoint.
[08:30:50] SteenJobs: i have two models built with devise, one for clients and one for users (the peeps on our end), and i want to create a single login page that determines the type of object logging in and then routes them to their respective pages depending on whether they???re a user/client. is this possible (and would cancancan help)? - i know i could consolidate the tables/models but it would involve rewriting a lot of code and i
[08:30:51] SteenJobs: inherited this application
[08:32:40] Bertg: has joined #RubyOnRails
[08:34:34] michael_mbp: has joined #RubyOnRails
[08:35:24] SteenJobs: i have a lead but i don???t fully understand the answer...
[08:35:41] thebatu1: hello I am having a trouble with my blog site. the error is `sanitize_for_mass_assignment' I am using rails 4.2 and I followed strong_params best practices. and I tried the solution on stackoverflow http://stackoverflow.com/questions/17890710/forbiddenattributeserror-error-when-building-from-a-has-many-relationship but the same error any ideas ? https://gist.github.com/thebatu/fd601cb75e5a34b2c481
[08:41:06] mikecmpbll: thebatu1: there appears to be nothing wrong with that
[08:41:27] mikecmpbll: thebatu1: what is this? app/controllers/concerns/trafic_extensions.rb:45
[08:42:04] thebatu1: mikecmpbll: i dont know.
[08:42:12] mikecmpbll: well, that's where the error is occurring
[08:42:15] mikecmpbll: so you should probably find out.
[08:42:51] thebatu1: mikecmpbll: thanks.
[08:49:31] DEA7TH_: has joined #RubyOnRails
[08:52:31] artto: has joined #RubyOnRails
[08:55:31] sandstrom: has joined #RubyOnRails
[08:55:39] jwqu: has joined #RubyOnRails
[08:58:48] mikecmpbll: has joined #RubyOnRails
[09:00:10] Trefex: has joined #RubyOnRails
[09:00:56] simi: has joined #RubyOnRails
[09:01:43] simi: Hello! How to run rake task after rails is initialized? I found some article some time ago, but I can't find it again. It was using config somehow (probably after_initialize or similar).
[09:02:06] Rubie: has joined #RubyOnRails
[09:02:16] simi: I can't spawn another rake process after deploy, so I need to run db:migrate when server is lunched in boot phase.
[09:02:21] simi: launched :)
[09:02:38] rvanlieshout: why would you want to run db:migrate on serve run?
[09:03:37] simi: rvanlieshout, I'm using JRuby and JNDI context to configure ActiveRecord. It is not possible to pass it via command line AFAIK.
[09:03:55] wqubit: has joined #RubyOnRails
[09:04:05] rushed: has joined #RubyOnRails
[09:04:44] IanVorn: has joined #RubyOnRails
[09:05:07] simi: rvanlieshout, if you're interested http://stackoverflow.com/a/11641238/319233
[09:05:17] Ergo: has joined #RubyOnRails
[09:05:18] simi: found 1 minut after question was written
[09:06:31] _lazarevsky: has joined #RubyOnRails
[09:06:35] _lazarevsky: good morning all
[09:06:52] _lazarevsky: can I raise an exception within a transaction?
[09:06:59] mikecmpbll: _lazarevsky: yes
[09:07:13] mikecmpbll: that's kind of the point of transactions :p
[09:07:32] n008f4g_: has joined #RubyOnRails
[09:07:42] _lazarevsky_: has joined #RubyOnRails
[09:07:53] _lazarevsky_: lemme gist my code
[09:09:00] _lazarevsky_: mikecmpbll: https://gist.github.com/anonymous/57fd13200a5d31e1d6f7
[09:09:12] _lazarevsky_: does that seem about right?
[09:09:30] mikecmpbll: how do i know, i don't know what you're trying to do?
[09:09:50] mikecmpbll: oh, but no, it doesn't.
[09:09:59] _lazarevsky_: I'm asking whether this is how an exception can be thrown from within a transaction
[09:09:59] mikecmpbll: i should've read properly, first :p
[09:10:02] _lazarevsky_: the logic is irrelevant
[09:10:26] leslie1: has joined #RubyOnRails
[09:10:46] _lazarevsky_: yea ok rescue instead of raise
[09:11:00] mikecmpbll: and why are you using throw
[09:11:25] _lazarevsky_: mikecmpbll: im not :) this is just psedo-code
[09:11:39] mikecmpbll: i have literally no idea what i'm looking at or for.
[09:11:46] bruno-: has joined #RubyOnRails
[09:12:13] _lazarevsky_: forget about it
[09:12:18] edwinvdgraaf: has joined #RubyOnRails
[09:12:24] _lazarevsky_: I just wanted to knoiw whether I can raise an error from within a transaction block
[09:12:35] mikecmpbll: [10:06:52] <_lazarevsky> can I raise an exception within a transaction?
[09:12:35] mikecmpbll: [10:06:59] <mikecmpbll> _lazarevsky: yes
[09:16:12] leslie2: has joined #RubyOnRails
[09:19:00] workmad3: has joined #RubyOnRails
[09:22:50] lapide_viridi: has joined #RubyOnRails
[09:22:52] darrencauthon: has joined #RubyOnRails
[09:24:48] arBmind: has joined #RubyOnRails
[09:24:51] leslie1: has joined #RubyOnRails
[09:25:24] arup_r: has joined #RubyOnRails
[09:26:13] edwinvdgraaf: has joined #RubyOnRails
[09:26:44] porkqpain: has joined #RubyOnRails
[09:27:37] nonparfumee: has joined #RubyOnRails
[09:31:36] drale2k: has joined #RubyOnRails
[09:33:53] edwinvdg_: has joined #RubyOnRails
[09:36:21] josh: has joined #RubyOnRails
[09:40:59] starfox_sf: has joined #RubyOnRails
[09:41:29] Sylario: has joined #RubyOnRails
[09:42:19] nonparfumee: has joined #RubyOnRails
[09:44:39] lapideviridi: has joined #RubyOnRails
[09:45:29] tomkadwill: has joined #RubyOnRails
[09:45:29] Lapide: has joined #RubyOnRails
[09:49:44] porkqpain: has joined #RubyOnRails
[09:50:27] Trefex: has joined #RubyOnRails
[09:52:06] Detch: has joined #RubyOnRails
[09:54:07] lapide_viridi: has joined #RubyOnRails
[09:55:00] charliesome: has joined #RubyOnRails
[09:56:43] nhhagen: has joined #RubyOnRails
[09:56:46] RegulationD: has joined #RubyOnRails
[09:57:55] arBmind1: has joined #RubyOnRails
[09:58:23] olegtc: has joined #RubyOnRails
[09:58:39] stamina: has joined #RubyOnRails
[10:03:34] nhhagen: has joined #RubyOnRails
[10:04:52] raj___: has joined #RubyOnRails
[10:07:16] darrenca_: has joined #RubyOnRails
[10:07:36] bruno-: has joined #RubyOnRails
[10:08:19] Trefex: has joined #RubyOnRails
[10:12:07] GriffinHeart: has joined #RubyOnRails
[10:13:17] leafac: has joined #RubyOnRails
[10:15:49] toretore: has joined #RubyOnRails
[10:16:25] edwinvdgraaf: has joined #RubyOnRails
[10:16:44] jenrzzz: has joined #RubyOnRails
[10:17:52] Maya_: has joined #RubyOnRails
[10:18:46] centrx: has joined #RubyOnRails
[10:19:09] Sevelia: has joined #RubyOnRails
[10:20:25] rickmasta: has joined #RubyOnRails
[10:24:00] edwinvdg_: has joined #RubyOnRails
[10:24:11] Trefex: has joined #RubyOnRails
[10:24:36] gaustin: has joined #RubyOnRails
[10:27:33] mike___1234: has joined #RubyOnRails
[10:29:59] FernandoBasso: has joined #RubyOnRails
[10:31:21] sandelius: has joined #RubyOnRails
[10:31:39] maxshelley: has joined #RubyOnRails
[10:31:45] ndrei: has joined #RubyOnRails
[10:34:10] chipotles: has joined #RubyOnRails
[10:34:51] FernandoBasso: has joined #RubyOnRails
[10:35:23] nhhagen: has joined #RubyOnRails
[10:36:31] TinkerTyper: has joined #RubyOnRails
[10:38:01] nickjj: has anyone else been getting unfixable issues with doteve and rails 4.2 where the env vars never get picked up?
[10:38:11] nhhagen: has joined #RubyOnRails
[10:40:04] centrx: I've never seen an unfixable issue!
[10:40:12] centrx: They're all fixable!
[10:40:18] centrx: Why are you asking if it's unfixable!
[10:40:39] nickjj: centrx, i added that in for a dramatic effect
[10:40:59] allcentury: has joined #RubyOnRails
[10:41:13] nickjj: seriously though, i tried everything i could possibly think of and went through a bunch of issues along with their proposed fixes, no resolution currently
[10:41:19] centrx: ok I've never used doteve (or dotenv)
[10:41:56] quazimodo: has joined #RubyOnRails
[10:43:45] jfcalvo: has joined #RubyOnRails
[10:43:49] Scripore: has joined #RubyOnRails
[10:47:16] maz-dev: has joined #RubyOnRails
[10:51:53] universa1: nickjj: as always, it's very hard to help you if you're not showing any code? tried it in a newly generated dummy project?
[10:52:04] universa1: nickjj: did you check the github issues for dotenv?
[10:52:22] nickjj: universa1, yeah i've been through all of them related to rails 4.x , mainly https://github.com/bkeepers/dotenv/issues/144
[10:52:48] nickjj: yes, i created a dummy app with a tool i've been using to generate rails projects for over a year , it only started to become an issue with rails 4.2.x
[10:56:38] rushed: nickjj: and if you create it manually instead of with your tool?
[10:57:08] nickjj: rushed, it's the same thing. it's just adding a few gems
[10:57:15] rodfersou: has joined #RubyOnRails
[10:57:19] nickjj: i tried stripping it down to everything but unicorn tho
[10:58:34] nickjj: i'm setting up an identical project with rails 4.1.10 now just to see if it works
[11:00:28] nfk|laptop: has joined #RubyOnRails
[11:00:52] orikremer: has joined #RubyOnRails
[11:02:18] edwinvdgraaf: has joined #RubyOnRails
[11:02:21] nfk: has joined #RubyOnRails
[11:03:57] nickjj: if i revert back to 4.1.4 with an older ver of dotenv it works
[11:03:58] DoubleMalt: has joined #RubyOnRails
[11:05:09] rickmasta: has joined #RubyOnRails
[11:05:40] nhhagen: has joined #RubyOnRails
[11:06:40] sandstrom: has joined #RubyOnRails
[11:07:14] orikremer: has joined #RubyOnRails
[11:11:47] waheedi: has joined #RubyOnRails
[11:12:45] nhhagen: has joined #RubyOnRails
[11:13:37] waheedi: Greetings I???m using mongoid for my mongodb. I have the User model with few dependant destroy directives. When I destroy a user from the rails c production, the process gets killed after 50 seconds almost.
[11:14:18] waheedi: Any idea what would be causing the process to stop, I tried that from the rails web interface and it did kill the process but I thought it was an http timeout request issue
[11:14:34] waheedi: Apparently there is something else timingout but not sure what could it be?
[11:15:05] iooner: has joined #RubyOnRails
[11:19:06] maz-dev_: has joined #RubyOnRails
[11:19:11] randomizer: has joined #RubyOnRails
[11:23:15] tubbo: has joined #RubyOnRails
[11:24:42] meoblast001: has joined #RubyOnRails
[11:29:15] lapide_viridi: has joined #RubyOnRails
[11:29:20] c355E3B: has joined #RubyOnRails
[11:29:44] starfox_sf: has joined #RubyOnRails
[11:32:02] Rubie: has joined #RubyOnRails
[11:32:35] k4nd4lf: has joined #RubyOnRails
[11:35:18] hamster88: has joined #RubyOnRails
[11:35:37] hamster88: I have a question
[11:36:35] hamster88: I am getting the following error on post controller : Mysql2::Error: FUNCTION skyde_development.RANDOM does not exist: SELECT `posts`.* FROM `posts` WHERE (`posts`.`id` != 10) ORDER BY RANDOM() LIMIT 1 .. Though I have already defined that method in post controller..
[11:37:54] doodlehaus: has joined #RubyOnRails
[11:38:14] hamster88: gist > https://gist.github.com/thedesignable/a6bfa05047048fe45afc
[11:38:15] rvanlieshout: hamster88: mysql doesn't have a function called random
[11:38:23] daneo: has joined #RubyOnRails
[11:38:59] hamster88: rvanlieshout, I am trying to use that function in order to randomly get a post when a user is viewing a post ..
[11:39:07] hamster88: what should i use instead?
[11:39:51] rvanlieshout: hamster88: mysql doesn't have a function called random
[11:39:57] rvanlieshout: up + enter in wrong windows
[11:40:04] rvanlieshout: but one that mysql supports
[11:40:18] rvanlieshout: https://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand
[11:40:40] hamster88: rand function right?
[11:41:03] hamster88: lolz cool :D
[11:41:45] hamster88: that worked haha :D
[11:43:12] hamster88: rvanlieshout, is there a gem to share the posts on social media by just adding buttons. ?
[11:43:27] rvanlieshout: that's mostly a client-side thing
[11:43:28] rvanlieshout: no gem required
[11:43:52] rvanlieshout: something like https://www.addthis.com/get/sharing
[11:44:08] rvanlieshout: or any of the other services available for this
[11:44:43] arBmind: has joined #RubyOnRails
[11:45:10] edwinvdg_: has joined #RubyOnRails
[11:45:42] RegulationD: has joined #RubyOnRails
[11:47:35] meoblast001: has joined #RubyOnRails
[11:48:17] RTG`: has joined #RubyOnRails
[11:48:25] daneo: How do I test whether a key has been added to the errors hash ?
[11:48:37] rvanlieshout: foo.errors['bar'].present?
[11:49:03] Scripore: has joined #RubyOnRails
[11:49:34] daneo: Is there a difference with the .added?
[11:50:20] hamster88: alright will give it a shot :D thanks for the help, rvanlieshout :)
[11:50:36] rvanlieshout: daneo: dunno. the docs should explain that actually
[11:51:27] waheedi: ok If anyone saw my question. I believe thats realted to a memory problem nothing more. Increased memory on the machine and the User.destroy works well without interruption
[11:51:38] delianides: has joined #RubyOnRails
[11:55:41] chagel: has joined #RubyOnRails
[11:57:54] gambl0re: has joined #RubyOnRails
[11:58:45] doodlehaus: has joined #RubyOnRails
[11:59:49] wethu: has joined #RubyOnRails
[11:59:59] FernandoBasso: has joined #RubyOnRails
[12:01:31] shyshy: has joined #RubyOnRails
[12:02:12] nvll1: has left #RubyOnRails: ()
[12:02:32] jamiely_: has joined #RubyOnRails
[12:02:38] nvll: has joined #RubyOnRails
[12:03:06] chagel: has joined #RubyOnRails
[12:06:38] jenrzzz: has joined #RubyOnRails
[12:08:16] sankaber: has joined #RubyOnRails
[12:08:59] frank_o: has joined #RubyOnRails
[12:10:33] dhosterman: has left #RubyOnRails: ("WeeChat 1.2")
[12:13:07] griffindy: has joined #RubyOnRails
[12:13:51] DoubleMalt: has joined #RubyOnRails
[12:16:00] seuros: has joined #RubyOnRails
[12:16:42] mostlybadfly: has joined #RubyOnRails
[12:18:26] jkamenik: has joined #RubyOnRails
[12:18:40] Trefex: has joined #RubyOnRails
[12:18:45] acti0nman: has joined #RubyOnRails
[12:18:52] victorkohl: has joined #RubyOnRails
[12:19:00] allcentury: has joined #RubyOnRails
[12:19:53] squiercaster: has joined #RubyOnRails
[12:21:08] nhhagen: has joined #RubyOnRails
[12:23:25] Jaaaay: has joined #RubyOnRails
[12:24:24] tubbo: has joined #RubyOnRails
[12:24:31] Trefex: has joined #RubyOnRails
[12:27:29] jwaldrip_: has joined #RubyOnRails
[12:29:15] krz: has joined #RubyOnRails
[12:29:31] n80: has joined #RubyOnRails
[12:32:02] Scripore: has joined #RubyOnRails
[12:35:31] charliesome: has joined #RubyOnRails
[12:35:33] Valien: has joined #RubyOnRails
[12:36:40] goodcodeguy: has joined #RubyOnRails
[12:39:16] cryptocronus: has joined #RubyOnRails
[12:42:12] syzygy_: has joined #RubyOnRails
[12:43:51] workmad3: has joined #RubyOnRails
[12:44:37] nhhagen: has joined #RubyOnRails
[12:47:27] balr0g: has joined #RubyOnRails
[12:47:48] bmurt: has joined #RubyOnRails
[12:49:41] bruno-: has joined #RubyOnRails
[12:50:45] sarink: has joined #RubyOnRails
[12:51:00] frank_o: Hi! How do I update my `items_loaded` attribute? https://gist.github.com/dt1973/b57d84bf39a75ea47e9b -- undefined method `items_loaded=' for Affiliate:Module
[12:51:10] delianides: has joined #RubyOnRails
[12:52:28] universa1: frank_o: why is it a module?
[12:52:54] universa1: frank_o: and why do you have a table for a module?
[12:53:04] universa1: something is completely off here.
[12:53:16] mary5030: has joined #RubyOnRails
[12:54:21] frank_o: hmm.. well i have different modules for different affiliates. attempted to make my test case as reduced as possible
[12:54:37] universa1: frank_o: well, your example does not work as you've shown it.
[12:54:52] frank_o: one sec please
[12:54:56] universa1: frank_o: and it's obvious that it errors, because you are using a module as a class...
[12:55:20] mary5030: has joined #RubyOnRails
[12:57:33] maxshelley: has joined #RubyOnRails
[12:57:49] Anakat: has joined #RubyOnRails
[12:57:50] seuros: has joined #RubyOnRails
[12:58:07] jstanton: has joined #RubyOnRails
[12:58:26] Scripore: has joined #RubyOnRails
[13:00:00] frank_o: universa1: removed the module: https://gist.github.com/dt1973/b57d84bf39a75ea47e9b sorry about that
[13:00:35] universa1: frank_o: stack trace?
[13:00:37] SeanLazer: has joined #RubyOnRails
[13:00:42] universa1: frank_o: !gist-usage - also
[13:00:42] helpa: frank_o: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[13:00:54] annlewis: has joined #RubyOnRails
[13:01:33] frank_o: yeah i gotta get better at that lol
[13:01:46] universa1: frank_o: and also: def self.whatever defines a class method
[13:02:08] universa1: frank_o: and your class does not have an items_loaded attribute, your instances do...
[13:05:08] fmcgeough: has joined #RubyOnRails
[13:05:10] allcentury: has joined #RubyOnRails
[13:07:59] hutch78: has joined #RubyOnRails
[13:08:06] iamjarvo: has joined #RubyOnRails
[13:10:57] nonparfumee: has joined #RubyOnRails
[13:11:45] arup_r: has joined #RubyOnRails
[13:12:35] nhhagen: has joined #RubyOnRails
[13:13:27] surrealanalysis: has joined #RubyOnRails
[13:14:24] intinig: has joined #RubyOnRails
[13:15:37] krz: has joined #RubyOnRails
[13:16:44] frank_o: thx universa1 ..
[13:18:26] varunwachaspati: has joined #RubyOnRails
[13:18:37] starfox_sf: has joined #RubyOnRails
[13:18:49] nhhagen_: has joined #RubyOnRails
[13:19:14] garrypolley: has joined #RubyOnRails
[13:19:41] arBmind: has joined #RubyOnRails
[13:21:44] leafac: has joined #RubyOnRails
[13:21:55] codeurge: has joined #RubyOnRails
[13:23:39] maz-dev: has joined #RubyOnRails
[13:24:23] JohnBat26: has joined #RubyOnRails
[13:25:00] tomkadwill: has joined #RubyOnRails
[13:25:14] tubbo: has joined #RubyOnRails
[13:25:24] Rubie: has joined #RubyOnRails
[13:26:27] JohnBat26: has joined #RubyOnRails
[13:26:34] LBRapid: has joined #RubyOnRails
[13:27:58] IanVorn: has joined #RubyOnRails
[13:28:32] RegulationD: has joined #RubyOnRails
[13:28:53] drale2k: has joined #RubyOnRails
[13:29:15] Papierkorb: has joined #RubyOnRails
[13:29:48] orikremer: has joined #RubyOnRails
[13:30:11] aaronds: has joined #RubyOnRails
[13:30:44] granthatcher: has joined #RubyOnRails
[13:32:19] iamjarvo: has joined #RubyOnRails
[13:33:43] doodlehaus: has joined #RubyOnRails
[13:33:58] ekain: has joined #RubyOnRails
[13:34:26] platzhirsch: has joined #RubyOnRails
[13:35:00] rocknrollMarc: has joined #RubyOnRails
[13:35:04] codepete: has joined #RubyOnRails
[13:35:49] Scripore: has joined #RubyOnRails
[13:39:22] sandstrom: has joined #RubyOnRails
[13:39:24] Trefex: has joined #RubyOnRails
[13:40:01] sarink: has joined #RubyOnRails
[13:40:05] jwaldrip_: has joined #RubyOnRails
[13:42:26] watchtheblur: has joined #RubyOnRails
[13:43:28] leafac: has joined #RubyOnRails
[13:47:45] DigitallyBorn: has joined #RubyOnRails
[13:49:42] foucist: has joined #RubyOnRails
[13:49:47] foucist: there a way to structure dump the test db ?
[13:52:14] sherlock_: has joined #RubyOnRails
[13:53:04] tjbiddle: has joined #RubyOnRails
[13:53:49] nhhagen: has joined #RubyOnRails
[13:54:15] sherlock41: has joined #RubyOnRails
[13:54:19] foucist: hm, i guess structure dump is equivalent to mysqldump
[13:54:29] livathinos: has joined #RubyOnRails
[13:55:00] mary5030: has joined #RubyOnRails
[13:55:25] foucist: well, not quite
[13:56:15] jenrzzz: has joined #RubyOnRails
[13:57:42] Anakat_: has joined #RubyOnRails
[13:58:27] ereslibre: has joined #RubyOnRails
[13:58:27] ereslibre: has joined #RubyOnRails
[13:59:21] drale2k: has joined #RubyOnRails
[14:00:13] i: has joined #RubyOnRails
[14:00:31] asuka: has left #RubyOnRails: ()
[14:02:56] bobbobbins: has joined #RubyOnRails
[14:03:36] varunwachaspati: has joined #RubyOnRails
[14:04:48] charliesome: has joined #RubyOnRails
[14:05:13] ferr: has joined #RubyOnRails
[14:06:57] darrencauthon: has joined #RubyOnRails
[14:08:00] byprdct: has joined #RubyOnRails
[14:08:03] ferr: Hey, I remember once used the gem which scanned whole rails app to check the match of style guide, does anyone know the name of it?
[14:08:15] n80: has joined #RubyOnRails
[14:08:25] nonparfumee: has joined #RubyOnRails
[14:08:49] asheinfeld: has joined #RubyOnRails
[14:09:04] sherlock41: Hellp people!
[14:09:29] sherlock41: Thats a Hello + Help :\
[14:10:01] foucist: ferr: there's several.. rubocop, cane, etc
[14:10:35] ferr: foucist: thanks, it's rubocop!
[14:10:49] jniziol: has joined #RubyOnRails
[14:11:39] griffindy: has joined #RubyOnRails
[14:12:09] nhhagen: has joined #RubyOnRails
[14:12:22] bratsche: has joined #RubyOnRails
[14:12:26] annlewis: has joined #RubyOnRails
[14:12:49] mrbubbles_: has joined #RubyOnRails
[14:13:04] centrx: sherlock41, Ask and you shall receive
[14:13:26] iamjarvo: has joined #RubyOnRails
[14:13:50] nickfausnight: has joined #RubyOnRails
[14:14:01] lapide_viridi: has joined #RubyOnRails
[14:17:33] varunwachaspati: has joined #RubyOnRails
[14:17:54] ohcibi: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[14:18:17] asheinfeld: has joined #RubyOnRails
[14:18:38] asheinfeld: has joined #RubyOnRails
[14:18:40] nhhagen_: has joined #RubyOnRails
[14:19:51] zorak8: has joined #RubyOnRails
[14:20:28] nonparfumee: has joined #RubyOnRails
[14:21:31] sherlock41: has joined #RubyOnRails
[14:22:06] kies: has joined #RubyOnRails
[14:23:06] asheinfeld: has joined #RubyOnRails
[14:24:57] foucist: how do you guys typically handle emojis in your rails apps these days?
[14:25:04] foucist: i ended up making some fields VARBINARY
[14:25:09] foucist: seems to work fine
[14:25:24] foucist: converted from varchar
[14:25:56] centrx: This sounds like a really advanced use case
[14:26:15] foucist: centrx: lies
[14:28:09] Scripore: has joined #RubyOnRails
[14:29:37] Papierkorb: has joined #RubyOnRails
[14:30:48] rsl: has joined #RubyOnRails
[14:31:10] spyderman4g63: has joined #RubyOnRails
[14:31:19] rickmasta: has joined #RubyOnRails
[14:31:33] joaomdmoura: has joined #RubyOnRails
[14:31:35] srinidhi: has joined #RubyOnRails
[14:33:05] Scripore: has joined #RubyOnRails
[14:34:52] tubbo: has joined #RubyOnRails
[14:35:01] chridal: I am using Pundit for authorization. I do however have a lot of methods that are shared between my policyclasses. I would like to include these in a module, but I am not sure how to properly do it.
[14:35:14] earthquake: has joined #RubyOnRails
[14:35:22] chridal: Which folder in the rails app should it reside in, and how should I require it etc.?
[14:36:04] bricker: has joined #RubyOnRails
[14:37:07] shinnya: has joined #RubyOnRails
[14:37:16] seuros: has joined #RubyOnRails
[14:37:17] asheinfeld: has joined #RubyOnRails
[14:38:01] cornerma1: has joined #RubyOnRails
[14:38:08] mat_: has joined #RubyOnRails
[14:38:31] sshuff: has joined #RubyOnRails
[14:39:09] asheinfeld: has joined #RubyOnRails
[14:39:33] mat_: hello here
[14:39:44] mat_: I'm upgrading an app from 3.2 to 4.0 (on my way to 4.2) and, I'm a bit baffled with an error I'm getting:
[14:39:58] mat_: No route matches {"action"=>"index", "controller"=>"remises", "dated"=>"1998-01-01", "datef"=>"1998-12-31"} missing required keys: [:action, :controller, :dated, :datef]
[14:40:15] annlewis: has joined #RubyOnRails
[14:40:53] iamjarvo: has joined #RubyOnRails
[14:41:15] mordocai: has joined #RubyOnRails
[14:41:26] mase-chatter: has joined #RubyOnRails
[14:42:48] chridal: mat_: I am not 100% sure, but could the issue be that the keys are strings instead of symbols?
[14:43:08] givanse: has joined #RubyOnRails
[14:43:15] mat_: chridal, I'm giving it symbols, they must be converted at one point into strings :-)
[14:43:20] tubbo: mat_: !code
[14:43:20] helpa: mat_: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:46:14] kinduff: has joined #RubyOnRails
[14:46:38] mat_: has left #RubyOnRails: ("Quitte")
[14:48:29] asheinfeld: has joined #RubyOnRails
[14:48:30] Scripore: has joined #RubyOnRails
[14:49:56] mase-chatter: has joined #RubyOnRails
[14:51:27] XThief: has joined #RubyOnRails
[14:51:54] tubbo: has joined #RubyOnRails
[14:52:44] ogpastaling: has joined #RubyOnRails
[14:53:16] Sylario: I want to set up repos to be able to propose push to the main project, but i am not sure how to do it
[14:54:27] _seanc_: has joined #RubyOnRails
[14:54:39] Sylario: I think i need a project copy repo where i'll code my change, then pull on my working version of the project to test, never push from my working version of the poject and submit from the project copy
[14:54:51] Sylario: With backup i will end up with at least 4 repo?
[14:56:40] creature_: has joined #RubyOnRails
[14:57:24] hardtail: has joined #RubyOnRails
[15:00:40] disgrntld: has joined #RubyOnRails
[15:00:46] sonofdirt: has joined #RubyOnRails
[15:01:10] nonparfumee: has joined #RubyOnRails
[15:02:41] qejk: has joined #RubyOnRails
[15:04:25] ebbflowgo: has joined #RubyOnRails
[15:06:35] asheinfeld: has joined #RubyOnRails
[15:07:09] Sylario: How do you call a git repo with only the "DB/data folders" in opposition to a repo where you also have the file redy to be edited?
[15:07:18] starfox_sf: has joined #RubyOnRails
[15:10:22] ebbflowgo: how can I merge an ActiveRecord_Relation with an ActiveRecord_AssociationRelation...
[15:11:11] centrx: ebbflowgo, They will turn into arrays, which can be appended with +
[15:11:17] centrx: s/appended/concatenated
[15:11:38] mikecmpbll: ebbflowgo: !code also
[15:11:38] helpa: ebbflowgo: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[15:11:44] ebbflowgo: centrx: yeah
[15:11:49] mikecmpbll: it's not clear what you're doing
[15:11:58] ebbflowgo: i want to merge a relation with an association..
[15:12:07] tubbo: Sylario: not sure i'm understanding your problem very well.
[15:12:08] centrx: "merge" ?
[15:12:19] mikecmpbll: ebbflowgo: code code code code
[15:12:24] tubbo: Sylario: are you using git as a data-store for your app or something?
[15:12:30] ebbflowgo: centrx: the array works, it just doesn't work well with joins after
[15:12:47] ebbflowgo: because it's no longer an association
[15:15:30] jgpawletko: has joined #RubyOnRails
[15:15:34] Sylario: tubbo: i will need more feature from a Rails app (not a gem) and i can try to sybliut them
[15:15:38] sandstrom: has joined #RubyOnRails
[15:15:50] Sylario: tubbo: but i do not want to submit my css and logs and DB passwords
[15:16:03] DrBojingle: has joined #RubyOnRails
[15:16:08] gambl0re: has joined #RubyOnRails
[15:16:52] pixelhandler: has joined #RubyOnRails
[15:16:59] tubbo: Sylario: what does "sybliut" mean? :P
[15:17:13] Sylario: sorry, submit
[15:17:27] mikecmpbll: most of the letters are there
[15:17:58] tubbo: Sylario: ok i still have zero idea what your problem is
[15:18:11] tubbo: Sylario: please tell me exactly what you want and be as non-vague as possible
[15:18:27] mikecmpbll: git submodules, perhaps? :/
[15:18:28] Sylario: to start, ho do you call the git repo where there is no code
[15:18:35] weckl: has joined #RubyOnRails
[15:18:36] Sylario: and how do you call the ones where there is code
[15:19:11] Sylario: before trying to solve my problem i'll try to have some vocabulary
[15:19:19] mikecmpbll: empty, and not empty ..
[15:19:38] tubbo: they're both still git repos :) but yeah, there could be an empty repo and a non-empty repo...
[15:19:50] Sylario: the ones that are called something.git
[15:20:13] Sylario: it is not empty, it has the code, but in the db-format of git
[15:20:16] Sylario: you cannot edit it
[15:20:18] tubbo: Sylario: oh a "bare" repo?
[15:20:31] Sylario: does bare mean 0 file?
[15:20:39] Scripore: has joined #RubyOnRails
[15:20:45] mikecmpbll: i always wondered why that flag was called --bare tbh.
[15:20:58] tubbo: Sylario: https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server
[15:21:22] tubbo: first of all, #git has a lot more deep knowledge than i do about this
[15:21:33] tubbo: but essentially, a bare repo is just the .git directory in your own working copy
[15:21:47] tubbo: without any version checked out anywhere
[15:21:57] Sylario: ok for me bare is only a word for riding a horse without... the thing
[15:22:12] tubbo: so when you git clone https://github.com/doge.js/verywow.js.git, you're talking to the bare repo
[15:22:13] Sylario: in leather
[15:22:45] livathinos: has joined #RubyOnRails
[15:22:51] tubbo: means...other things in America.
[15:22:53] mikecmpbll: probably don't google that, though.
[15:22:57] Sylario: ok so bare repo mean "without the file you can edit"
[15:23:22] tubbo: right, it's just the .git/ folder
[15:23:35] Sylario: i have a few of thoses
[15:23:46] Cache_Money: has joined #RubyOnRails
[15:25:12] TinkerTyper: has joined #RubyOnRails
[15:28:56] asheinfeld: has joined #RubyOnRails
[15:29:59] weckl: Have anyone tried to integrate ActiveAdmin inside of an engine? I'm having trouble getting the routes right.
[15:30:46] krz: has joined #RubyOnRails
[15:32:53] Trefex: has joined #RubyOnRails
[15:33:49] XThief: has joined #RubyOnRails
[15:34:37] leofrozenyogurt: has joined #RubyOnRails
[15:34:50] rocknrol_: has joined #RubyOnRails
[15:35:19] slash_nick: weckl: elaborate on 'trouble'
[15:35:26] asheinfeld: has joined #RubyOnRails
[15:35:57] spyderman4g63: has joined #RubyOnRails
[15:35:59] rocknrollMarc: has joined #RubyOnRails
[15:36:06] skroon: has joined #RubyOnRails
[15:36:42] thebatu1: has joined #RubyOnRails
[15:37:43] leofrozenyogurt: hey all so i have a quick build question, I have ingredients that belong to many products and product have many ingredients, so Product has_many ingredients but I dont get how to properly do Ingredient belongs_to_many :products
[15:38:07] maxshelley: has joined #RubyOnRails
[15:38:25] cnk: has joined #RubyOnRails
[15:38:43] rocknrol_: has joined #RubyOnRails
[15:38:47] weckl: I got it, thanks anyway!
[15:39:33] mikecmpbll: leofrozenyogurt: that relationship is called has_and_belongs_to_many
[15:39:36] mikecmpbll: on both sides.
[15:39:58] mikecmpbll: and requires an ingredients_products join table
[15:40:21] mase-chatter: has joined #RubyOnRails
[15:40:32] ivan__: has joined #RubyOnRails
[15:41:09] leofrozenyogurt: so would product has_and_belongs_to_many as well
[15:41:12] leofrozenyogurt: or just for ingredeints
[15:41:55] x1337807x: has joined #RubyOnRails
[15:42:19] kinduff: has joined #RubyOnRails
[15:43:53] rocknrol_: has joined #RubyOnRails
[15:44:09] leofrozenyogurt: ok so i have this
[15:44:10] leofrozenyogurt: create_table :product_ingredients, id: false do |t| t.integer :product_id t.integer :ingredient_id
[15:44:33] leofrozenyogurt: so can i just say @ingredient = Ingredeint.first
[15:44:42] mikecmpbll: it should be "products_ingredients"
[15:44:42] leofrozenyogurt: @product=Product.first
[15:44:52] mikecmpbll: plural on products
[15:44:56] leofrozenyogurt: @product.ingredients << @product
[15:45:21] ramfjord: has joined #RubyOnRails
[15:45:30] mikecmpbll: @product.ingredients << @ingredient; # yes.
[15:45:46] mikecmpbll: after you've fixed your join table name
[15:45:50] leofrozenyogurt: thats what i was missing
[15:45:54] mikecmpbll: probably add an index to it, too.
[15:46:51] tubbo: has joined #RubyOnRails
[15:47:33] leofrozenyogurt: add_index :products, :ingredients
[15:48:49] moretti: has joined #RubyOnRails
[15:49:31] mikecmpbll: add_index :product_id, :ingredients_products; add_index :ingredient_id, :ingredients_products
[15:49:41] mikecmpbll: probably, it depends but that's the default iirc
[15:49:44] givanse: has joined #RubyOnRails
[15:49:54] mikecmpbll: leofrozenyogurt: !migrations - see create_join_table, too.
[15:49:54] helpa: leofrozenyogurt: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[15:51:20] aaronds: has joined #RubyOnRails
[15:51:42] snockerton: has joined #RubyOnRails
[15:51:48] fgo: has joined #RubyOnRails
[15:51:52] nonparfumee: has joined #RubyOnRails
[15:53:00] leofrozenyogurt: mikecmpbll: awesome thanks!
[15:53:00] leofrozenyogurt: create_join_table :products, :ingredients do |t| t.index :product_id t.index :ingredients_id end
[15:53:08] leofrozenyogurt: this is the result from the guide
[15:53:09] mikecmpbll: looks good to me.
[15:53:18] leofrozenyogurt: sweet thanks so much!
[15:53:28] chintanparikh: has joined #RubyOnRails
[15:53:32] Scriptonaut_: has left #RubyOnRails: ()
[15:53:33] tomkadwill: has joined #RubyOnRails
[15:53:41] baweaver: has joined #RubyOnRails
[15:53:43] Scriptonaut: has joined #RubyOnRails
[15:53:47] Scriptonaut: Does anyone know how one could be getting a gem dependency error despite using bundle exec?
[15:54:01] mikecmpbll: not without knowing what that error is.
[15:54:07] Scriptonaut: I did a gem cleanup, and still getting a dependency error for FaradayMiddleware
[15:54:14] Scriptonaut: alright I'll post
[15:54:36] Scriptonaut: https://gist.github.com/robins35/a3975f77a8407b3e0cf0
[15:54:49] Scriptonaut: I'm using the desk gem, which requires faraday_middleware
[15:54:49] batasrki: has joined #RubyOnRails
[15:54:59] arBmind1: has joined #RubyOnRails
[15:55:51] Scriptonaut: https://github.com/chriswarren/desk/blob/master/desk.gemspec
[15:55:53] Scriptonaut: that's the gemspec
[15:56:06] pjammer: has joined #RubyOnRails
[15:56:07] momomomomo: has joined #RubyOnRails
[15:56:18] Scriptonaut: and here is the output of gem list: https://gist.github.com/robins35/3af72de0da0be69451b6
[15:57:10] rocknrollMarc: has joined #RubyOnRails
[15:57:16] Scriptonaut: a gem cleanup will not remove the multiple versions of faraday, I suspect this is the culprit
[15:57:40] nonparfumee: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[15:58:23] mase-chatter: has joined #RubyOnRails
[15:59:27] benhuda: has joined #RubyOnRails
[15:59:52] mikecmpbll: Scriptonaut: that's a faraday error by the way
[16:00:15] Lightsword: has joined #RubyOnRails
[16:00:20] ndrei: has joined #RubyOnRails
[16:00:58] mikecmpbll: i don't really know anything about faraday or why it's raising that
[16:01:15] philcrissman: has joined #RubyOnRails
[16:02:27] rocknrol_: has joined #RubyOnRails
[16:02:47] mikecmpbll: Scriptonaut: what is Deashify
[16:03:05] towski_: has joined #RubyOnRails
[16:05:44] mikecmpbll: Scriptonaut: also the 2nd part of that error is probably where you want to be focusing your attention. when it's loading it's dependencies it's erroring with "undefined method `type' for class `Hashie::Mash'"
[16:05:56] mikecmpbll: but you don't get the stack for that because the Faraday dependency error catches it
[16:06:19] mikecmpbll: if it were me i'd probably just comment that line out in faraday so i get the real exception
[16:06:58] jstanton: hey, rails when moving it to production mode. It expects to be able to create all the tables in the DB?
[16:07:34] hahuang65: has joined #RubyOnRails
[16:07:51] Lightsword: has joined #RubyOnRails
[16:08:54] watchtheblurr: has joined #RubyOnRails
[16:09:22] Scripore: has joined #RubyOnRails
[16:09:37] Anakat: has joined #RubyOnRails
[16:09:57] rushed: jstanton: if you run the migrations, it expects to be able to do whatever the migrations do (which may or may not include creating tables), alternately if you do a schema load then yes
[16:10:02] mikecmpbll: Scriptonaut: you're not alone, also: https://github.com/chriswarren/desk/issues/60
[16:10:05] mikecmpbll: unless that's you :'d
[16:10:16] synfinatic: has joined #RubyOnRails
[16:10:23] _seanc_: has joined #RubyOnRails
[16:10:27] Spami: has joined #RubyOnRails
[16:10:44] momomomomo: has joined #RubyOnRails
[16:10:53] zendrix: has joined #RubyOnRails
[16:11:26] mikecmpbll: Scriptonaut: probably add hashie to your gemfile also, and lock it to an older version before this commit https://github.com/intridea/hashie/commit/61fc9a9cbce3999df515f4f291135b51372789c4
[16:11:55] jstanton: rushed, so pretty much it needs to use a owner schema account for everything?
[16:12:51] rushed: jstanton: you can organize your db however you like
[16:14:53] cnk: jstanton: The default is an owner account but if you don't want that, you either need to not use migrations - or have a different database user that you can use to run any needed migrations
[16:15:19] creature: has joined #RubyOnRails
[16:20:01] jstanton: cnk, do you know of any articles that go over using 2 accounts?
[16:20:51] pepelui: has joined #RubyOnRails
[16:20:57] cnk: No. I was assuming based on your question that you had some DBAs who didn't want your web db user to have the privileges that Rails assumes
[16:21:16] jstanton: cnk, yes.. he is having a stroke
[16:21:39] cnk: What I was assuming was that then he will have to do the database set up for any release taht needs to run a migration
[16:21:48] fragamus: has joined #RubyOnRails
[16:21:52] hardlin3r: has joined #RubyOnRails
[16:22:26] Trefex: has joined #RubyOnRails
[16:22:53] cnk: Is your app already built using ActiveRecord migrations?
[16:23:08] jstanton: cnk, no, we are still trying to get started lol
[16:23:12] rocknrollMarc: has joined #RubyOnRails
[16:23:35] jstanton: cnk, we are using oracle and I was thinking just about using legacy support
[16:23:59] jstanton: cnk, I would just define everything and not bother with migrations.
[16:24:14] rocknrollMarc: has joined #RubyOnRails
[16:24:25] spyderman4g63: has joined #RubyOnRails
[16:24:59] k4nd4lf: has joined #RubyOnRails
[16:25:02] cnk: That is one approach. The other option is to go ahead and use migrations - but to have a second 'environment' that has credentials with table manipulation rights
[16:25:26] cnk: then in production you can do RAILS_ENV=dba rake db:migrate
[16:25:50] __butch__: has joined #RubyOnRails
[16:25:55] cnk: but your normal production credentials are for a user without those privs
[16:26:13] bricker: has joined #RubyOnRails
[16:26:36] jstanton: oh, so i would just drop another section into config/database.yml?
[16:26:47] Guest1526: has joined #RubyOnRails
[16:26:55] __butch__1: has joined #RubyOnRails
[16:26:55] cnk: you can have as many sections in that file as you want
[16:27:03] cnk: and they can be used however you want
[16:27:11] jstanton: interesting.
[16:28:43] ndrei: has joined #RubyOnRails
[16:29:31] __butch__: has joined #RubyOnRails
[16:29:50] maZtah: who here is following sandi metz' ruby guidelines while developing rails applications?
[16:30:03] maZtah: i'm wondering how to solve things in a controller like this: @websites = current_user.websites.all
[16:30:10] maZtah: afaik something like that is not even allowed
[16:30:12] cnk: jstanton: for your dev and test envs, I would suggest those users have table manipulation privileges
[16:30:13] porkqpain: has joined #RubyOnRails
[16:30:16] sarink: has joined #RubyOnRails
[16:30:30] jstanton: ok, I am testing that now
[16:30:31] hahuang65: has joined #RubyOnRails
[16:30:40] k4nd4lf: has joined #RubyOnRails
[16:30:43] rocknrollMarc: has joined #RubyOnRails
[16:30:46] rushed: maZtah: current_user.websites no need for the all
[16:31:30] iamjarvo: has joined #RubyOnRails
[16:31:34] rushed: maZtah: "and thirdly, the code is more what you'd call "guidelines" than actual rules."
[16:31:35] srinidhi: has joined #RubyOnRails
[16:32:26] aaronds: has joined #RubyOnRails
[16:32:29] starfox_sf: has joined #RubyOnRails
[16:33:01] __butch__: has joined #RubyOnRails
[16:33:52] Lightsword: has joined #RubyOnRails
[16:34:45] jstanton: cnk, I created a section named dba and i did a rake db:migrate RAILS_ENV=dba
[16:34:52] aaronds: Hey. Newbie to rails here, encountered a problem when attempting to unit test my model. I'm seeing the error ActiveRecord::StatementInvalid: Mysql2::Error: Field 'title' doesn't have a default value: INSERT INTO `users` (`created_at`, `id`) VALUES (2015, 980190962). I don't see why a query of this nature is being executed. The model works great from the rails console. Unit test source: http://pastebin.com/6Y1sTxAX
[16:35:26] jstanton: cnk, but I start the web app and goto a page and i get Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development
[16:35:30] Fire-Dragon-DoL: has joined #RubyOnRails
[16:35:48] Emily: has joined #RubyOnRails
[16:36:25] Rubie: has joined #RubyOnRails
[16:36:40] FooBarWidget: has joined #RubyOnRails
[16:36:41] cnk: jstanton: was this before or after you ran the migraations as dba?
[16:36:52] cnk: and dba is writing to your dev db right?
[16:37:22] cnk: I would log in as the development user and check the schema
[16:37:38] blunckr: has joined #RubyOnRails
[16:37:45] cnk: do you have the tables you expect? and does the migrations table have the info about the migration being run
[16:37:48] chintanparikh: has joined #RubyOnRails
[16:38:09] k4nd4lf: has joined #RubyOnRails
[16:38:10] SeanLazer: has joined #RubyOnRails
[16:38:29] cnk: I might also bounce the dev web server to refresh the db connections
[16:38:35] rocknrollMarc: has joined #RubyOnRails
[16:38:35] ndrei: has joined #RubyOnRails
[16:39:12] x1337807x: has joined #RubyOnRails
[16:39:14] rhizome: what does "refresh the db connections" mean?
[16:39:35] cnk: disconnect and reconnect
[16:39:36] gambl0re: has joined #RubyOnRails
[16:39:48] rocknrollMarc: has joined #RubyOnRails
[16:40:09] rhizome: because migration just hooks into some existing connection?
[16:40:10] cnk: Oracle tries hard to give you consistent reads and I wonder if the app was picking up the changes made by the migraiton
[16:40:17] chintanparikh3: has joined #RubyOnRails
[16:40:25] cnk: rhizome: I don't think so - but I don't know
[16:40:29] rocknrollMarc: has joined #RubyOnRails
[16:40:54] cnk: something isn't as we expected or jstanton wouldn't have gotten that error message
[16:41:12] iamjarvo: has joined #RubyOnRails
[16:41:26] jstanton: bounce and slightly better
[16:41:53] iamjarvo: has joined #RubyOnRails
[16:41:58] tomkadwill: has joined #RubyOnRails
[16:42:30] rocknrol_: has joined #RubyOnRails
[16:42:43] watchtheblurr: has joined #RubyOnRails
[16:43:13] syzygy_: has joined #RubyOnRails
[16:43:30] momomomomo: has joined #RubyOnRails
[16:44:45] asheinfeld: has joined #RubyOnRails
[16:47:04] synfinatic: has joined #RubyOnRails
[16:47:17] jenrzzz: has joined #RubyOnRails
[16:47:40] surrealanalysis: has joined #RubyOnRails
[16:47:56] IFrank00: has joined #RubyOnRails
[16:48:21] Oog: has joined #RubyOnRails
[16:49:11] Oog: model Order has_many :zip_codes, :through :city end - in model zip_code how do I do has_many :orders ?
[16:49:26] paulcsmith: has joined #RubyOnRails
[16:49:32] IFrank00: how can i change the routes on show projects/:id to /:id and hide the projects word
[16:49:33] rocknrollMarc: has joined #RubyOnRails
[16:50:28] IFrank00: example Name of the project: a so I get sitename/a on the show action
[16:51:14] zorak8: has joined #RubyOnRails
[16:51:31] Scriptonaut: mikecmbll: thanks
[16:51:39] Scriptonaut: sorry was in a meeting
[16:52:00] Scriptonaut: oh wow, I didn't see this issue
[16:52:06] maxshelley: has joined #RubyOnRails
[16:53:10] blunckr: has left #RubyOnRails: ()
[16:53:16] blunckr: has joined #RubyOnRails
[16:54:00] momomomomo_: has joined #RubyOnRails
[16:54:09] djbkd: has joined #RubyOnRails
[16:55:13] x1337807x: has joined #RubyOnRails
[16:55:23] AzaToth: has joined #RubyOnRails
[16:55:58] x1337807x: has joined #RubyOnRails
[16:56:37] hutch78: has joined #RubyOnRails
[16:56:54] cnk: IFrank00: Look into friendly_id gem
[16:56:56] x1337807x: has joined #RubyOnRails
[16:57:23] IFrank00: cnk I go the friendly_id with the slug
[16:57:46] queequeg1: has joined #RubyOnRails
[16:57:49] x1337807x: has joined #RubyOnRails
[16:58:04] coin3d: has joined #RubyOnRails
[16:58:12] asheinfeld: has joined #RubyOnRails
[16:58:29] IFrank00: I dont want this projects/:slug I like to have /:slug I need to add a route but dont know the syntax for it
[16:59:45] umgrosscol: has joined #RubyOnRails
[16:59:49] cnk: to have /:slug match you need to make it your default route - bottom of yoru routes file
[16:59:59] azool: has left #RubyOnRails: ()
[17:00:24] cnk: for example: # This fall-through route will see if the pages controller can find content for this url
[17:00:24] cnk: get '(*path)', controller: "pages", action: "show", as: 'show_page'
[17:00:59] cnk: in your case, you don't need *path since you have single slug
[17:01:22] kinduff_: has joined #RubyOnRails
[17:01:29] chintanparikh: has joined #RubyOnRails
[17:01:31] cnk: In my fall through I needed to match all kinds of /foo/bar/baz to get a psueudo directory structure for my CMS
[17:02:37] jkamenik1: has joined #RubyOnRails
[17:05:41] cmisenas: has joined #RubyOnRails
[17:06:00] XThief: has joined #RubyOnRails
[17:07:04] vickleton: has joined #RubyOnRails
[17:08:10] n80: has joined #RubyOnRails
[17:08:22] surrealanalysis: has joined #RubyOnRails
[17:08:40] asheinfeld: has joined #RubyOnRails
[17:11:28] ghr: has joined #RubyOnRails
[17:11:49] artto: has joined #RubyOnRails
[17:12:45] paulcsmith: has joined #RubyOnRails
[17:13:39] Anakat: has joined #RubyOnRails
[17:15:50] maz-dev: has joined #RubyOnRails
[17:16:27] asheinfeld: has joined #RubyOnRails
[17:16:42] SteenJobs: has joined #RubyOnRails
[17:17:37] hardtail: has joined #RubyOnRails
[17:18:29] sarink: has joined #RubyOnRails
[17:18:31] __butch__: has joined #RubyOnRails
[17:18:39] asheinfe_: has joined #RubyOnRails
[17:18:56] hardtail: has joined #RubyOnRails
[17:19:42] ramfjord: has joined #RubyOnRails
[17:23:08] __butch__: has joined #RubyOnRails
[17:23:09] Trefex: has joined #RubyOnRails
[17:23:34] asheinfeld: has joined #RubyOnRails
[17:25:28] thebatu1: has joined #RubyOnRails
[17:25:42] __butch__: has joined #RubyOnRails
[17:27:12] djbkd: has joined #RubyOnRails
[17:31:10] mikecmpbll: has joined #RubyOnRails
[17:32:11] edgarjs: has joined #RubyOnRails
[17:33:55] _djbkd: has joined #RubyOnRails
[17:34:54] Pounce_: has joined #RubyOnRails
[17:35:44] sarink: has joined #RubyOnRails
[17:40:31] spyderman4g63: has joined #RubyOnRails
[17:40:38] x1337807x: has joined #RubyOnRails
[17:40:51] joaomdmoura: has joined #RubyOnRails
[17:41:25] allcentury: someone rubber duck me... I'm deploying via capistrano, I'm setting my logger in an initializer. When I deploy, the logger I defined is not there and instead it's the default logger. I cannot reproduce this locally -- any ideas where else I can look?
[17:41:31] x1337807x: has joined #RubyOnRails
[17:41:48] DEA7TH: has joined #RubyOnRails
[17:43:08] k4nd4lf: has joined #RubyOnRails
[17:43:09] slava_: has joined #RubyOnRails
[17:43:11] slava_: https://gist.github.com/slavajacobson/6c61d15f272c106ea8eb
[17:43:22] slava_: "NameError: undefined local variable or method `milestone' for #<Class:0x000000056b0a30>"
[17:43:37] slava_: I tried self.milestone['name']
[17:44:34] k4nd4lf: has joined #RubyOnRails
[17:44:56] leafac1: has joined #RubyOnRails
[17:46:00] tubbo: slava_: what's milestone?
[17:46:10] tubbo: slava_: there's no Task.milestone, so that won't work
[17:46:21] tubbo: there's a @task.milestone (where @task is an instance of Task)
[17:46:34] slava_: yes.. would @task.milestone work?
[17:46:52] tubbo: slava_: no, because you don't have an instance of Task to work with on the class level.
[17:46:58] hnanon: I've been struggling with this for two days...
[17:47:00] ciree: milestone.name
[17:47:00] hnanon: https://gist.github.com/anonymous/1922f771739a04ec29ed
[17:47:02] tubbo: slava_: that code makes no sense.
[17:47:19] hnanon: I get the error: undefined local variable or method `current_user' for #<Class:0x00...
[17:47:22] tubbo: slava_: because a milestone is part of a Task, how do you have a milestone with no Task yet? :)
[17:47:24] leafac: has joined #RubyOnRails
[17:47:32] ciree: hnanon: does current user exist?
[17:47:43] k4nd4lf: has joined #RubyOnRails
[17:47:45] hnanon: There's a problem in my "unpaid" method.
[17:47:51] tubbo: slava_: in normal scopes you can pass in an argument to the block and be able to take arguments, but you can't do that here in default_scope
[17:47:54] hnanon: ciree: Yes.
[17:48:01] slava_: ok so basically task belongs to milestone. I want to return all tasks that do not have the same name as the milestone that it belongs to.
[17:48:08] mahamadpiazza: has joined #RubyOnRails
[17:48:12] ciree: hnanon: your defining unpaid as a class method
[17:48:20] hnanon: I get current_user's records in the reconciliation method.
[17:48:27] hnanon: But not for unpaid method.
[17:48:39] ciree: according to that
[17:48:41] ciree: you'd need to do
[17:48:49] ciree: Model.unpaid
[17:48:54] jenrzzz: has joined #RubyOnRails
[17:48:56] k4nd4lf_: has joined #RubyOnRails
[17:48:59] hnanon: ciree: Yes. It was a scope yesterday but Radar suggested I use a class method.
[17:49:00] tubbo: slava_: is `milestone` also a Task?
[17:49:16] ciree: hnanon: remove it from self.reconciliation
[17:49:19] hnanon: ciree: hmmm, let me see.
[17:49:23] tubbo: slava_: this kinda looks like a nested set to me
[17:49:28] slava_: tubbo it's part of the same table "acx_project_objects"
[17:49:42] tubbo: slava_: are you migrating from a legacy DB?
[17:49:55] hnanon: ciree: What do you mean remove it from there?
[17:50:01] hnanon: Don't nest it under it?
[17:50:18] ciree: move it outside the self.reconciliation method
[17:50:39] ciree: then pass the variables to it
[17:50:48] ciree: self.unpaid(start_date, end_date, current_user)
[17:50:52] ciree: def start_date, end_date, current_user
[17:51:01] ciree: def self.unpaid(start_date, end_date, current_user)
[17:51:18] slava_: tubbo, kinda yeah, i am mapping to an existing database
[17:51:57] tubbo: slava_: hmm, ok but does milestone refer to a Task?
[17:52:16] tubbo: like would Task.first.milestone.is_a?(Task) be true?
[17:52:25] hnanon: ciree: I did what you suggested; same error: undefined local variable or method `current_user' for #<Class:0
[17:52:49] ciree: hnanon: show the new gist
[17:53:05] k4nd4lf_: has joined #RubyOnRails
[17:53:44] hnanon: ciree: It's sloppy and I know it needs refactoring but: https://gist.github.com/anonymous/86e86e5ea7553015c32f
[17:53:58] ciree: def self.unpaid(start_date, end_date, current_user)
[17:54:39] _seanc_: has joined #RubyOnRails
[17:55:02] hnanon: Ugghh...sorry.
[17:55:17] 7YUAAGZZH: has joined #RubyOnRails
[17:55:51] hnanon: On that line, an error: wrong number of arguments (0 for 3)
[17:56:13] asheinfeld: has joined #RubyOnRails
[17:56:25] hnanon: That was the same error when I was using a scope.
[17:56:39] n008f4g_: has joined #RubyOnRails
[17:56:51] baweaver: has joined #RubyOnRails
[17:57:04] krowv: has joined #RubyOnRails
[17:57:22] slava_: tubbo, Milestone refers to table "acx_project_objects" and Task refers to table "acx_project_objects". But milestone is the parent of Tasks. so Task has a foreign key that points to Milestone. But all within the same table.
[17:57:30] leafac1: has joined #RubyOnRails
[17:57:36] k4nd4lf_: has joined #RubyOnRails
[17:57:53] Frem: has joined #RubyOnRails
[17:58:07] ciree: hnanon: line 12?
[17:59:38] ciree: did you update self.unpaid to accept arguments?
[18:00:10] hnanon: def self.unpaid(start_date, end_date, current_user)
[18:00:18] ciree: try changing the yielded variable on line 78
[18:00:36] ciree: unpaid_dealers maybe
[18:00:41] k4nd4lf_: has joined #RubyOnRails
[18:00:46] IrishGringo: has joined #RubyOnRails
[18:01:36] hnanon: unpaid > up
[18:01:45] nickjj: is anyone looking to replace the asset pipeline with webpack?
[18:01:46] k4nd4lf_: has joined #RubyOnRails
[18:02:08] tubbo: nickjj: i'm actually working on using Gulp as a replacement for the asset pipeline
[18:02:08] hnanon: I changed the variable from unpaid to up in the block.
[18:02:16] hnanon: Same error: wrong number of arguments (0 for 3)
[18:02:20] tubbo: nickjj: webpack doesn't seem like it will do the full job, you still need a build tool of some kind..
[18:02:33] hnanon: This has been driving me crazy.
[18:02:33] gsd: has joined #RubyOnRails
[18:02:44] nickjj: tubbo, what did you find lacking with webpack? i have it doing everything i can possibly imagine
[18:03:29] chintanparikh: has joined #RubyOnRails
[18:03:43] nickjj: minify all assets, md5 tag everything, convert es6 JS to es5, source maps, sass, remove duplicate css selectors, uglify everything, auto-prefix css selectors that need it, commonjs module system, etc.
[18:04:28] nickjj: oops, i mean css properties
[18:04:43] ciree: hnanon update gist again
[18:04:44] slava_: tubbo, basically i want to do: .where.not(name: 'milestone.name') but it treats it as a string lol.
[18:04:51] tubbo: nickjj: honestly didn't look too much into it
[18:05:23] maz-dev: has joined #RubyOnRails
[18:05:27] nickjj: tubbo, you don't need gulp imo
[18:05:30] tubbo: slava_: this seems like a half-assed implementation of a nested set :P, not sure how easy it would be to add awesome_nested_set to an existing table.
[18:05:31] pjammer: has joined #RubyOnRails
[18:05:53] tubbo: slava_: actually wait you don't need that :D
[18:06:03] hnanon: ciree: https://gist.github.com/anonymous/662e434d703d394bee63
[18:06:18] nickjj: tubbo, but i brought up webpack because i just finished writing a plugin that generates a manifest file that's compatible with all the rails helpers, was wondering if someone wanted to test it out
[18:06:36] tubbo: slava_: if you only didn't have two separate objects...then you could have Task belongs_to :milestone and has_many :tasks
[18:06:46] djbkd: has joined #RubyOnRails
[18:06:46] ciree: hnanon: include the stack trace please
[18:06:49] tubbo: slava_: or, since you have a Milestone class, why can't you just do milestone.tasks?
[18:07:07] n80: has joined #RubyOnRails
[18:08:16] benhuda: has joined #RubyOnRails
[18:09:50] hnanon: ciree: https://gist.github.com/anonymous/fd361c6bf3d6571c7f89
[18:10:34] hnanon: ciree: current_user is the current_user provided by the Sorcery gem. It's passed from the "reconcile" action in the controller.
[18:10:36] k4nd4lf_: has joined #RubyOnRails
[18:12:08] Guest1526: has joined #RubyOnRails
[18:12:18] hnanon: ciree: I commented out the line on line 77.
[18:12:22] hnanon: New error:
[18:12:29] dionysus69: has joined #RubyOnRails
[18:12:44] hnanon: on line 78
[18:12:47] hnanon: SQLite3::SQLException: ambiguous column name: customer_id: SELECT "dealer_commissions".* FROM "dealer_commissions" LEFT OUTER JOIN carrier_commissions ON dealer_commissions.phone_id = carrier_commissions.phone_id AND dealer_commissions.name = carrier_commissions.name WHERE (carrier_commissions.id IS NULL) AND (customer_id = 8 AND created_at > '2015-02-04' AND created_at < '2015-06-04')
[18:13:08] slava_: tubbo, I can and I am already doing it. That's not the problem. I am just trying to make the default scope to return all the Tasks that don't have the same name as its Milestone (task.milestone.name)
[18:13:40] erich: has joined #RubyOnRails
[18:14:03] ghr: has joined #RubyOnRails
[18:14:04] slava_: default_scope { where(type: 'Task', state:3).where.not(name: task.milestone.name)
[18:15:01] hnanon: ciree: The comment was calling the unpaid method without any arguments.
[18:15:19] hnanon: The puts, I mean.
[18:15:33] iamjarvo: has joined #RubyOnRails
[18:15:38] hamster88: has joined #RubyOnRails
[18:15:45] hamster88: Greetings everyone ^^
[18:16:07] Lytol: has joined #RubyOnRails
[18:16:34] hamster88: have anyone of you used bootstrap for rails application?
[18:16:40] hardtail: has joined #RubyOnRails
[18:16:45] hnanon: The error above is saying the the column name "customer_id" is ambiguous?
[18:16:53] qejk: has joined #RubyOnRails
[18:17:14] renechz: has joined #RubyOnRails
[18:17:33] hnanon: Should it be dealer_commissions.customer_id?
[18:17:51] uris: has joined #RubyOnRails
[18:18:01] asheinfeld: has joined #RubyOnRails
[18:18:15] kies: has joined #RubyOnRails
[18:18:53] hnanon: New error after doing that: SQLite3::SQLException: ambiguous column name: created_at:
[18:19:04] hnanon: I will try the same for the created_at column.
[18:19:21] hamster88: I am trying to use set the posts to appear side by side or can say 3 posts in one line vertically , gist >> https://gist.github.com/thedesignable/83b0f450bfc35eb990fd
[18:19:30] hardtail: Good day everybody
[18:20:12] hamster88: horizontally *
[18:20:14] maz-dev_: has joined #RubyOnRails
[18:23:51] erich: has joined #RubyOnRails
[18:24:16] edwinvdgraaf: has joined #RubyOnRails
[18:25:23] skandi: has joined #RubyOnRails
[18:25:31] iamjarvo: has joined #RubyOnRails
[18:26:39] k4nd4lf: has joined #RubyOnRails
[18:27:47] duderonomy: has joined #RubyOnRails
[18:27:55] ciree: hamster88: whats the problem?
[18:28:19] IFrank00: has joined #RubyOnRails
[18:28:20] hamster88: ciree, i can't set those posts up side by side
[18:28:22] ciree: looks like your mossing a closing div
[18:28:24] ciree: <div class="col-xs-6 col-sm-4">
[18:28:25] doodleha_: has joined #RubyOnRails
[18:28:38] joaomdmoura: has joined #RubyOnRails
[18:28:42] hamster88: or say 1 post per column
[18:28:51] ciree: <% @posts.each do |post| %>
[18:28:59] ciree: under class="row post"
[18:29:11] IFrank00: has left #RubyOnRails: ()
[18:29:16] madebymarkca: has joined #RubyOnRails
[18:29:20] IFrank00: has joined #RubyOnRails
[18:30:05] Lightsword: has joined #RubyOnRails
[18:30:13] asheinfeld: has joined #RubyOnRails
[18:32:37] Scripore: has joined #RubyOnRails
[18:32:49] IFrank00: quick question if I have a shallow routes like this resources :projects, shallow: true do resources :employees end. how can I do this @project = Project.find(:id) @employee = @project.employees.find(params[:id])
[18:33:10] IFrank00: on the show action
[18:33:36] hnanon: ciree: No errors now. I went back to the scope, however...
[18:34:03] IFrank00: I got in my index this projects/id/employee and on the show action employee/id
[18:34:03] ciree: hnanon: why scope?
[18:34:33] ciree: hnanon: nvm, its the right call
[18:34:48] hnanon: https://gist.github.com/anonymous/0313221c76895495c261
[18:34:53] hnanon: Yeah, I felt scope is better.
[18:35:12] ciree: well done
[18:35:21] ciree: make sure you understand why you were having issues
[18:35:24] hnanon: I'm showing 28 unpaid records from the puts.
[18:35:29] Fire-Dragon-DoL: lol, merging pull request "404" felt really scary, I thought I created some weird github bug :P
[18:35:41] hnanon: However, I'm counting 29 in my view.
[18:36:09] cmisenas: has joined #RubyOnRails
[18:36:15] hnanon: I think it's my query.
[18:36:49] hnanon: The one that's not being shown as unpaid (or anything else) has a matching carrier_commission but for a different customer id.
[18:37:00] hamster88: I have 6 posts on index page, but the things is only 2 of six shifts to other two columns and rest 4 still remains at same place.
[18:37:16] hamster88: not getting arrange in 3x3 column to be exact
[18:37:35] hamster88: i tried what you said ciree, and that is what the output was
[18:37:39] hnanon: ciree: My query includes .where('carrier_commissions.id IS NULL')
[18:38:12] hnanon: However, it's not NULL, but rather, it exists for a different customer.
[18:38:14] ciree: hnanon: you have to rework your query I guess
[18:38:30] djbkd: has joined #RubyOnRails
[18:38:47] ciree: hamster88: keep trying, bootstrap isn't too diffcult
[18:38:48] hnanon: Yeah, I need it so that IS NULL is included just for that customer/user.
[18:39:04] ciree: hnanon: try just starting without creating the posts, just hard core a couple rows/items
[18:39:09] ciree: hamster88: ***
[18:39:39] leafac: has joined #RubyOnRails
[18:39:40] boontdustie: has joined #RubyOnRails
[18:40:08] bhorn1: has joined #RubyOnRails
[18:40:56] SteenJobs: is anyone very familiar with the inner workings of Devise?
[18:41:06] ciree: SteenJobs: ask your question
[18:41:20] hnanon: I abandoned Devise for Sorcery.
[18:41:21] danman: has joined #RubyOnRails
[18:41:33] hnanon: Seems easier to work with, imo.
[18:41:55] spyderman4g63: has joined #RubyOnRails
[18:41:56] coderhs: has joined #RubyOnRails
[18:42:01] SteenJobs: ciree: i have an app that i inherited and there are two separate models for clients and users (the peeps on our end). Right now they have two separate login pages, but I want to create a single login page that can determine whether the person logging in is a user or client and then route them to the appropriate page.
[18:42:17] SteenJobs: i inherited meaning i???m working with someone else???s code, at least partially.
[18:44:01] allcentury: has joined #RubyOnRails
[18:44:45] asheinfeld: has joined #RubyOnRails
[18:45:07] ciree: have you tried anything thus far?
[18:46:15] SteenJobs: tried creating a sessions controller that inherits from devise???s sessions controller and overriding the create method
[18:46:39] leafac1: has joined #RubyOnRails
[18:47:22] leafac1: has left #RubyOnRails: ()
[18:47:34] DoubleMalt: has joined #RubyOnRails
[18:47:42] yfeldblum: has joined #RubyOnRails
[18:47:44] hamster88: ciree, is there a way to make the grid lines visible in bootstrap?
[18:47:59] hnanon: ciree: I reworked the query to the following, with no success:
[18:48:02] hnanon: .where('carrier_commissions.id IS NULL AND dealer_commissions.customer_id = ? AND dealer_commissions.created_at > ? AND dealer_commissions.created_at < ?', current_user.customer.id, start_date, end_date)
[18:48:04] SteenJobs: hamster88: i???m pretty sure firefox has the ability to do so
[18:48:21] hamster88: SteenJobs, how??
[18:48:41] SteenJobs: hamster88: i think there???s an extension
[18:48:44] SteenJobs: i added it a while back
[18:48:52] hamster88: SteenJobs, grid fox?
[18:48:52] ciree: SteenJobs: a bit out of my reach, you'll have to research solutions and try them
[18:49:05] SteenJobs: ciree: been researching like crazy :(
[18:49:10] zendrix: has joined #RubyOnRails
[18:49:19] hnanon: http://www.puidokas.com/portfolio/gridfox/
[18:50:24] ujvaljoshi: has joined #RubyOnRails
[18:51:06] hamster88: bootstrap grids are hard to understand :(
[18:51:40] SteenJobs: hamster88: front end is a nightmae
[18:51:47] SteenJobs: at least to me it is
[18:51:54] SteenJobs: little logic and just incredibly tedious
[18:51:56] hamster88: SteenJobs, we are on the same boat xD
[18:53:01] hamster88: SteenJobs, I have been trying to set the layout to view post in such a way that each post sits in a row in 3 columns (one in each)
[18:53:14] hnanon: I need an "IS NULL" when a conditions exists (IS NULL for a given user)
[18:53:20] hamster88: but blah.. failed lol xD
[18:55:05] _blizzy_: has joined #RubyOnRails
[18:55:14] pipework: SteenJobs: There's often loads of logic on the frontend these days.
[18:55:23] _blizzy_: can anyone help me figure out why I'm getting "ActionView::MissingTemplate (Missing template folders/create, application/create"
[18:55:28] _blizzy_: https://gist.github.com/NotBlizzard/40bdaf4e8e3e314dca7f
[18:55:29] SteenJobs: pipework: i meant like html, css, not front end js stuff
[18:55:32] foucist: anyone know anything about mulesoft ? good/bad ?
[18:55:54] pipework: SteenJobs: Oh man, you can do some insane things with CSS3 though.
[18:55:59] pipework: foucist: You mean the winamp people?
[18:56:14] SteenJobs: pipework: word. but it???s soooo frustrating ha.
[18:56:14] pipework: Oh that's not them, sorry.
[18:57:15] davidhq: has joined #RubyOnRails
[18:57:17] tubbo: has joined #RubyOnRails
[18:57:20] x1337807x: has joined #RubyOnRails
[18:58:04] x1337807x: has joined #RubyOnRails
[19:00:38] foucist: pipework: got a guy at work trying to recommend them for our push notifications i guess, but the service seems a bit more aimed at java people or something
[19:00:53] netzfisch: has joined #RubyOnRails
[19:00:54] hahuang65: has joined #RubyOnRails
[19:01:33] pacMakaveli: has joined #RubyOnRails
[19:03:18] pipework: foucist: Oh, I never tried them out. I'd use amazon SNS, but I haven't used it yet.
[19:03:21] pipework: Does that give you what you need?
[19:03:52] sandstrom: has joined #RubyOnRails
[19:04:40] tubbo: hey mongoid users
[19:04:45] blunckr: has joined #RubyOnRails
[19:04:46] podman: has joined #RubyOnRails
[19:04:57] tubbo: make sure you get "^" and "$" out of your BSON::Regexp's
[19:04:58] asheinfeld: has joined #RubyOnRails
[19:05:20] arooni-mobile: has joined #RubyOnRails
[19:06:45] srinidhi: has joined #RubyOnRails
[19:07:28] tubbo: because they will blow up
[19:08:12] uris: has joined #RubyOnRails
[19:08:58] alexclark: has joined #RubyOnRails
[19:09:38] bratsche: has joined #RubyOnRails
[19:09:53] alexclark: does rails automatically destroy objects created in a test after?
[19:11:02] nonparfumee: has joined #RubyOnRails
[19:12:39] chintanparikh: has joined #RubyOnRails
[19:13:16] kinduff: has joined #RubyOnRails
[19:13:23] kinduff_: has joined #RubyOnRails
[19:14:20] thebatu1: has joined #RubyOnRails
[19:14:24] hnanon: What SQL clause can I user to limit queries to a specific user?
[19:14:45] ghr: has joined #RubyOnRails
[19:15:36] zeRez: has joined #RubyOnRails
[19:16:07] jkamenik: has joined #RubyOnRails
[19:16:57] [1]Danny: has joined #RubyOnRails
[19:17:02] arBmind: has joined #RubyOnRails
[19:17:31] allcentury: has joined #RubyOnRails
[19:17:52] k4nd4lf: has joined #RubyOnRails
[19:17:59] djbkd: has joined #RubyOnRails
[19:18:37] baweaver: has joined #RubyOnRails
[19:19:13] jenrzzz: has joined #RubyOnRails
[19:20:03] _blizzy_: can anyone help me figure out why I'm getting "ActionView::MissingTemplate (Missing template folders/create, application/create"
[19:20:04] _blizzy_: https://gist.github.com/NotBlizzard/40bdaf4e8e3e314dca7f
[19:20:25] n80: has joined #RubyOnRails
[19:21:06] sonofdirt: has joined #RubyOnRails
[19:21:44] Anakat_: has joined #RubyOnRails
[19:21:51] hnanon: ciree: I figured it out. I added this line to the left out join: dealer_commissions.customer_id = carrier_commissions.customer_id
[19:21:52] alvaro_o: has joined #RubyOnRails
[19:22:19] hnanon: ciree: Thank you so much for helping me and walking me through the problem.
[19:22:21] kadoppe: has joined #RubyOnRails
[19:22:29] ciree: np man, pay it forward
[19:22:41] hnanon: I'll try. :)
[19:23:22] ciree: _blizzy_: do have views/folders/create ?
[19:23:28] TinkerTyper: has joined #RubyOnRails
[19:23:58] ciree: _blizzy_: what route are you actually hitting
[19:25:06] asheinfeld: has joined #RubyOnRails
[19:28:30] pjammer: has joined #RubyOnRails
[19:30:20] kenndel: has joined #RubyOnRails
[19:30:23] lxsameer: has joined #RubyOnRails
[19:30:47] hamster88: still with layout thing, when i am inspecting the using dev tools, i see that the container and row are only applying to first post of my post (rails) not the rest of them ..
[19:31:28] hamster88: updated gist with new code.. https://gist.github.com/thedesignable/83b0f450bfc35eb990fd
[19:31:39] hamster88: i am not sure why is this happening :/
[19:31:59] lxsameer: guys what is the best practice to setup a global object that be accessible any where in a rails app ?
[19:34:07] ciree: hamster88: and you want 3 of them per row?
[19:34:09] rickmasta: has joined #RubyOnRails
[19:34:36] hamster88: ciree, right. It's my first time using bootstrap for rails app
[19:34:56] hamster88: ciree, shall i give you a screenshot ?
[19:36:39] hamster88: please refer to this http://tinypic.com/r/2zp3uxw/8
[19:37:27] iamjarvo: has joined #RubyOnRails
[19:37:30] dnlbyl: has joined #RubyOnRails
[19:37:44] ciree: use imgur
[19:37:48] ciree: didnt even load for me
[19:37:59] ciree: imgur.com
[19:38:20] shock_one: has joined #RubyOnRails
[19:38:35] hamster88: alright give me a sec
[19:39:32] danman: has joined #RubyOnRails
[19:39:38] hamster88: http://imgur.com/OKmHH1N
[19:39:51] hamster88: thats should suffice
[19:40:16] ciree: whats the problem?
[19:40:38] ciree: that looks good to me..
[19:40:58] bricker: lxsameer: All modules and constants are globally accessible in ruby
[19:41:24] bricker: lxsameer: if you need a class lib/ is fine, if it's just a constant then an initializer is fine
[19:41:53] lxsameer: bricker: thanks
[19:42:22] baweaver: has joined #RubyOnRails
[19:42:28] hamster88: ciree, that is how i want the layout to be.. my layout is different :(
[19:42:40] hamster88: check the gist i have added.
[19:43:12] n80: has joined #RubyOnRails
[19:43:42] joaomdmoura: has joined #RubyOnRails
[19:44:05] ciree: https://jsfiddle.net/DTcHh/
[19:44:17] hamster88: that is how my layout looks like http://imgur.com/RGs8tF9
[19:44:25] tubbo: alexclark: sorta, it performs all db queries in a transaction and rolls the transaction back after each test
[19:44:38] ciree: hamster88: look at my jsfiddle
[19:44:47] alexclark: awesome, thanks tubbo
[19:44:51] ciree: you probbaly have something else fucked up, try removing things slowly
[19:46:33] meoblast001: has joined #RubyOnRails
[19:46:34] hamster88: well my nav bar is ok. i will adjust it but the concern is the layout of post that is under posts id
[19:47:40] haz111: has joined #RubyOnRails
[19:48:18] meoblast001: has joined #RubyOnRails
[19:48:50] _seanc_: has joined #RubyOnRails
[19:48:51] SteenJobs: has joined #RubyOnRails
[19:50:01] Coldblackice: has joined #RubyOnRails
[19:50:42] ttsuchi: has joined #RubyOnRails
[19:52:15] ttsuchi: has left #RubyOnRails: ()
[19:52:32] asheinfeld: has joined #RubyOnRails
[19:52:32] ttsuchi: has joined #RubyOnRails
[19:53:18] Godel108: has joined #RubyOnRails
[19:53:30] jenrzzz_: has joined #RubyOnRails
[19:53:46] Godel108: Hello everyone, I have a question. I am creating a website that requires user names with many different roles. I was thinking that I should use 'devise' with 'rolify' and 'pundit'. Is this a good combination for what I need?
[19:54:03] ndrei: has joined #RubyOnRails
[19:54:17] ttsuchi: has joined #RubyOnRails
[19:55:30] ciree: Godel108: you can also try cancancan
[19:55:40] ciree: i have no expierence with the matter though
[19:55:53] uris: has joined #RubyOnRails
[19:56:07] asheinfeld: has joined #RubyOnRails
[19:56:26] n80: has joined #RubyOnRails
[19:56:56] Godel108: I had seen that, but it did say in the documentation that cancancan is unwieldy as the program gets larger. It seems like there are some tutorials for that combination... but not for the one I am considering... that's why I was a bit worried to try it... thinking that maybe it can't be done
[19:57:42] ciree: New Maintainer Needed isn't promising either
[19:58:56] davidhq: has joined #RubyOnRails
[20:00:59] Olipro_: has joined #RubyOnRails
[20:03:12] tubbo: ciree: lol why would you suggest code that is almost out of date:P
[20:03:30] tubbo: Godel108: have you had any issues with the combo of tools you just described?
[20:03:36] eriksays: has joined #RubyOnRails
[20:04:16] _seanc_1: has joined #RubyOnRails
[20:04:23] Synthead: Is this syntax correct? MyModel.includes(foo: :bar).where(foos: {bars: {name: "foobar"}})
[20:04:25] iamjarvo: has joined #RubyOnRails
[20:04:48] asheinfeld: has joined #RubyOnRails
[20:05:10] iamjarvo: has joined #RubyOnRails
[20:05:53] iamjarvo: has joined #RubyOnRails
[20:06:48] tubbo: i've never seen anyone pass a hash into includes()
[20:07:03] Godel108: tubbo: I understand now how devise works. I was reading through a pundit start up guide and it suggests that I use rolify. It points me to the rolify homepage on github... but the documentation is somewhat unclear... are cancan and pundit interchangeable? this is what I was hoping someone could explain to me... if this combination makes sense
[20:08:50] tubbo: Godel108: pundit and cancan solve the same problem
[20:09:06] FernandoBasso: has joined #RubyOnRails
[20:09:09] Synthead: tubbo: I'm having an issue where a query like this one returns Mysql2::Error: Unknown column 'foos.bars' in 'where clause': ... I've wrapped the Hash in [] and it still shows the same error
[20:09:13] tubbo: rolify just makes things easier
[20:09:31] Godel108: tubbo: great!
[20:09:47] mahamadp_: has joined #RubyOnRails
[20:09:51] tubbo: Synthead: you're trying to join models to bars through foos?
[20:10:09] tubbo: i'm not sure you can do that without doing another JOIN
[20:10:36] Godel108: tubbo: do you know of any good resources for this combination? or just for understanding rolify?
[20:11:01] pramsky: has joined #RubyOnRails
[20:11:24] mahamadpiazza: has joined #RubyOnRails
[20:13:43] tubbo: Godel108: you could always start with the rolify repo and README
[20:13:51] tubbo: that's how i typically start my code spelunking adventures
[20:13:58] chintanparikh: has joined #RubyOnRails
[20:14:10] tubbo: it tells you how to get started with rolify right in the README, this goes for all other ruby libs you will encounter worth a shit
[20:14:18] tomkadwill: has joined #RubyOnRails
[20:14:37] Godel108: ok thank you
[20:14:46] Godel108: I didn't think about the README
[20:14:53] Godel108: thanks for the advice
[20:14:54] bendangelo: has joined #RubyOnRails
[20:15:46] alexclark: tubbo: do you know any way to turn this transaction wrapping off?
[20:16:23] tubbo: alexclark: it's possible, but it's a bad idea
[20:16:27] chagel: has joined #RubyOnRails
[20:16:42] tubbo: alexclark: because then you can write tests that depend on each other or depend on a specific order of events happening before execution, and that is bad
[20:16:52] alexclark: tubbo: well our app at work has activerecord writing to the db and an external service doing the reading
[20:17:01] tubbo: in tests?
[20:17:02] alexclark: tubbo: so the bad ideas been made
[20:17:07] tubbo: no that's all fine
[20:17:14] tubbo: it's just in your tests when transactions get rolled back
[20:17:46] tubbo: alexclark: but that service doesn't hit your app when you're testing it
[20:17:49] alexclark: tubbo: yeah, but the problem is the external service cant read the records i set up in my test
[20:17:58] tubbo: why should it need to?
[20:18:00] tubbo: you're in a test
[20:18:22] tubbo: alexclark: your external service should NEVER hit the test db at all, the test db as far as its concerned has no guarantee of existing
[20:18:23] sandstrom: has joined #RubyOnRails
[20:18:25] dionysus69: has joined #RubyOnRails
[20:18:28] tubbo: rails deletes and re-creates the DB every time you run tests basically
[20:18:32] tubbo: so that's not a good idea
[20:18:51] tubbo: decouple the service from your data so you can mock out the service in tests if you really need to see what's going on
[20:19:21] alexclark: tubbo: yeah that really isnt possible
[20:19:43] alexclark: we have a rails route that runs a unix command that returns json
[20:20:03] alexclark: i need to ensure what this json looks like
[20:20:25] workmad3: has joined #RubyOnRails
[20:21:39] ciree: alexclark: maybe try using VCR?
[20:22:06] smizell: has joined #RubyOnRails
[20:22:09] tubbo: alexclark: encapsulate the call to the command (probably backticks) in a method, mock the method in your controller class.
[20:22:09] hnanon: .to_i converts to an integer. What converts to a decimal? .to_d?
[20:22:19] tubbo: hnanon: it's called a "floating-point", so to_f
[20:22:25] hnanon: Using BigDecimal as a type.
[20:22:43] x-light: has joined #RubyOnRails
[20:22:44] tubbo: sorry actually that uses Float
[20:22:45] ramfjord: has joined #RubyOnRails
[20:22:59] tubbo: dunno if there's a to_ method for bigdecimal
[20:23:16] cschneid: has joined #RubyOnRails
[20:23:24] asheinfeld: has joined #RubyOnRails
[20:23:58] hnanon: It is .to_d
[20:24:35] jenrzzz: has joined #RubyOnRails
[20:24:41] rickmasta: has joined #RubyOnRails
[20:24:46] bricker: hnanon: also, BigDecimal.new(your_int)
[20:25:34] hnanon: Ok, thanks.
[20:25:36] bricker: I've never heard of to_d
[20:25:43] tomkadwill: has joined #RubyOnRails
[20:25:49] hnanon: Yeah, I just saw it in the api.
[20:25:57] bricker: In the Ruby API? Where?
[20:26:05] bricker: I see it on BigDecimal but not on other numerics
[20:26:34] tubbo: alexclark: https://gist.github.com/tubbo/2eaa8c4521b95cee8a48 is what i was thinking
[20:27:15] hnanon: http://ruby-doc.org/stdlib-2.1.0/libdoc/bigdecimal/rdoc/String.html
[20:27:49] bricker: tubbo: :shipit:
[20:28:05] Etriaph: has joined #RubyOnRails
[20:28:15] bricker: hnanon: ah
[20:28:30] bricker: hnanon: not in the normal String API but added by BigDecimal
[20:28:56] bricker: Same with Integer: http://ruby-doc.org/stdlib-2.1.0/libdoc/bigdecimal/rdoc/Integer.html#method-i-to_d
[20:29:32] asheinfe_: has joined #RubyOnRails
[20:31:34] baweaver: has joined #RubyOnRails
[20:31:35] Lightsword: has joined #RubyOnRails
[20:31:37] tomeara: has joined #RubyOnRails
[20:32:42] Synthead: can you guys think of any problems that could arise if I pass a arbitrary user params to a AR .where method?
[20:32:45] eriksays: using gem acts_as_taggable_on ??? in the ???Journal??? show view, it???s showing the most recently updated tags (across all nodes), instead of that tags for that particular node
[20:32:46] mahamadpiazza: has joined #RubyOnRails
[20:32:57] hahuang65: has joined #RubyOnRails
[20:33:12] weaksauce: Synthead can you gist how you are trying it?
[20:33:52] Synthead: weaksauce: it's not complicated: basically MyModel.where(params[:where].to_hash)
[20:33:52] hutch78: has joined #RubyOnRails
[20:34:00] weaksauce: if you use `?` parameter replacements it should escape it for you
[20:34:15] Synthead: weaksauce: I'm using pure AR atm (no SQL)
[20:34:48] eriksays: so in the index view. @journal.tags works correctly, but in the show.html.erb, it displays most recent tag???
[20:35:02] Synthead: weaksauce: I can't think of any injection issues, and AR will raise an exception if something's funky
[20:35:12] weaksauce: I can't think of an exploit off the top of my head but someone smarter than I could probably do it.
[20:35:17] momomomomo: has joined #RubyOnRails
[20:35:31] Synthead: weaksauce: the user can't do any write operations via .where(...), I don't think
[20:35:53] weaksauce: is there a problem of getting too much data back? or data that they shouldn't have?
[20:36:41] Synthead: weaksauce: no, it's ok if the user gets everything if that's what they want
[20:36:51] Synthead: weaksauce: but good thinking
[20:38:16] weaksauce: Synthead perhaps it's safe but whenever I do something like that it raises some alarms.
[20:38:18] tubbo: has joined #RubyOnRails
[20:38:35] Synthead: weaksauce: yeah, same :)
[20:38:50] Papierkorb: has joined #RubyOnRails
[20:38:50] asheinfeld: has joined #RubyOnRails
[20:39:04] Synthead: weaksauce: it is pretty difficult to validate nested where queries, though
[20:39:33] weaksauce: if it's for a relatively trusted set of users that have to authenticate it has a lower level of security need than a public facing site without authentication and authorization.
[20:39:34] dseitz: has joined #RubyOnRails
[20:39:36] eriksays: nm ??? i had broken my routes, messing it all up ??? now it???s all better
[20:39:54] Synthead: weaksauce: yeah
[20:40:14] mostlybadfly: has joined #RubyOnRails
[20:40:29] Otterpocket: has joined #RubyOnRails
[20:41:24] Synthead: weaksauce: how about something like MyModel.includes(foo: :bar).where(bars: {name: "foobar"}): is there a way I can check if "bars" is a valid param to .where in this case, perhaps by querying MyModel's reflections?
[20:45:44] m0r0n: has joined #RubyOnRails
[20:45:55] maz-dev: has joined #RubyOnRails
[20:46:31] starfox_sf: has joined #RubyOnRails
[20:47:23] jenrzzz: has joined #RubyOnRails
[20:47:57] pipework: Synthead: Why not just use a method instead?
[20:47:59] bratsche: has joined #RubyOnRails
[20:48:10] Synthead: pipework: what do you mean?
[20:48:40] pipework: Synthead: Define a method, probably via custom validation class, to use for that query like a scope?
[20:49:12] mase-chatter: has joined #RubyOnRails
[20:49:13] hnanon: In a customers_controller, I have @dealer_commissions = DealerCommission in my show action so far.
[20:49:25] hnanon: I want to list all dealer commissions for that customer.
[20:49:46] ciree: Customer.find(params[:id]).dealer_comissions
[20:50:05] hnanon: I also have a set_customer method in private
[20:50:10] bratsche_: has joined #RubyOnRails
[20:50:16] ciree: @customer.dealer_comissions
[20:50:38] Synthead: pipework: oh sure. but in the above example, can I do MyModel.some_method to tell whether or not :bar is a valid association? it's not directly related to MyModel, and MyModel.reflections doesn't show it. I could iterate every reflection's reflection and build a list, but this seems like a jumble
[20:50:51] hnanon: So I can do @dealer_commissions = @customer.dealer_commissions.
[20:51:31] ciree: minuse the period at the end
[20:51:38] ciree: assuming your customer
[20:51:43] hnanon: Yes, Thanks.
[20:51:45] ciree: has_many :dealer_comissions
[20:52:31] asheinfeld: has joined #RubyOnRails
[20:52:33] zendrix: has joined #RubyOnRails
[20:53:09] edwinrozario: has joined #RubyOnRails
[20:53:14] pipework: hnanon: Are you making sure to use #includes properly as well?
[20:53:25] Spami: has joined #RubyOnRails
[20:53:32] syzygy_: has joined #RubyOnRails
[20:54:21] asheinfeld: has joined #RubyOnRails
[20:54:53] ndrei: has joined #RubyOnRails
[20:55:27] mahamadpiazza: has joined #RubyOnRails
[20:56:03] jenrzzz: has joined #RubyOnRails
[20:56:23] AndroidLoverInSF: has joined #RubyOnRails
[20:57:17] sarink: has joined #RubyOnRails
[20:58:39] sarink: has joined #RubyOnRails
[20:58:39] asheinfeld: has joined #RubyOnRails
[21:02:21] IFrank00: has left #RubyOnRails: ("Leaving")
[21:02:25] IFrank00: has joined #RubyOnRails
[21:02:35] Lightsword: has joined #RubyOnRails
[21:03:19] thebatu1: has joined #RubyOnRails
[21:04:32] baweaver: has joined #RubyOnRails
[21:05:02] tubbo: has joined #RubyOnRails
[21:05:42] x1337807x: has joined #RubyOnRails
[21:06:23] hutch78: has joined #RubyOnRails
[21:06:27] x1337807x: has joined #RubyOnRails
[21:06:40] syzygy_: has joined #RubyOnRails
[21:07:03] n80: has joined #RubyOnRails
[21:07:15] sarink: has joined #RubyOnRails
[21:07:57] Lightsword: has joined #RubyOnRails
[21:10:01] hnanon: pipework: includes, for?
[21:10:22] pipework: hnanon: The relation, gotta preload via joins, right?
[21:11:02] hnanon: I guess I'm not.
[21:11:15] hnanon: Can you provide an example?
[21:11:18] ndrei: has joined #RubyOnRails
[21:13:07] ur5us: has joined #RubyOnRails
[21:13:19] mberk: has joined #RubyOnRails
[21:13:54] sleungcy: has joined #RubyOnRails
[21:13:59] sarink: has joined #RubyOnRails
[21:14:03] SteenJobs: does anyone know anything about the resource variable in devise?
[21:14:47] Etriaph: hnanon: User.includes(:preferences).where(...)
[21:15:02] Etriaph: hnanon: But the tables have to have a relationship.
[21:15:04] pipework: hnanon: !bullet I suggest this.
[21:15:04] helpa: hnanon: https://github.com/flyerhzm/bullet
[21:15:10] sarink: has joined #RubyOnRails
[21:15:33] baweaver: Fun pattern for frontend testing / bootstrap style guides make classes for distinct entities for hooks like .save-button which includes 'button button-primary' for instance
[21:15:48] SteenJobs: i still can???t figue out how to use the same login for two different models with devise. i???ve scoured the interweb.
[21:16:55] Etriaph: SteenJobs: What do you mean?
[21:17:23] SteenJobs: Etriaph: here???s the deal:
[21:17:31] sarink: has joined #RubyOnRails
[21:17:36] pipework: SteenJobs: Have one account and multiple Personae?
[21:17:42] zendrix: has joined #RubyOnRails
[21:17:57] rhizome: you have to try one model and then the other, like i said yesterday, and you have to write your own uniqueness enforcement.
[21:18:11] sarink: has joined #RubyOnRails
[21:18:14] ndrei: has joined #RubyOnRails
[21:18:42] SteenJobs: Etriaph: basically there are two models, clients and users (the peeps on our end), and right now they have two separate login pages.
[21:18:59] rhizome: which is why i suggested one model with roles even longer ago
[21:19:01] SteenJobs: Etriaph: i want to create one single login page that can determine whether the person logging in is a user or client and then direct them to their respective landing page
[21:19:05] SteenJobs: rhizome: i know
[21:19:05] hnanon: Thanks Etriaph and pipework. I'll look into it.
[21:19:09] SteenJobs: rhizome: in theory i would
[21:19:21] SteenJobs: rhizome: but it would involve redoing 70% of the code in the app i inherited
[21:19:23] rhizome: then i guess i don't know what "can't figure out" means
[21:19:32] rhizome: yeah, well that code sucks then
[21:19:50] SteenJobs: rhizome: agreed. but there are also advantages to having separate user and client objects because they have totally different functions
[21:19:57] Etriaph: SteenJobs: Uh, why not one account based on their email address and flags?
[21:19:59] rhizome: either that, or it's not really a requirement that there be only one login form.
[21:20:18] benhuda: has joined #RubyOnRails
[21:21:15] SteenJobs: rhizome: yea i don???t have to have one login form, i???ll probably leave it as two separate - but i don???t like not knowing how to do something and giving up on it, like even if i???m not gonna use it i want to know how it can be done
[21:21:41] tjbiddle: has joined #RubyOnRails
[21:21:55] Etriaph: SteenJobs: Having one login form for two authentication routes isn't something I'd choose to solve.
[21:21:58] kinduff: has joined #RubyOnRails
[21:21:58] kinduff: has joined #RubyOnRails
[21:22:15] hnanon: Can I do something like the following to count the number of occurrences of x values in a column:
[21:22:19] SteenJobs: Etriaph: ugh i just feel like it could lead to a good understanding of how this stuff works
[21:22:20] hnanon: @discrepancy_count = @dealer_commissions.count(:status {underpaid|unpaid})
[21:22:39] rhizome: this is really in the "why does my car only have one reverse gear?" department
[21:22:49] SteenJobs: rhizome: how so?
[21:22:52] IFrank00: I'm trying to do @project.employees.find(prams[:id]) I got the project shallow nested resources on employee so I'm trying to filter so the employee has to be from the project and if a user change the ID on the url it won't show other project employee
[21:22:58] Etriaph: SteenJobs: Doing it isn't hard, at all, and it won't give you much understanding. You'd be creating a login form and trying auth username and password on two objects instead of one.
[21:23:01] rhizome: because sometimes i'd like to back up faster
[21:24:08] tubbo: SteenJobs: what's more important is learning when to stop because you're already down a really dark path
[21:24:17] tubbo: and how to get out of a hole that you've dug yourself in
[21:24:22] SteenJobs: Etriaph: somehow the login form still knows whether the person logging in is a client or a user, and it only accepts clients - even when i change up the routes and try overriding with my own sessions controller, so i really don???t know how to do what you???ve described???it would just be nice to not leave something behind that i don???t understand.
[21:24:33] londoncalling: has joined #RubyOnRails
[21:24:33] tubbo: why does it matter?
[21:24:36] SteenJobs: tubbo: i know you???re probably right???but isn???t it all part of getting to know rails more?
[21:24:40] Etriaph: SteenJobs: If you say "somehow" it means that you don't know how it works.
[21:24:41] tubbo: who cares whether they're a user or a client?
[21:24:48] tubbo: when you're authenticating, it doesn't matter.
[21:24:57] Etriaph: SteenJobs: Start digesting that code and you'll be better off.
[21:24:57] IFrank00: When the controller looks for the employee its not fetching the project_id so one way is to pass the id to the link_to but that pass the id to the url and same problem user can change the ID of the project too
[21:25:16] tjbiddle: has joined #RubyOnRails
[21:25:26] SteenJobs: Etriaph: i tried and i???m pretty sure it comes down to this ???resource??? variable.
[21:25:49] Etriaph: SteenJobs: How long have you been working with Rails?
[21:26:07] SteenJobs: tubbo: a net total of probably 3 months
[21:26:36] SteenJobs: Etriaph: but many more hours than what would be expected in 3 months
[21:26:54] SteenJobs: Etriaph: i know rails pretty well. i think the issue i???m running into has more to do with the way devise is structured.
[21:27:10] tubbo: SteenJobs: the `resource` method in your user form that you generated refers to whatever the devise user class is
[21:27:12] _blizzy_: ciree, sorry. I am hitting the folders#create route
[21:27:16] _blizzy_: I'll repost the code
[21:27:21] Etriaph: ACTION nods
[21:27:34] _blizzy_: https://gist.github.com/NotBlizzard/40bdaf4e8e3e314dca7f
[21:28:13] shock_one: has joined #RubyOnRails
[21:28:26] SteenJobs: tubbo: but there???s both a devise user class and a devise client class (including current_client and current_user methods, obvs) - so how does the sign in form differentiate? the client sign in form clearly knows to reject a user trying to sign in, and vice versa.
[21:28:48] ndrei: has joined #RubyOnRails
[21:29:05] Etriaph: SteenJobs: Meant to authenticate in two places.
[21:29:18] Etriaph: SteenJobs: Do a: rake routes
[21:29:27] Etriaph: SteenJobs: And look at config/routes.rb
[21:29:36] SteenJobs: Etriaph: been pouring all over it
[21:29:51] Etriaph: SteenJobs: And right now there's two login forms yes?
[21:30:06] MuffinPimp_: has joined #RubyOnRails
[21:30:09] Etriaph: SteenJobs: And you want to combine them.
[21:30:22] SteenJobs: Etriaph: correct!
[21:30:27] Etriaph: SteenJobs: Devise, afaik, doesn't do that.
[21:30:29] SteenJobs: Etriaph: i created my own sessions controller which inherits from the devise sessions controller, and tried routing both :users and :clients to my custom controller and using an if statement and that didnt work.
[21:30:33] SteenJobs: Etriaph: oh word
[21:30:39] SteenJobs: Etriaph: that might be why it???s not working? haha
[21:31:13] tubbo: SteenJobs: don't inherit from devise controllers right now
[21:31:23] tubbo: if you need something custom out of devise, just build your own user auth
[21:31:37] Etriaph: SteenJobs: I agree with tubbo, again :D
[21:31:37] SteenJobs: tubbo: i inherited from devise becaue i only wanted to override the create method
[21:31:38] tubbo: it's easy enough and devise has a lot of shit written for you, it's abstracted
[21:31:55] otherj: has joined #RubyOnRails
[21:32:10] asheinfeld: has joined #RubyOnRails
[21:32:30] tubbo: SteenJobs: i'm still of the opinion that your user should belong_to :profile where that profile is either an AdminProfile or a ClientProfile
[21:32:34] tubbo: but you thought that was "too much work"
[21:32:48] tubbo: yet you went through all the trouble to hack devise into doing what you wanted? :P
[21:32:49] zendrix: has joined #RubyOnRails
[21:32:52] tubbo: seems legit
[21:32:56] SteenJobs: tubbo: no no i meant if i was building it from scratch i???d totally do that
[21:33:07] tubbo: building what from scratch?
[21:33:11] SteenJobs: tubbo: but i inherited this app from someone else and it???s pretty big, and it???s designed with two separate models
[21:33:14] otherj: has joined #RubyOnRails
[21:33:18] tubbo: oh that's lame :D
[21:33:19] SteenJobs: tubbo: *the app (sorry for the ambiguity)
[21:33:28] tubbo: never mind i thought this was a green-field and you were still learing
[21:33:29] SteenJobs: tubbo: ha agreed. the guy that wrote this is a mother father
[21:33:29] tubbo: learning*
[21:33:43] SteenJobs: tubbo: ah yea. well i???m always learning.
[21:33:48] zendrix: has joined #RubyOnRails
[21:33:54] mrbubbles: has joined #RubyOnRails
[21:33:54] Etriaph: SteenJobs: I would definitely consider consolidating and migrating the userbase into a single model.
[21:34:09] SteenJobs: Etriaph: right so i would have to rewrite a ton of the app
[21:34:17] tubbo: not really
[21:34:17] SteenJobs: Etriaph: so i???d rather just leave it as two separate logins
[21:34:21] Etriaph: SteenJobs: Not if you play your cards right.
[21:34:23] doublemalt_: has joined #RubyOnRails
[21:34:30] tubbo: you could always key off the user, and when you need a client, you can just do user.client
[21:34:47] hahuang65: has joined #RubyOnRails
[21:34:47] workmad3: has joined #RubyOnRails
[21:34:53] tubbo: SteenJobs: you can still have two different login pages that point to the same POST /users action
[21:35:05] Etriaph: Or have User && Client inherit from an abstract with a type, so long as the models were similar.
[21:35:22] ProLoser: has joined #RubyOnRails
[21:35:24] _blizzy_: I still keep getting that it can not find the template folders/create
[21:35:29] _blizzy_: even though I'm not rendering a template
[21:35:30] Etriaph: brb, smoke break.
[21:35:43] SteenJobs: right. all good ideas, i???ll consider all of them.
[21:35:49] tubbo: not with devise :D
[21:36:08] SteenJobs: although i???m still desperately curious how i can make the single login work with devise but i guess it ain???t possible
[21:36:32] tubbo: anything is possible
[21:36:39] nonparfumee: has joined #RubyOnRails
[21:36:41] SteenJobs: tubbo: i mean as long as i have two login pages, what would consolidating the models accomplish?
[21:36:44] _blizzy_: do the impossible see the invisible
[21:36:45] SteenJobs: tubbo: so how do i do it?!?! haha
[21:36:47] tubbo: SteenJobs: once you become a little more advanced you won't need a chatroom of people to help you do that
[21:37:05] SteenJobs: tubbo: i know, but i???m forever indebted to this chatroom for allmost everything i???ve learned.
[21:37:15] tubbo: why should i waste my time helping you with an issue i don't care about that i think is the wrong way to solve the problem? :P
[21:37:22] tubbo: think about it from my perspective :)
[21:37:25] SteenJobs: tubbo: for pedagogical purposes!
[21:37:36] tubbo: you're a pedagogical
[21:37:50] Lytol: has joined #RubyOnRails
[21:38:25] SteenJobs: tubbo: not kidding, i???d still be stuck drooling over Hartl???s book if it wasn???t for this chat - this chat allowed me to cover the gap between hartl and building my own apps
[21:38:34] tubbo: yeah plus hartl kinda sucks
[21:38:36] tubbo: like i wouldn't hire him
[21:38:44] SteenJobs: tubbo: haha why so harsh?
[21:38:50] SteenJobs: tubbo: it was a pretty decent intro!
[21:38:52] tubbo: because i've worked with software written in that style but scaled up
[21:38:55] tubbo: and it doesn't work very well
[21:39:07] SteenJobs: tubbo: what style are you referring to
[21:39:11] tubbo: it only works in smaller codebases, but it's a great way to learn
[21:39:31] tubbo: SteenJobs: he breaks a lot of OOP rules, like mixing concerns and coupling objects together
[21:39:39] SteenJobs: oh interesting
[21:39:46] tubbo: still a great free tutorial for rails but there are better ones out there (that cost money)
[21:39:56] SteenJobs: tubbo: which??? give me names!!
[21:40:08] tubbo: SteenJobs: !r4ia
[21:40:08] helpa: SteenJobs: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[21:40:10] tubbo: SteenJobs: !poodr
[21:40:10] helpa: SteenJobs: Practical Object Oriented Design in Ruby - http://www.poodr.info/
[21:40:11] SteenJobs: tubbo: i???m now worried that i???m mentally restricted to hartl???s style because that???s what i learned
[21:40:15] tubbo: eloquent ruby
[21:40:19] SteenJobs: tubbo: please please. i have r4ia :)
[21:40:19] porkqpain: has joined #RubyOnRails
[21:40:24] tubbo: you're not mentally restricted to anything
[21:40:44] SteenJobs: tubbo: if i???ve never been exposed to any other style outside of hartl, i won???t be aware of it by definition...
[21:41:19] SteenJobs: tubbo: but yea, i???m forever indebted to you guys and this chat
[21:41:34] Radar: Thanks :)
[21:41:39] SteenJobs: who???s Radar?
[21:41:49] Radar: Just some guy from Adelaide.
[21:42:08] Radar: According to his Twitter bio: "Humble award winning super hero 5-times published author."
[21:42:11] tubbo: SteenJobs: he helped write R4IA
[21:42:27] tubbo: and by "helped write" i mean "bitched about the publisher for 6 months"
[21:42:36] SteenJobs: tubbo: i???m just kidding. Radar has been a legit guide for me from the beginning.
[21:43:23] SteenJobs: sevenseacat deserves a shoutout too. scared all of the ambiguity right out of me
[21:43:24] boontdustie: has joined #RubyOnRails
[21:43:26] Radar: tubbo: :)
[21:43:35] hnanon: Haha. I remember when I first started coming to this room. I was wondering who Radar was too...
[21:43:42] Radar: sevenseacat and I rewrote Rails 4 in Action.
[21:43:53] Radar: I dealt with the publisher a lot, so I bitched about them a lot
[21:44:15] Radar: They really are fucking useless muppets and I encourage anyone who would want to work with them to not do that.
[21:44:35] _blizzy_: can anyone help me figure out why I'm getting "ActionView::MissingTemplate (Missing template folders/create, application/create"
[21:44:37] _blizzy_: let me post the code
[21:44:55] Radar: _blizzy_: You are learning :)
[21:45:01] marr: has joined #RubyOnRails
[21:45:27] _blizzy_: https://gist.github.com/NotBlizzard/40bdaf4e8e3e314dca7f
[21:45:41] _blizzy_: I'm using :remote => true, so I'm assuming the format would be js
[21:45:46] Radar: https://gist.github.com/NotBlizzard/40bdaf4e8e3e314dca7f#file-folders_controller-rb-L11
[21:45:49] _blizzy_: however, I'm not trying to render a template
[21:45:50] Radar: You meant to render, not return
[21:45:52] FCser: has joined #RubyOnRails
[21:45:56] Radar: Same on line 15
[21:45:57] helpa: Next question, please!
[21:46:08] _blizzy_: can't believe I didn't catch that, lol
[21:46:12] _blizzy_: thanks, Radar
[21:46:22] hnanon: I want to count the number of unpaid and underpaid status messages: @discrepancy_count = @dealer_commissions.count(:status {underpaid|unpaid})
[21:46:36] hnanon: That obviously doesn't work.
[21:46:57] tubbo: you still need a where()
[21:47:04] tubbo: and count doesn't take arguments iirc
[21:47:11] _blizzy_: Radar, even if I change them to 'render', I still get the same error
[21:47:22] SteenJobs: tubbo: aright. i???m gonna give up on the single login devise shpiel. but know that it???s truly painful. i can???t stand consciously being aware that i don???t know something.
[21:47:31] Radar: _blizzy_: Why do you have format .js and format.json?
[21:47:31] Etriaph: SteenJobs: Do not PM without asking first please.
[21:47:31] hnanon: tubbo: Can count be chained?
[21:47:41] tubbo: hnanon: no, it returns a number
[21:47:42] _blizzy_: Radar, which one do I need? the js one?
[21:47:48] _blizzy_: since i'm using remote => true?
[21:47:49] Radar: _blizzy_: I think only format.js is necessary
[21:47:57] tubbo: hnanon: you'd need to @dealer_commissions.where(conditions).count
[21:48:00] SteenJobs: Etriaph: word, we???re all friends here. just making sure your smoke went well. but aright, i take it back then.
[21:48:03] Radar: _blizzy_: You can see the format if you do puts params[:format]
[21:48:04] Spami: has joined #RubyOnRails
[21:48:08] powersurge: has joined #RubyOnRails
[21:48:15] hnanon: tubbo: I see...efforting
[21:48:15] tubbo: in your case, you need to check 'underpaid' OR 'unpaid' so you probably want to use an array there actually
[21:48:17] Radar: SteenJobs: It is Rule #12 :)
[21:48:26] powersurge: has left #RubyOnRails: ("WeeChat 0.4.3")
[21:48:30] tubbo: hnanon: that way the query generated will be WHERE IN ('unpaid', 'underpaid')
[21:48:35] Etriaph: ACTION wishes helpa wouldn't ignore him :(
[21:48:44] m0r0n: has joined #RubyOnRails
[21:48:45] SteenJobs: Radar: I know, but as others here have told me before, they???ve actually given me shit for asking before pming
[21:49:00] SteenJobs: like joking shit
[21:49:01] tubbo: that's completely backwards.
[21:49:15] SteenJobs: like ???this isn???t a classroom, don???t worry about asking me permission"
[21:49:19] SteenJobs: but i hear ya
[21:49:41] SteenJobs: i understand that it???s a huge imposition. i???ll refrain from such terrible behavior.
[21:49:45] Radar: Etriaph: Look deep in your heart to find that you have access to helpa.
[21:50:11] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:50:12] Radar: SteenJobs: Private messaging generally leads to private help, which isn't beneficial to the channel as a whole
[21:50:14] Etriaph: ACTION pets helpa
[21:50:30] Radar: If people PM me and ask for help, I tell them my rate up front and that if they ask in the channel they can get the help for free
[21:50:30] baweaver: ACTION bows head in shame
[21:50:35] Radar: baweaver: LOOK DEEPER.
[21:50:39] SteenJobs: Radar: right - but my message had nothing to do with help which is why i didn???t ask permission, was just checking up on his smoke :)
[21:50:41] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:51:01] IFrank00: has joined #RubyOnRails
[21:51:49] Radar: Danke for your help :)
[21:52:12] baweaver: Any time mate.
[21:52:29] Etriaph: Yes, Radar, thank you very much.
[21:53:08] wethu: has joined #RubyOnRails
[21:53:29] _blizzy_: Radar, it's weird. I'm still getting the exact same error. https://gist.github.com/NotBlizzard/5f07e92b9c5ef33aae4b
[21:53:35] jgpawletko: has joined #RubyOnRails
[21:53:46] _blizzy_: the format is JS, so I just respond to format for JS
[21:53:46] Radar: What is params[:format] in the request?
[21:53:47] SteenJobs: _blizzy_: post the error message?
[21:54:02] Radar: _blizzy_: render status: 200 will still try to render the template
[21:54:13] hnanon: tubbo: @discrepancy_count = @dealer_commissions.where(status: ['unpaid', 'underpaid']).coun
[21:54:25] hnanon: gives me 0 when I know some exist.
[21:54:46] alexclark: has joined #RubyOnRails
[21:55:00] momomomomo_: has joined #RubyOnRails
[21:55:02] hnanon: Ahh, typo.
[21:55:19] ciree: try doing a raw query
[21:55:31] asheinfeld: has joined #RubyOnRails
[21:55:37] _blizzy_: here's the error http://pastie.org/10224125
[21:55:41] ciree: select count(id) from dealer_commisions WHERE status IN('unpaid', 'underpaid')
[21:55:49] mrbubbles: has joined #RubyOnRails
[21:55:55] ciree: in the cli
[21:56:32] Radar: _blizzy_: [07:54:00] <Radar> _blizzy_: render status: 200 will still try to render the template
[21:56:42] _blizzy_: Radar, I removed that
[21:56:49] Radar: _blizzy_: Code?
[21:56:50] _blizzy_: it's just now format.js {}
[21:56:53] Radar: omsgdind[ogbdfg
[21:56:54] dionysus69: has joined #RubyOnRails
[21:57:05] _blizzy_: i'll post code
[21:57:09] Radar: _blizzy_: If you don't tell the controller to render anything, it will render the template!
[21:57:20] Radar: I am sure I said this four times already.
[21:57:24] _blizzy_: I feel slow. c:
[21:57:28] Radar: format.js { render json: { message: "OK" } }
[21:58:00] iamjarvo: has joined #RubyOnRails
[21:58:11] _blizzy_: thank you very much, Radar.
[21:58:43] iamjarvo: has joined #RubyOnRails
[21:59:26] iamjarvo: has joined #RubyOnRails
[21:59:37] Lytol: has joined #RubyOnRails
[21:59:57] hnanon: ciree: Trying to figure out how to execute sql in the console.
[22:00:34] rickmasta: has joined #RubyOnRails
[22:01:35] kiki_lamb: Hi. In the past I've used Devise with Cancan for authorization/rights management, but it looks like Cancan is a bit outdated (no updates to their git in a few years, the examples given are for rails 2.3). Is there a more modern replacement for Cancan that I can use alongside Devise?
[22:02:40] givanse: has joined #RubyOnRails
[22:04:25] x1337807x: has joined #RubyOnRails
[22:05:07] x1337807x: has joined #RubyOnRails
[22:05:31] mahamadp_: has joined #RubyOnRails
[22:05:41] SteenJobs: kiki_lamb: cancancan
[22:05:43] hnanon: ciree: showing 0 in the console too.
[22:05:56] hnanon: With your sql above.
[22:06:21] kiki_lamb: SteenJobs: cool, i'll look that up, thanks
[22:06:29] ciree: how many records are there? can you go through them and verify that there actually are unpaid records?
[22:07:02] wethu: has joined #RubyOnRails
[22:07:14] hnanon: Yes. Looking at them now.
[22:07:17] ciree: select * from dealer_comissions ORDER BY status DESC;
[22:07:21] hnanon: 26 records
[22:10:38] hnanon: ciree: So, it's case sensitive.
[22:10:40] AndroidLoverInSF: has joined #RubyOnRails
[22:10:48] hnanon: unpaid != Unpaid
[22:11:07] ciree: make it all lowercase ;)
[22:11:11] tubbo: has joined #RubyOnRails
[22:11:19] hnanon: Yeah. Thanks again.
[22:11:20] ciree: dont allow users to edit the field directly
[22:11:35] ciree: give them options, then validate the options they selected
[22:11:59] hnanon: I was saving status messages by capitalizing.
[22:12:52] pjammer: has joined #RubyOnRails
[22:15:05] Sigma00: yeah but what if they typo? UNPID
[22:16:07] hnanon: Users don't submit statuses.
[22:16:18] hnanon: They're updated based on some actions.
[22:18:40] rails967: has joined #RubyOnRails
[22:19:32] rails967: has left #RubyOnRails: ()
[22:20:02] drale2k: has joined #RubyOnRails
[22:20:22] kevdev: has joined #RubyOnRails
[22:20:28] kevdev: Hi there! Are there any performance degradation issues from using JS.ERB files over calling AJAX using a separate JS file loaded by application.js? or is it essentially the same?
[22:21:35] Lightsword: has joined #RubyOnRails
[22:22:44] zendrix: has joined #RubyOnRails
[22:22:58] alexwhitman: has joined #RubyOnRails
[22:23:47] jenrzzz: has joined #RubyOnRails
[22:23:49] jcm: has joined #RubyOnRails
[22:23:56] renechz: has joined #RubyOnRails
[22:25:08] ankhers: has joined #RubyOnRails
[22:25:26] alexclark: has joined #RubyOnRails
[22:25:39] c355E3B: has joined #RubyOnRails
[22:25:45] n008f4g_: has joined #RubyOnRails
[22:26:01] AlHafoudh: has joined #RubyOnRails
[22:26:30] martinbmadsen: has joined #RubyOnRails
[22:26:32] Radar: kevdev: Show us in code what you mean?
[22:26:54] flori: has joined #RubyOnRails
[22:27:10] DoubleMalt: has joined #RubyOnRails
[22:27:19] kinduff: has joined #RubyOnRails
[22:27:24] digifiv5e: has joined #RubyOnRails
[22:28:11] mberk: has joined #RubyOnRails
[22:28:58] pepelui: has joined #RubyOnRails
[22:28:59] kevdev: Radar: not really code, more so when you make a js request to a controller, it also calls ACTION.JS.ERB, my question: is rendering that js.erb template slower than just using regular js in a separate JS file?
[22:29:02] eyck: has joined #RubyOnRails
[22:29:49] pjammer: has joined #RubyOnRails
[22:29:50] workmad3: has joined #RubyOnRails
[22:30:46] pulgolino: has joined #RubyOnRails
[22:31:26] fortunate: has joined #RubyOnRails
[22:31:44] duderonomy: has joined #RubyOnRails
[22:32:24] momomomomo: has joined #RubyOnRails
[22:37:48] ciree: kevdev: yes
[22:37:54] iamjarvo: has joined #RubyOnRails
[22:38:37] PaulePanter: has joined #RubyOnRails
[22:38:38] iamjarvo: has joined #RubyOnRails
[22:39:31] arBmind1: has joined #RubyOnRails
[22:39:31] yfeldblum: has joined #RubyOnRails
[22:40:34] Radar: kevdev: Yes because it has to make a request
[22:41:26] kevdev: -,- never knew that, ugh, been using .js.erb files since 2005! thanks guys ciree && Radar
[22:43:11] skinny_much: has joined #RubyOnRails
[22:44:01] maxshelley: has joined #RubyOnRails
[22:44:10] repinel: has joined #RubyOnRails
[22:44:14] edwinrozario: has joined #RubyOnRails
[22:44:15] elaptics: has joined #RubyOnRails
[22:45:02] x1337807x: has joined #RubyOnRails
[22:45:15] doodlehaus: has joined #RubyOnRails
[22:45:46] x1337807x: has joined #RubyOnRails
[22:45:58] renegadeandy: has joined #RubyOnRails
[22:47:37] iamjarvo: has joined #RubyOnRails
[22:50:08] eggoez: has joined #RubyOnRails
[22:51:37] baweaver: has joined #RubyOnRails
[22:52:06] thebatu1: has joined #RubyOnRails
[22:52:08] blackmesa: has joined #RubyOnRails
[22:52:10] platosha: has joined #RubyOnRails
[22:54:17] Ropeney: has joined #RubyOnRails
[22:56:33] shock_one: has joined #RubyOnRails
[22:56:34] porkqpain: has joined #RubyOnRails
[22:58:49] surrealanalysis: has joined #RubyOnRails
[22:58:51] twilling: has joined #RubyOnRails
[22:59:14] jwaldrip__: has joined #RubyOnRails
[23:01:32] moeabdol: has joined #RubyOnRails
[23:01:35] theBestNunu: has joined #RubyOnRails
[23:02:05] nibbo: has joined #RubyOnRails
[23:02:16] dexter91x: has joined #RubyOnRails
[23:02:28] goodcodeguy: has joined #RubyOnRails
[23:02:56] sonofdirt: has joined #RubyOnRails
[23:04:34] renegadeandy: Hi Everyone. I have a form for an 'event'. Events can have many categories. I have a create, edit and show views for the Event model. My create controller and form works well - the has_many through association is created. However when I go to the edit page....the checkboxes for each of the subcategories are not ticked. Can anybody suggest what I am missing in the edit page. Here is the code https://gist.github.com/renegad
[23:06:12] bricker: has joined #RubyOnRails
[23:06:21] ciree: renegad hasn't created any public gists yet.
[23:06:27] mark[oz]: has joined #RubyOnRails
[23:07:15] doodlehaus: has joined #RubyOnRails
[23:09:00] rhizome: renegadeandy: watch the 'update with checkboxes' railscast
[23:10:28] renegadeandy: Hi Everyone. I have a form for an 'event'. Events can have many categories. I have a create, edit and show views for the Event model. My create controller and form works well - the has_many through association is created. However when I go to the edit page....the checkboxes for each of the subcategories are not ticked. Can anybody suggest what I am missing in the edit page. Here is the code https://gist.github.com/renegad
[23:10:34] theBestNunu: ACTION yawns
[23:14:28] charliesome: has joined #RubyOnRails
[23:15:04] renegadeandy: rhizome: aha - ok watching now :)
[23:17:14] Scriptonaut: do any of you guys find yourself wishing ruby had pattern matching
[23:17:18] surrealanalysis: has joined #RubyOnRails
[23:17:22] Scriptonaut: or is there and I just haven't found it yet
[23:17:46] zendrix: has joined #RubyOnRails
[23:17:56] Sylario: has joined #RubyOnRails
[23:18:23] thews: has joined #RubyOnRails
[23:18:37] Scriptonaut: pattern matching like you find in haskell, ml, etc
[23:18:48] rhizome: what if i don't know those languages?
[23:19:03] duderonomy: has joined #RubyOnRails
[23:19:29] Scriptonaut: Hmm, they're in other ones too, just not ones I've used afaik. Ruby seems to embrace the functional paradigm to a degree so I was hoping there might be something like it
[23:20:10] blunckr: has left #RubyOnRails: ()
[23:20:15] Scriptonaut: pattern matching in ruby would be like: def create_customer((first_name, last_name = full_name.split(' '))....
[23:21:38] chintanparikh: has joined #RubyOnRails
[23:22:33] rhizome: http://stackoverflow.com/questions/522720/passing-a-method-as-a-parameter-in-ruby
[23:24:54] jenrzzz: has joined #RubyOnRails
[23:27:57] hnanon: I created a folder called csv in the assets folder and upload some csv files.
[23:28:19] hnanon: How can I access those files?
[23:28:49] momomomomo: has joined #RubyOnRails
[23:29:52] Radar: hnanon: Why not put it in public/csv?
[23:31:02] hnanon: Radar: I forgot about that. Adding them there now.
[23:31:41] rickmasta: has joined #RubyOnRails
[23:32:34] mahamadpiazza: has joined #RubyOnRails
[23:34:05] x1337807x: has joined #RubyOnRails
[23:34:49] x1337807x: has joined #RubyOnRails
[23:35:40] gambl0re: has joined #RubyOnRails
[23:35:41] x1337807x: has joined #RubyOnRails
[23:35:53] hnanon: And I access the files via .../public/csv/file.csv?
[23:36:12] Radar: ./csv/file.csv
[23:36:15] Radar: without the dot
[23:36:37] n80: has joined #RubyOnRails
[23:37:35] hnanon: Thank you.
[23:37:45] doodlehaus: has joined #RubyOnRails
[23:40:57] doodlehaus: has joined #RubyOnRails
[23:42:05] hahuang65: has joined #RubyOnRails
[23:42:23] hahuang65: has joined #RubyOnRails
[23:43:01] mrbubbles: has joined #RubyOnRails
[23:45:53] MEATCHICKEN: has joined #RubyOnRails
[23:46:18] MEATCHICKEN: browser tab ram usage is spiking with my rails app - I suspect it has to do with turbolinks/badly written JS
[23:46:24] MEATCHICKEN: Anyone have tips with this?
[23:47:12] Radar: meatchicken: 1) Disable turbolinks 2) ??? 3) PROFIT
[23:47:30] baweaver: has joined #RubyOnRails
[23:47:48] MEATCHICKEN: Radar: That might be the simplest lol
[23:50:37] renegadeandy: rhizome: I watched it - and i am actually doing pretty much that!
[23:50:59] Lightsword: has joined #RubyOnRails
[23:51:12] renegadeandy: The problem is - the edit form I build....does not check the selected checkboxes that have been stored on the model record
[23:51:15] DCio: has joined #RubyOnRails
[23:51:26] renegadeandy: rhizome: doing that is not covered in that railscasts
[23:51:39] DCio: is it default behavior of form_for to turn all integer values being posted into strings?
[23:51:50] DCio: cus its really annoying
[23:52:03] Radar: DCio: It's not form_for, it's how Rails handle parameters.
[23:52:16] Radar: DCio: And how does Rails know that 1_this_is_a_thing is supposed to be a string or an integer
[23:52:25] Radar: DCio: #dealwithit
[23:52:49] DCio: im passing in just 1 as the value though :/
[23:52:57] Radar: DCio: .to_i
[23:52:59] helpa: Next question, please!
[23:53:16] DCio: yeah but then shit will hit the fan if someone is fucking with post requests
[23:53:33] DCio: if someone is like hmm lets change that 1 to "asdfasdf" then 500 internal server error gg
[23:53:56] asheinfeld: has joined #RubyOnRails
[23:54:12] goleldar: has joined #RubyOnRails
[23:54:17] DCio: nvm i could just write my own validator
[23:54:36] hnanon: I'm getting an error when running migrations: https://gist.github.com/anonymous/872c3497e2e5e3d579cd
[23:54:58] goleldar: anyone know with travis ci if you can have travis ci return back a status of 'success' if you use 'ci-skip' in your commit message?
[23:55:11] hnanon: The relation does exist, though.
[23:55:28] renegadeandy: Hi Everyone. I have a form for an 'event'. Events can have many categories. I have a create, edit and show views for the Event model. My create controller and form works well - the has_many through association is created. However when I go to the edit page....the checkboxes for each of the subcategories are not ticked. Can anybody suggest what I am missing in the edit page. Here is the code https://gist.github.com/renegad
[23:55:45] Radar: DCio: validates_numericality_of :field
[23:55:58] rhizome: renegadeandy: yes it is
[23:56:00] Radar: hnanon: proof plzkthx
[23:56:15] renegadeandy: rhizome: is it? Where! I watched it 2 times now
[23:56:34] renegadeandy: rhizome: it doesnt because the form only shows incomplete tasks,,,,
[23:56:37] Radar: renegadeandy: Gist link was cut off.
[23:56:49] rhizome: oh, well then there's another one.
[23:56:55] renegadeandy: Radar: sorry : https://gist.github.com/renegadeandy/c4751a2c9a9a79c2b555
[23:57:34] rhizome: renegadeandy: http://railscasts.com/episodes/17-habtm-checkboxes-revised you'll have to update syntax for modern rails
[23:57:59] renegadeandy: rhizome: i havent subscibed and i cannot therefore watch that
[23:58:19] rhizome: oh is it pro?
[23:58:33] renegadeandy: rhizome: yeah which is a shame - i found that earlier and was trying to watch it before i asked
[23:58:45] bricker: time to release those to the public
[23:58:59] rhizome: well, you can pay $9 once for access for the foreseeable future
[23:59:19] hnanon: radar: https://gist.github.com/anonymous/d42d9d2f54c1cc79d6a6
[23:59:22] bricker: that's true, but the videos are very outdated. Maybe still worth 9 bucks
[23:59:34] rhizome: nah, theyu're still good
[23:59:37] Radar: hnanon: That is not proof.
[23:59:48] Radar: hnanon: That is only proof that you have models. That is not proof that a table exists in the DB called "users"