« Back to channel list

#RubyOnRails - 15 October 2015

« Back 1 day Forward 1 day »
[00:00:12] ArTiSTiX: has joined #RubyOnRails
[00:00:13] diegobiavati: has joined #RubyOnRails
[00:00:46] llakey: has joined #RubyOnRails
[00:01:14] WhereIsMySpoon: has joined #RubyOnRails
[00:01:44] shtirlic: has joined #RubyOnRails
[00:01:53] seank_: has joined #RubyOnRails
[00:07:00] Shoutsid: has joined #RubyOnRails
[00:07:25] bonhoeffer: has joined #RubyOnRails
[00:07:29] ValicekB_: has joined #RubyOnRails
[00:07:31] inoter: has joined #RubyOnRails
[00:09:23] quazimodo: what are the feels on code climate?
[00:09:51] duderonomy: has joined #RubyOnRails
[00:10:25] xcesariox: has joined #RubyOnRails
[00:10:54] qejk: has joined #RubyOnRails
[00:11:25] Cervajz: has joined #RubyOnRails
[00:11:37] yfeldblum: has joined #RubyOnRails
[00:13:05] rickmasta: has joined #RubyOnRails
[00:14:43] maximski: has joined #RubyOnRails
[00:15:03] maximski: I want to build a REST api for my project which has "exercises" and "categories"
[00:15:19] maximski: exercises have many categories and categories have many exercises
[00:15:41] maximski: should i include categories in the json representation?
[00:15:58] maximski: of the exercises i mean?
[00:18:01] maximski: if i think that people will use the categories of the exercises i can save them another request
[00:18:18] maximski: but i will have more initial load on the exercise requests
[00:19:30] bonhoeffer: has joined #RubyOnRails
[00:19:37] quazimodo: maximski: maybe
[00:20:04] FailBit: any postgres guys here? how can I run array_remove on a where?
[00:21:03] manfrin: has joined #RubyOnRails
[00:21:41] quazimodo: maximski: first of all what are you using to make your api?
[00:21:58] quazimodo: rails controllers, rocket pants or grape, for example?
[00:22:39] quazimodo: so you have an many to many relationship, obviously via some sort of join
[00:22:47] ProLoser: has joined #RubyOnRails
[00:22:57] wcalderipe: has joined #RubyOnRails
[00:23:15] maximski: and controller
[00:23:29] seank_: has joined #RubyOnRails
[00:23:31] dstarh: has joined #RubyOnRails
[00:23:36] quazimodo: it really does depend
[00:23:47] quazimodo: you *can* put it in there and there's nothing to say you shouldn't
[00:23:52] quazimodo: it comes down to usage mostly
[00:23:56] quazimodo: alternatively
[00:24:01] quazimodo: you can get users to pass a flag
[00:24:07] GnuYawk: has joined #RubyOnRails
[00:24:16] quazimodo: if the flag's there, include the categories, otherwise don't
[00:24:16] maximski: like a param?
[00:24:28] nizmow: has joined #RubyOnRails
[00:24:29] quazimodo: i really recommend that you read about JSON Api format
[00:24:39] quazimodo: http://jsonapi.org/
[00:24:50] quazimodo: that's the specification, kinda boring. I'm sure you can google up some tutorials
[00:25:05] quazimodo: also, I really recommend that you use something like grape & grape-entities
[00:25:16] yfeldblum: has joined #RubyOnRails
[00:25:27] quazimodo: it's far far better in my experience than controllers with jbuilder, although you do have to learn how to use it a bit
[00:25:38] ericjphillips: has joined #RubyOnRails
[00:26:51] nizmow: has joined #RubyOnRails
[00:27:13] maximski: y it's not that i dont know how to do it
[00:27:16] maximski: i am just wondering
[00:27:25] mitchless: has joined #RubyOnRails
[00:27:25] maximski: if there is a best practice
[00:27:25] maximski: or some strong aargument
[00:27:27] ElSif: has joined #RubyOnRails
[00:27:34] maximski: to do it this or another way
[00:28:21] x-light: has joined #RubyOnRails
[00:28:31] toretore: has joined #RubyOnRails
[00:28:48] malcolmva: has joined #RubyOnRails
[00:29:53] nertzy2: has joined #RubyOnRails
[00:30:02] smathy: maximski, !enternotspace - for our sanity, please.
[00:30:02] helpa: maximski: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[00:30:55] quazimodo: maximski: use case :)
[00:31:25] rodfersou: has joined #RubyOnRails
[00:31:26] quazimodo: maximski: if it's cheap to include a few tags / categories and has utility then why not. If it can be costly or irrelevant, then maybe not
[00:31:30] darrencauthon: has joined #RubyOnRails
[00:31:32] quazimodo: maybe just needs a param to include
[00:31:40] quazimodo: premature optimisation sucks
[00:31:45] workmad3: has joined #RubyOnRails
[00:33:24] brahms: has joined #RubyOnRails
[00:33:46] bonhoeffer: has joined #RubyOnRails
[00:35:17] maximski: has joined #RubyOnRails
[00:35:22] maximski: sry had a stupid dc
[00:35:27] maximski: was there an answer?
[00:35:30] lacuna: has joined #RubyOnRails
[00:37:19] northfurr: has joined #RubyOnRails
[00:40:03] rubyonrails380: has joined #RubyOnRails
[00:40:19] hephaestus_rg: has joined #RubyOnRails
[00:42:06] quazimodo: has joined #RubyOnRails
[00:43:39] riotjones: has joined #RubyOnRails
[00:45:06] hfp: I'm trying to remove a comma that's between two digits. I have `'2,899.00'.gsub(/\d(,)\d/, '')` but instead of returning 2899.00 it returns 99.00. How can I remove just the comma? I need to make sure it's between digits because I can also have 'foo, bar' as input, in which case I want to keep the comma
[00:46:07] weltzooo: has joined #RubyOnRails
[00:46:10] rgtk_: has joined #RubyOnRails
[00:48:08] pydave6367: has joined #RubyOnRails
[00:48:22] smathy: hfp, gsub /(?<=\d),(?=\d)/, ''
[00:49:14] twilling: has joined #RubyOnRails
[00:49:55] Radar: hfp: .gsub(',', '')
[00:50:00] twilling: Can anyone point me towards a reputable open-source rails app that uses service objects (PORO not Virtus-backed)?
[00:50:12] Radar: hfp: Oh, because you also have foo, bar as input and that makes sense?
[00:50:19] Radar: What kind of field takes a price and string?
[00:51:37] chopin: has joined #RubyOnRails
[00:52:38] bonhoeffer: has joined #RubyOnRails
[00:54:46] dopamean_: has joined #RubyOnRails
[00:55:07] dstarh: has joined #RubyOnRails
[00:55:27] Aeyrix: As hard as I try, I cannot think of a viable usecase for taking both a price and a string.
[00:57:21] chopin: has joined #RubyOnRails
[00:58:54] SteenJobs: has joined #RubyOnRails
[00:59:16] sankaber: has joined #RubyOnRails
[01:00:20] nyaa: has joined #RubyOnRails
[01:02:00] havenwood: Requisite non-regexp solution >.>: <<(?????).each_char.each_cons(2).reject { |l, r| l == ',' && r =~ /\d/ }.map(&:first).join
[01:03:05] rails897: has joined #RubyOnRails
[01:06:35] bruno-: has joined #RubyOnRails
[01:07:35] stardiviner: has joined #RubyOnRails
[01:07:39] Radar: why is there an emo... *stops asking*
[01:07:44] unreal_: has joined #RubyOnRails
[01:08:57] sankaber: has joined #RubyOnRails
[01:12:34] northfurr: has joined #RubyOnRails
[01:14:48] bmurt: has joined #RubyOnRails
[01:17:37] lacuna: has joined #RubyOnRails
[01:21:18] armyriad: has joined #RubyOnRails
[01:21:50] diegoviola: has joined #RubyOnRails
[01:23:48] shmilan: has joined #RubyOnRails
[01:24:27] johnflux: has joined #RubyOnRails
[01:26:34] bonhoeffer: has joined #RubyOnRails
[01:27:23] draig: has joined #RubyOnRails
[01:27:50] draig: evening all
[01:28:18] inoter: has joined #RubyOnRails
[01:30:59] Guest66207: has joined #RubyOnRails
[01:32:09] workmad3: has joined #RubyOnRails
[01:32:53] EminenceHC: has joined #RubyOnRails
[01:33:28] JohnHirbour: has joined #RubyOnRails
[01:33:50] stardiviner: has joined #RubyOnRails
[01:35:02] rickmasta: has joined #RubyOnRails
[01:35:47] l_tonz: has joined #RubyOnRails
[01:36:36] hfp: Radar: a CSV file filter
[01:37:07] hfp: Aeyrix: ^
[01:40:27] lacuna: has joined #RubyOnRails
[01:40:52] IFrank00: has joined #RubyOnRails
[01:40:54] willardg: has joined #RubyOnRails
[01:42:01] bobbobbins: has joined #RubyOnRails
[01:42:48] bobbobbins: Hey, I have a bunch of content in a db that gets served up for static pages, but I want to allow users to put in a tag that will render a partial in its place...whats the best way to do the find an replace for something like that?
[01:43:02] jenrzzz_: has joined #RubyOnRails
[01:44:03] Maletor: has joined #RubyOnRails
[01:44:26] riotjones: has joined #RubyOnRails
[01:47:52] s2013: has joined #RubyOnRails
[01:48:05] htmldrum: has joined #RubyOnRails
[01:48:39] JohnHirbour: has joined #RubyOnRails
[01:50:43] toretore: has joined #RubyOnRails
[01:52:14] bendangelo: has joined #RubyOnRails
[01:53:24] Cervajz: has joined #RubyOnRails
[01:54:06] johnflux: has joined #RubyOnRails
[01:55:58] lacuna: has joined #RubyOnRails
[01:56:07] paolodoors: has joined #RubyOnRails
[01:56:19] arup_r: has joined #RubyOnRails
[01:57:07] rromanchuk: has joined #RubyOnRails
[01:58:14] TheNet: has joined #RubyOnRails
[01:59:00] siddart: has joined #RubyOnRails
[02:00:34] lukekhamilton: has joined #RubyOnRails
[02:00:42] quazimodo: has joined #RubyOnRails
[02:01:24] l_tonz: has joined #RubyOnRails
[02:01:40] _wldcordeiro: has joined #RubyOnRails
[02:01:45] l_tonz: has joined #RubyOnRails
[02:03:05] _wldcordeiro: has joined #RubyOnRails
[02:03:11] chills42: has joined #RubyOnRails
[02:03:57] siaW: has joined #RubyOnRails
[02:05:08] JohnHirbour: has joined #RubyOnRails
[02:06:30] ProLoser: has joined #RubyOnRails
[02:09:35] krz: has joined #RubyOnRails
[02:10:24] chopin: has joined #RubyOnRails
[02:11:23] inoter: has joined #RubyOnRails
[02:11:47] bonhoeffer: has joined #RubyOnRails
[02:13:35] jenrzzz: has joined #RubyOnRails
[02:17:14] inoter: has joined #RubyOnRails
[02:20:34] Lightsword: has joined #RubyOnRails
[02:22:24] Shoutsid: has joined #RubyOnRails
[02:23:48] seank_: has joined #RubyOnRails
[02:26:06] Jasaka|NA: has joined #RubyOnRails
[02:26:32] sdwrage: has joined #RubyOnRails
[02:26:55] johnflux: has joined #RubyOnRails
[02:27:21] hephaestus_rg: has joined #RubyOnRails
[02:27:46] baweaver: has joined #RubyOnRails
[02:32:48] workmad3: has joined #RubyOnRails
[02:35:49] fedexo: has joined #RubyOnRails
[02:38:28] codesoda: has joined #RubyOnRails
[02:38:39] l_tonz: has joined #RubyOnRails
[02:38:57] rakm: has joined #RubyOnRails
[02:41:53] mezcan: has joined #RubyOnRails
[02:43:27] Scripore: has joined #RubyOnRails
[02:44:06] codesoda: has joined #RubyOnRails
[02:44:36] twilling: has joined #RubyOnRails
[02:45:00] l_tonz: has joined #RubyOnRails
[02:45:02] bitsweat: has joined #RubyOnRails
[02:45:03] diego3: has joined #RubyOnRails
[02:45:13] diego3: has joined #RubyOnRails
[02:45:21] draig: has joined #RubyOnRails
[02:49:14] johnflux: has joined #RubyOnRails
[02:50:37] PhantomSpank: has joined #RubyOnRails
[02:50:44] darrencauthon: has joined #RubyOnRails
[02:50:57] duderonomy: has joined #RubyOnRails
[02:54:31] octophore2: has joined #RubyOnRails
[02:55:10] johnflux: has joined #RubyOnRails
[02:58:04] hfp: When I send a file via a form POST, the URL in the browser changes for an ugly one with the xss token, the utf8 checkmark etc. I remember reading it's possible to post a form and still have a pretty URL without showing all the query's params but I can't remember how to do it. Any pointers?
[02:58:24] roshanavand: has joined #RubyOnRails
[02:58:31] Radar: hfp: !ncnh
[02:58:31] helpa: hfp: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[03:00:53] johnflux: has joined #RubyOnRails
[03:00:53] johnflux: has joined #RubyOnRails
[03:01:22] mrtomme: has joined #RubyOnRails
[03:01:51] hfp: Code: https://gist.github.com/Coaxial/120bf994c389bf90f695
[03:02:02] hfp: This form messses the URL
[03:03:06] Altonymous: has joined #RubyOnRails
[03:03:09] arup_r: becuase you did, :get, that made your url ugly hfp
[03:03:49] arup_r: you have to do post/patch depending on your case, but not definitely get
[03:04:05] Altonymous: Anyone know how to dynamically change the table that a model pulls from? Tried using a scope to set the .from(???) and that works locally.. but with caching turned on for models it doesn???t work.. even though I???m using a lambda method. Seems to build the table name out correctly but the scope isn???t being applied.
[03:05:23] hfp: arup_r: thanks
[03:06:06] Radar: hfp: the form is not a post. It's a GET>
[03:06:13] Radar: hfp: You're also not sending a file.
[03:06:40] nyaa: has joined #RubyOnRails
[03:06:52] rhizome: Altonymous: hard to tell what you're doing, but it sounds like you might consider alternative solutions
[03:09:19] michaeldeol: has joined #RubyOnRails
[03:10:07] mehwork: i'm trying to use 'pry-rails' in a project that doesn't specify it in Gemfile. So i just 'gem install pry-rails' to my dev's ruby, but when i type 'rails console' it's still using irb, not pry. Any idea why?
[03:10:35] Radar: mehwork: Because Rails is restricting the gems used for the application to what's specified in the Gemfile.lock.
[03:10:39] Radar: mehwork: Bundler is invoked when a Rails console starts.
[03:10:50] Radar: mehwork: Why can't you add the gem to the Gemfile? Is it locked away in a secret cupboard somewhere?
[03:11:09] mehwork: Radar: i don't want to accidently commit it
[03:11:13] Radar: mehwork: Then... don't?
[03:11:15] Radar: git add -p ?
[03:11:30] Radar: It's a good time you upgraded from "git add ."
[03:11:54] Aeyrix: git add -A
[03:11:58] Aeyrix: git commit -am "dongs"
[03:12:02] Aeyrix: git push heroku master
[03:12:14] Radar: Wherein Aeyrix demonstrates why he can't be trusted near computers.
[03:12:17] Aeyrix: "Oh fuck I committed my secrets.yml"
[03:13:34] Altonymous: rhizome: locally everything works fine. It???s not until caching that we start to see an issue.. so I???m trying to figure out how to address what???s getting cached that???s making it not work.
[03:13:46] Radar: Altonymous: Typically a model is used only for a single table.
[03:14:05] Altonymous: Radar: I???m aware.
[03:14:48] braincrash: has joined #RubyOnRails
[03:15:46] thejamespinto: has joined #RubyOnRails
[03:15:48] dgynn: has joined #RubyOnRails
[03:19:15] IFrank00: has joined #RubyOnRails
[03:21:20] hephaestus_rg: has joined #RubyOnRails
[03:21:21] bbrowning_away: has joined #RubyOnRails
[03:22:12] Zackio: has joined #RubyOnRails
[03:22:20] ChanServ: +o spastorino
[03:23:16] jun: has joined #RubyOnRails
[03:23:51] thejamespinto: hey guys, I'm running Rails with RSpec, but I have some custom commands, it would be really really nice if I could know exactly which spec file path I'm currently working on if you guys could please help https://gist.github.com/thejamespinto/ae63b7a56d761c1cbaaa
[03:24:42] Radar: example.metadata would probably contain if it you were sticking with regular RSpec
[03:24:51] Radar: but since you're writing your own DSL, I'm hands-off on this one.
[03:25:10] iateadonut: has joined #RubyOnRails
[03:25:11] thejamespinto: Radar: I just want to know the current spec file being loaded, that's all
[03:25:35] thejamespinto: oh sorry, didn't read
[03:25:42] VeryBewitching: thejamespinto: __FILE__
[03:25:45] thejamespinto: let me check if I have access to it
[03:26:03] thejamespinto: VeryBewitching: yes, that's what I do not what to do
[03:27:38] thejamespinto: Radar: I need to know where example.metadata is set, at least now I have somewhere to look, thanks <3
[03:28:02] VeryBewitching: Oh, nvm, I misunderstood your question.
[03:28:15] Siyo: has joined #RubyOnRails
[03:28:15] Siyo: has joined #RubyOnRails
[03:29:20] stannard: has joined #RubyOnRails
[03:31:44] pawnbox: has joined #RubyOnRails
[03:33:39] workmad3: has joined #RubyOnRails
[03:34:08] VeryBewitching: thejamespinto: Maybe this section of the manual will help you https://www.relishapp.com/rspec/rspec-core/v/3-3/docs/metadata
[03:34:27] thejamespinto: Radar: thanks expect(example.metadata[:file_path]).to eq 1
[03:34:33] Cervajz: has joined #RubyOnRails
[03:34:52] thejamespinto: VeryBewitching: I don't debug, I just expect the code to work :D
[03:35:02] thejamespinto: thanks for fetching the manual though :)
[03:36:00] banister: has joined #RubyOnRails
[03:36:17] Altonymous: Radar & rhizome: figured it out.. for some reason even though the scope is being applied.. Rails/ActiveRecord feels the need to check for the table defined in the model???s existence before running the query.. the reason it worked locally was because I had a view that was named what the model expected. I created a view with the same name and just had it SELECT 1; After that it all works.
[03:36:52] Altonymous: Radar & rhizome: So lesson here is figure out why Rails/ActiveRecord is doing an existence check before running the query and disable it..
[03:37:41] avemestr: has joined #RubyOnRails
[03:38:05] Altonymous: Radar & rhizome: the funny part is that my code does an existence check on the table I want to query??? so that???s being done in the model by me.. rails/activerecord is doing it as well just on the wrong table.
[03:39:02] arup_r: Share has_many links. I have accept_nested_attributes :links in the Share model. This helps to save childs with Parent. Is there any reverse way? I meant update parent while updating child also.. ?
[03:39:46] arup_r: I can't put accept_nested_attributes in belongs_to model as per doc.
[03:40:22] Altonymous: Radar or rhizome: Any idea how I can disable a table existence check when doing a select(???).from(???).where(???).order(???) call?
[03:41:55] Radar: Nope, sorry.
[03:45:14] riotjones: has joined #RubyOnRails
[03:46:54] ror15: has joined #RubyOnRails
[03:48:18] deception1: has joined #RubyOnRails
[03:49:58] arup_r: possible /
[03:55:12] ProLoser: has joined #RubyOnRails
[03:56:49] stardiviner: has joined #RubyOnRails
[03:57:11] zpe: has joined #RubyOnRails
[03:59:12] diegoviola: has joined #RubyOnRails
[04:01:25] thejamespinto: Radar: I need to get the file name still at example_group level :(
[04:01:59] thejamespinto: and I'm passing blocks directly thru layers of context, so they are kinda hard to grab =/
[04:02:18] quazimodo: has joined #RubyOnRails
[04:02:51] thejamespinto: does anybody know where I can go to override a call to `context` or `describe` in RSpec?
[04:03:19] guardianL: has joined #RubyOnRails
[04:03:39] guardianL: has left #RubyOnRails: ()
[04:04:10] thejamespinto: override! eureka :D
[04:05:04] decaff: has joined #RubyOnRails
[04:05:50] decaff: is there a way to force rails to use a consistent pluralization scheme throughout the app? I'm having a difficult time with it trying to convert between User Users user and users
[04:06:18] decaff: there is only one model it should only have one name. instead this is causing me headaches with trying to debug
[04:08:47] thejamespinto: yay! puts b.source_location
[04:09:28] arup_r: decaff: Rails never create class name of a model Users, it will be always User
[04:09:47] arup_r: but the table name of the corresponding model is plural "users"
[04:09:47] thejamespinto: decaff: I don't have your answer, just a hint, check the inflections file
[04:09:55] arup_r: it is never `user`
[04:10:16] htmldrum: has joined #RubyOnRails
[04:10:36] arup_r: decaff: don't change this convention .. plzz.. :(
[04:10:56] thejamespinto: decaff: tell us exactly the problem you need solved, that's often easier to give you what you want that way
[04:11:55] Jon30: has joined #RubyOnRails
[04:12:54] nyaa: has joined #RubyOnRails
[04:12:57] Jon30: hey guys, stuck here, rails 4.2.3, ruby 2.2, when I am running assets precompile in production I am getting "JSON::GeneratorError: source sequence is illegal/malformed utf-8" but things work fine in development. Production and Dev are both Ubuntu
[04:15:31] fedexo: has joined #RubyOnRails
[04:16:37] sevenseacat: has joined #RubyOnRails
[04:17:38] decaff: arup_r this is an absolutely terrible convention. why would you want to reduce consistency and introduce "gotcha" bugs all over your program
[04:17:58] konsolebox: has joined #RubyOnRails
[04:18:05] stardiviner: has joined #RubyOnRails
[04:18:25] arup_r: I don't know what you meant..
[04:18:29] decaff: in particular there is a "has_many" relationship connected to my User model, so I am using the devise current_user.tweets, but it is trying to filter by "user_id" instead of "users_id" like it should be
[04:19:00] arup_r: well . this is also an convention, doc mentioned about it
[04:20:42] dikaio: has joined #RubyOnRails
[04:23:25] arup_r: decaff: Post has_many :comments and Comment belongs_to :post.. Now Post.find(12).comments, it guess the model name from the assocation name, and it is Comment model, and the source class name it takes to find FK, which is post_id
[04:23:29] chopin: has joined #RubyOnRails
[04:24:22] arup_r: But yes, you can customize it with other options. Rails default convention goes this way.
[04:24:44] decaff: guessing is generally a bad thing in programming in my opinion. primarily because when you rely on it to guess it will inevitably do it wrong sometimes and you are stuck with the error
[04:25:18] braincra-: has joined #RubyOnRails
[04:25:39] arup_r: decaff: users_id doesn't make a good sense when it holds a single user id value. and user_id makes proper sense.
[04:26:11] decaff: in plain english yes, but I'm not writing plain english I'm writing Ruby
[04:26:27] arup_r: Based on what convention you are thinking to have a FK with table name preceded.
[04:26:40] decaff: I want a program that works over one that its semantic and consistent
[04:26:45] arup_r: decaff: Those are really very standard convention.
[04:26:56] arup_r: It is CONSISTENT.
[04:27:06] arup_r: it just don't work randomly
[04:27:10] decaff: well ideally it would be just a single name "Users" that is not downcased or singluarized ever
[04:27:12] arup_r: it is always same
[04:27:15] decaff: I know it doesn't work randomly
[04:27:22] decaff: the problem is when it doesn't work
[04:27:35] decaff: when it expects the wrong thing
[04:27:59] arup_r: it doesn't work, because you didn't realize Rails convention.
[04:28:16] arup_r: and you gave the column name while wrote migration as users_id
[04:28:16] decaff: I do realize. it is the Devise library that does not realize
[04:28:24] decaff: I did not do that.
[04:28:25] arup_r: Show your migrations...
[04:28:41] arup_r: then why are you expecting it to be `users_id` ?
[04:29:06] decaff: devise is expecting it to be "user_id" I need it to expect "users_id"
[04:29:21] arup_r: anyway, I will stop now on this topic, I am quiet well on this.
[04:29:43] arup_r: Because devise followed Rails convention too..
[04:29:46] sevenseacat: decaff: if you want to buck Rails conventions for the sake of it, you're gonna be in a world of pain
[04:29:59] seank_: has joined #RubyOnRails
[04:30:00] decaff: too late for that
[04:30:18] sevenseacat: decaff: so fix it :)
[04:30:23] sevenseacat: go back to conventions
[04:30:24] decaff: yeah but how?
[04:30:28] thejamespinto: has joined #RubyOnRails
[04:30:31] arup_r: decaff: another migration
[04:30:33] sevenseacat: rename whatever column is users_id
[04:30:34] decaff: I'm already using conventions
[04:30:35] arup_r: rename_column
[04:30:35] sevenseacat: to be user_id
[04:30:37] sevenseacat: no you're not
[04:30:41] darkxploit: has joined #RubyOnRails
[04:30:49] decaff: users_id, is that not convention?
[04:31:14] arup_r: That's why I said, you misunderstood this art :D
[04:31:16] sevenseacat: it has the ID of a single user, no? so user_id
[04:31:50] arup_r: decaff: just rename the column., you will be all good
[04:32:11] decaff: okay thanks
[04:33:34] fedexo: has joined #RubyOnRails
[04:34:23] workmad3: has joined #RubyOnRails
[04:34:23] arup_r: sevenseacat: when we have { user: { address_details: {}, personal_info: { ..} } } . Can we require till deep key ?
[04:34:37] arup_r: or we only allowed to require toplevel key only ?
[04:35:07] Shoutsid: has joined #RubyOnRails
[04:35:25] arup_r: like params.require(user: :personal_info).permit(:name, :email) something like what I am looking for.
[04:35:48] arup_r: can we require till deep level?
[04:37:26] TheNet: has joined #RubyOnRails
[04:44:07] IFrank00: has joined #RubyOnRails
[04:44:26] avemestr: has joined #RubyOnRails
[04:45:11] RockLee: has joined #RubyOnRails
[04:46:08] konsolebox: has joined #RubyOnRails
[04:48:18] jun: has joined #RubyOnRails
[04:49:42] sdwrage: has joined #RubyOnRails
[04:50:19] sevenseacat: has joined #RubyOnRails
[04:50:42] konsolebox: has joined #RubyOnRails
[04:51:30] ivanskie: has joined #RubyOnRails
[04:51:31] Or1on: /j #django
[04:51:37] Or1on: sorry guys. my bad
[04:51:43] VeryBewitching: arup_r: params.require(:model).permit(other_model: [:field, :another_field])
[04:54:27] VeryBewitching: arup_r: I haven't tried going beyond that depth (mostly because I haven't needed to yet) but it wouldn't take long to test one more level.
[04:54:29] Altonymous: has joined #RubyOnRails
[04:55:00] Radar: Or1on: Traitor.
[04:55:58] jun: has joined #RubyOnRails
[04:56:14] Or1on: Radar, lol. I'm actually thinking of moving a site from django to rails so...
[04:56:24] Radar: Or1on: In that case: WELCOME WELCOME WELCOME :D
[04:56:41] Radar: ACTION rolls out the red carpet which is definitely not stained with the blood of ex-django applications.
[04:57:38] VeryBewitching: Radar: That's one pretty carpet.
[04:57:51] Or1on: ACTION walks over carpet humbly.
[05:01:01] yogeshrt: has joined #RubyOnRails
[05:05:30] psk17_: has joined #RubyOnRails
[05:09:40] shinnya: has joined #RubyOnRails
[05:13:32] RockLee: has joined #RubyOnRails
[05:14:00] chrissonar: has joined #RubyOnRails
[05:14:09] dhjondoh: has joined #RubyOnRails
[05:14:51] Cervajz: has joined #RubyOnRails
[05:15:42] TvL2386: has joined #RubyOnRails
[05:16:20] rickmasta: has joined #RubyOnRails
[05:17:06] pawnbox: has joined #RubyOnRails
[05:17:24] nyaa: has joined #RubyOnRails
[05:17:52] lxsameer: has joined #RubyOnRails
[05:17:52] lxsameer: has joined #RubyOnRails
[05:19:25] htmldrum: has joined #RubyOnRails
[05:20:19] iamjarvo_: has joined #RubyOnRails
[05:22:30] rvanlieshout: has joined #RubyOnRails
[05:22:40] robbyoconnor: has joined #RubyOnRails
[05:22:58] GriffinHeart: has joined #RubyOnRails
[05:26:04] antn: has joined #RubyOnRails
[05:27:08] GriffinHeart: Hey guys, is there anything that ActiveRecord does to ensure reference integrity? like I have a parent object and from the child object I load the parent but the objects are different
[05:27:33] GriffinHeart: Case in point, instance variables are not there, like it was newed
[05:28:45] rvanlieshout: if you load the parent it could be different from child.parent when you've made changes to child.parent without saving them
[05:28:54] Radar: GriffinHeart: No, there is no identity map in ActiveRecord.
[05:29:02] Radar: Post.find(1) will be different to Comment.find(1).post
[05:29:13] Radar: assuming comment #1 is linked to post #1, of cours.e
[05:29:25] GriffinHeart: Radar: yeah exactly my issue
[05:29:30] rvanlieshout: oh that thing
[05:29:37] rvanlieshout: the content would be te same, but object id is different
[05:29:52] GriffinHeart: I don't really know how to call that, object reference integrity?
[05:30:07] cocoon238: has joined #RubyOnRails
[05:30:08] Radar: I think of it without the buzzwords
[05:30:19] Radar: "This 'Post ID=1' is not the same as THAT 'Post ID=1'"
[05:30:30] Shoutsid: has joined #RubyOnRails
[05:31:01] rvanlieshout: it's attributes are
[05:31:19] Radar: Not all the time ;)
[05:31:22] GriffinHeart: Found a nasty bug because of that, since I was lazy creating something
[05:31:56] GriffinHeart: So how do you deal with more OO programing that relies on keeping state? (not really database state)
[05:33:18] yogeshrt: has joined #RubyOnRails
[05:33:19] Radar: Use the same objects everywhere when possible :)
[05:33:20] GriffinHeart: Like parent doing child.update_something and in update_something you do parent.did_update
[05:33:27] Radar: Save to an external source and reload from there when not possible.
[05:33:31] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[05:33:32] helpa: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[05:34:00] GriffinHeart: Sorry, let me get a gist going
[05:34:00] tagrudev: has joined #RubyOnRails
[05:35:05] workmad3: has joined #RubyOnRails
[05:35:28] Radar: Thank you.
[05:37:17] yfeldblum: has joined #RubyOnRails
[05:40:00] riotjones: has joined #RubyOnRails
[05:40:01] GriffinHeart: So Its more in the general sense of how to handle this https://gist.github.com/GriffinHeart/e18c1bc629023b800e16
[05:40:15] avemestr: has joined #RubyOnRails
[05:40:17] EminenceHC: has joined #RubyOnRails
[05:40:57] GriffinHeart: Since I guess in child when loading the parent relation it doesn't perform identity mapping like @Radar was saying
[05:41:15] Radar: MFW GriffinHeart completely ignores the !fake tip.
[05:41:29] Radar: I don't help with fake code. Full stop.
[05:43:26] GriffinHeart: Radar: I see, sorry.
[05:44:03] arup_r: VeryBewitching: I tried, didn't work. I will go with classical style.. haha
[05:45:24] Shoutsid: has joined #RubyOnRails
[05:45:38] IFrank00: good evening to all
[05:47:08] arup_r: Are we missing inverse_of option ? May be GriffinHeart can take a help from this.
[05:48:08] Cervajz: has joined #RubyOnRails
[05:48:34] IFrank00: on my rails 4 app my *= require_tree . on css and js ins not reading the dir example on my product.css.scss I have some styles it won't style the page. but if I use it at application.css.scss it style the product page
[05:48:37] GriffinHeart: arup_r: Thanks, I've tried `inverse_of`, was my first suspicion
[05:49:02] rromanch_: has joined #RubyOnRails
[05:49:20] Radar: IFrank00: !code on GitHub please
[05:49:20] helpa: IFrank00: 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.
[05:49:24] IFrank00: arup_r, Thank you the other day I got it working
[05:49:58] IFrank00: radar, setting it up right now :)
[05:50:22] Cervajz_: has joined #RubyOnRails
[05:50:34] GriffinHeart: tho I'm using mongoid which doesn't really implement active record, I'll make a full working example and come back, Thanks Radar, rvanlieshout and arup_r I appreciate your time.
[05:51:16] tejasmanohar: has joined #RubyOnRails
[05:51:18] hephaestus_rg: has joined #RubyOnRails
[05:52:00] ror15: has joined #RubyOnRails
[05:52:02] l_tonz: has joined #RubyOnRails
[05:55:20] Shoutsid: has joined #RubyOnRails
[05:55:43] arup_r: IFrank00: Ywc :)
[05:55:50] IFrank00: Radar, https://gist.github.com/Frank004/d94f3f969da95f0305d9
[05:56:53] krz: has joined #RubyOnRails
[05:59:31] n00bDev: has joined #RubyOnRails
[06:00:49] IFrank00: Radar, I have create other apps and they all work and run the js or css from the individual files. I dont know if it was a setting as this app was made in a coop work and I dont setup on the beginning
[06:01:45] trautwein: has joined #RubyOnRails
[06:01:52] GeissT: has joined #RubyOnRails
[06:02:25] l_tonz: has joined #RubyOnRails
[06:03:03] yogeshrt: has joined #RubyOnRails
[06:06:13] pydave6367: has joined #RubyOnRails
[06:06:35] ProLoser: has joined #RubyOnRails
[06:11:02] avemestr: has joined #RubyOnRails
[06:11:44] dionysus69: has joined #RubyOnRails
[06:13:05] Shoutsid: has joined #RubyOnRails
[06:15:45] arup_r: ohh sorry
[06:16:07] jas02: has joined #RubyOnRails
[06:16:08] Cervajz: has joined #RubyOnRails
[06:16:13] CheckYourSix: has joined #RubyOnRails
[06:16:46] mloy_: has joined #RubyOnRails
[06:17:23] CheckYourSix: has joined #RubyOnRails
[06:17:33] mloy: has joined #RubyOnRails
[06:17:35] mloy_: has joined #RubyOnRails
[06:18:02] darrik: has joined #RubyOnRails
[06:18:15] pawnbox: has joined #RubyOnRails
[06:19:42] kalusn: has joined #RubyOnRails
[06:19:51] ZucchiniZe: How do you make a dynamically generated column that isn't entered into the db?
[06:20:03] senny: has joined #RubyOnRails
[06:20:15] arup_r: attr_accessor
[06:20:28] arup_r: non persistent attributes they create
[06:20:38] ruurd: has joined #RubyOnRails
[06:20:40] GriffinHeart: Radar: sorry is this ok? https://gist.github.com/GriffinHeart/e18c1bc629023b800e16 I understand the issue like you said This 'Post ID=1' is not the same as THAT 'Post ID=1'
[06:20:43] nyaa: has joined #RubyOnRails
[06:21:11] Ropeney: has joined #RubyOnRails
[06:21:14] ZucchiniZe: I mean I have something like length in minutes and I want something like length_hours to be accessible within the model but not in the db
[06:21:19] ZucchiniZe: What is that called?
[06:21:52] rafaelfranca: ZucchiniZe: a method?
[06:21:55] GriffinHeart: and one solution would be to pass the `combo_game` object into the `combo_instance.play`, but seems weird since it has a relationship that would load it
[06:21:58] Jasaka: has joined #RubyOnRails
[06:22:20] ZucchiniZe: rafaelfranca, thanks
[06:22:36] Macaveli: has joined #RubyOnRails
[06:23:29] rafaelfranca: ZucchiniZe: something like `def length_hours; length_minutes / 60.0; end`, changing the ; with new lines
[06:23:43] GriffinHeart: I'm interested in knowing what other approaches would you take to it
[06:23:52] herbst: has joined #RubyOnRails
[06:23:56] ZucchiniZe: still learning rails
[06:25:08] Jasaka|NA: has joined #RubyOnRails
[06:25:10] toy: has joined #RubyOnRails
[06:27:12] baweaver: ZucchiniZe: how much ruby do you know?
[06:27:24] baweaver: You might want to go through some of the basics of making classes
[06:27:26] baweaver: it'll help.
[06:27:36] ZucchiniZe: Enough to make a simple sinatra app
[06:27:47] ZucchiniZe: I just am too lazy to read any guides for rails
[06:28:08] baweaver: it'll bite you
[06:28:37] ZucchiniZe: and that is why I am making a rails app
[06:28:42] MartinElvar: has joined #RubyOnRails
[06:28:43] helpa: 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
[06:28:46] ZucchiniZe: so I can learn by example
[06:29:52] baweaver: Radar and sevenseacat wrote that book, it'll be useful to get started
[06:30:45] Shoutsid: has joined #RubyOnRails
[06:31:05] ZucchiniZe: sevenseacat = yehuda?
[06:32:02] seank_: has joined #RubyOnRails
[06:32:06] rafaelfranca: if I didn't know Yehuda's nick I'd make the same question
[06:32:41] baweaver: what was his nick anyways?
[06:32:44] rafaelfranca: ZucchiniZe: sevenseacat = Rebecca
[06:33:07] baweaver: I suppose I can just look up on Twitter
[06:33:34] rafaelfranca: baweaver: I believe it is wycats
[06:33:45] baweaver: sounds familiar enough
[06:34:11] baweaver: though admittedly tenderlove is still my favorite nick around the Ruby community
[06:34:18] sevenseacat: aye. wycats, steveklabnik, Radar, and meeeee.
[06:34:19] baweaver: always makes me chuckle.
[06:34:29] IFrank00: Radar, if I move the *= require_tree . on top of the file the dir get load it but the other @import dont get run
[06:34:47] l_tonz: has joined #RubyOnRails
[06:35:32] kalusn: has joined #RubyOnRails
[06:35:51] workmad3: has joined #RubyOnRails
[06:36:29] rafaelfranca: IFrank00: I don't recommend to mix `require` and `@import` in the same file
[06:36:36] rafaelfranca: there are a lot of know gotchas
[06:36:44] rafaelfranca: I believe I even deprecated this
[06:37:07] IFrank00: rafaelfranca, what is the correct way of writhing that
[06:37:23] IFrank00: https://gist.github.com/Frank004/d94f3f969da95f0305d9
[06:38:19] konsolebox: has joined #RubyOnRails
[06:38:32] rafaelfranca: IFrank00: only with @import
[06:38:55] rafaelfranca: https://github.com/rails/sass-rails/commit/48f6fda48c67646716942f7122c5c406185f8b5f
[06:39:17] cocoon238: has joined #RubyOnRails
[06:39:21] comrad: has joined #RubyOnRails
[06:39:59] GriffinHeart: has joined #RubyOnRails
[06:42:55] netzfisch: has joined #RubyOnRails
[06:42:57] IFrank00: rafaelfranca, so I have to add manual echa page.scss to the application.scss ?? and eliminate the require stuff
[06:43:30] IFrank00: rafaelfranca, I was trying to play nice with rails pipeline :/
[06:43:59] rafaelfranca: you can use `@import './*'` too
[06:44:02] GriffinHeart: has joined #RubyOnRails
[06:44:23] IFrank00: rafaelfranca, ill try that right now
[06:44:45] arBmind: has joined #RubyOnRails
[06:45:25] tetraktys: has joined #RubyOnRails
[06:46:08] IFrank00: rafaelfranca, and for self. im think of adding a global.scss file and add all my self code that is on my application.scss same with js and add a @import 'global' on each css and js
[06:47:02] rafaelfranca: You don't need self if you are only using @import
[06:47:14] rafaelfranca: and .js files don't have @import, only require
[06:49:08] dionysus69: isn't this a correct way to import custom fonts? https://gist.github.com/webzorg/d358209eac9e8f97ffa6
[06:51:12] rafaelfranca: dionysus69: not in a Rails application. To avoid caching problem Rails will add a digest in the file name and also put in the `public/assets` folder so when referencing assets in your CSS use one of the assets helpers like, in your case, `font-url('font.ttf')`
[06:51:56] dionysus69: hmm ok will try that
[06:52:29] dionysus69: but that though needs to go to scss.erb file right ? not just scss?
[06:52:44] rafaelfranca: dionysus69: scss works for that
[06:52:47] rafaelfranca: see http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
[06:53:02] rafaelfranca: section 2.3.2
[06:55:03] IFrank00: rafaelfranca, got it working this what I did https://gist.github.com/Frank004/d94f3f969da95f0305d9
[06:55:25] Linuus: has joined #RubyOnRails
[06:56:11] rafaelfranca: IFrank00: does it work if you move the `./*` to just before global?
[06:56:12] IFrank00: rafaelfranca, oh yes the js use require I got mixup by the moment. but im having the same problem on my js I think is position so ill move the code around to see if that fix it
[06:57:02] rafaelfranca: position make sense, although it would be better if you change your code to not be order dependent
[06:57:25] MartinElvar: has joined #RubyOnRails
[06:58:19] IFrank00: rafaelfranca, yes it work but some of the other code try to change it
[06:59:19] IFrank00: rafaelfranca, Yes its the theme that im using. when I try to add my own style code I have to put it on top to work
[06:59:35] dionysus69: rafaelfranca: I got this but it gives me syntax error ... :s I put file in public/assets folder as well as I am using this scss file
[06:59:36] dionysus69: https://gist.github.com/webzorg/949208835a6b8b2b3634
[06:59:40] IFrank00: hope to get the full site with my own code soon
[07:01:32] rafaelfranca: dionysus69: ok, let me try to be clear how it works
[07:01:39] Spami: has joined #RubyOnRails
[07:01:49] digitalknk: has joined #RubyOnRails
[07:02:21] Uptime: has joined #RubyOnRails
[07:03:31] rafaelfranca: dionysus69: see https://gist.github.com/rafaelfranca/3facba644d6fe39cb553
[07:04:15] rafaelfranca: dionysus69: I'm sorry, I was not clear in the first time so you got confused. See if that gist make sense to you
[07:04:48] rafaelfranca: you don't need to deal with `public/assets` it will be generated by Rails
[07:05:05] dionysus69: no problem hehe and yes now it makes sense, syntax error is gone but font is not showing up, i ll try things around and post )
[07:06:01] rafaelfranca: don't forget to move the file back to app/assets/fonts
[07:06:08] rafaelfranca: and also delete the public/assets folder
[07:06:21] SteenJobs: has joined #RubyOnRails
[07:06:55] solars: has joined #RubyOnRails
[07:07:54] dionysus69: do I need to precompile assets now ? because still not working
[07:09:27] rafaelfranca: not in development
[07:10:24] rafaelfranca: how is the font url being generated in the browser?
[07:10:55] eggoez: has joined #RubyOnRails
[07:12:28] adac: has joined #RubyOnRails
[07:12:48] dionysus69: like this, seems correct https://gist.github.com/webzorg/7406fed12456ca699659
[07:12:53] eGGsha: has joined #RubyOnRails
[07:14:48] Scripore: has joined #RubyOnRails
[07:15:55] GriffinHeart: has joined #RubyOnRails
[07:16:37] IFrank00: rafaelfranca, OMG this fix so many things all my css and js its running with out a problem. months and months of hardcoding in the app.scss file, now moving stuff and organising
[07:16:58] pawnbox: has joined #RubyOnRails
[07:17:19] rafaelfranca: :D glad I could help
[07:18:46] rafaelfranca: dionysus69: any 404 in the network tab in browser inspector?
[07:19:33] artto: has joined #RubyOnRails
[07:19:46] ruurd: has joined #RubyOnRails
[07:20:23] dionysus69: rafaelfranca: good shot, exactly there is a 404 next to Carnevalee-Freakshow.ttf GET
[07:20:24] voker57: has joined #RubyOnRails
[07:20:36] MaDErroR123: has joined #RubyOnRails
[07:20:40] dionysus69: but file is really there in app assets fonts folder
[07:20:41] nfk|laptop: has joined #RubyOnRails
[07:21:19] dionysus69: bellow the 404 , there is "ok" get for font too
[07:21:47] rafaelfranca: had you restarted the server? after you added the app/assets/fonts folder?
[07:22:17] dionysus69: these details are killing me
[07:23:37] dionysus69: works thanks rafaelfranca so much, you taught me allot!
[07:23:52] xhoy: has joined #RubyOnRails
[07:24:03] rafaelfranca: :D you are welcome
[07:24:25] rushed: has joined #RubyOnRails
[07:24:48] rafaelfranca: that restart thing is trick
[07:25:09] rafaelfranca: you only needed to restart because you added a new folder inside app/assets that was not there when you started the server
[07:25:51] rafaelfranca: Rails add all paths in app/assets to load path at boot time, but new folders are not automatically added until the next boot
[07:26:30] thejamespinto: has joined #RubyOnRails
[07:27:28] jenrzzz: has joined #RubyOnRails
[07:27:30] Shoutsid: has joined #RubyOnRails
[07:28:09] arBmind: has joined #RubyOnRails
[07:28:59] dionysus69: roger that ))
[07:29:12] dionysus69: I am always forgetting to restart server
[07:30:10] USvER: has joined #RubyOnRails
[07:30:30] rafaelfranca: now I have to sleep. sy!
[07:30:50] roshanavand: has joined #RubyOnRails
[07:32:04] norc: has joined #RubyOnRails
[07:32:59] GriffinHeart: has joined #RubyOnRails
[07:36:34] workmad3: has joined #RubyOnRails
[07:36:47] jenrzzz: has joined #RubyOnRails
[07:38:09] ruurd: has joined #RubyOnRails
[07:39:03] nyaa: has joined #RubyOnRails
[07:39:46] kalusn: has joined #RubyOnRails
[07:40:51] many: has joined #RubyOnRails
[07:42:33] yogeshrt: has joined #RubyOnRails
[07:42:48] mark4: has joined #RubyOnRails
[07:44:59] AzaToth: has joined #RubyOnRails
[07:45:17] kalusn: has joined #RubyOnRails
[07:45:37] eGGsha: has joined #RubyOnRails
[07:46:40] arBmind: has joined #RubyOnRails
[07:49:07] zhkirill: has joined #RubyOnRails
[07:51:44] futilegames: has joined #RubyOnRails
[07:53:37] toy: hello checking weather i can text in this group
[07:54:48] toy: i was not registered and unable to send ...now i can :)
[07:55:07] ruurd: has joined #RubyOnRails
[07:55:29] renegadeandy: has joined #RubyOnRails
[07:56:59] kitsuneyo: has joined #RubyOnRails
[07:57:51] ror15: has joined #RubyOnRails
[08:01:31] quazimodo: has joined #RubyOnRails
[08:03:41] mikecmpbll: has joined #RubyOnRails
[08:04:54] dnewkerk_: has joined #RubyOnRails
[08:05:56] futilegames: has left #RubyOnRails: ()
[08:07:51] trollga: has joined #RubyOnRails
[08:08:22] srinidhi: has joined #RubyOnRails
[08:08:54] rgtk: has joined #RubyOnRails
[08:10:14] lessless: has joined #RubyOnRails
[08:10:22] norc: Does it make more sense to test whether obj = Model.create({}) persisted, or to test the count?
[08:10:56] darutoko: has joined #RubyOnRails
[08:11:33] lessless: is it possible to update a single key in JSON column with update method?
[08:11:58] l_tonz: has joined #RubyOnRails
[08:12:19] bmalum: has joined #RubyOnRails
[08:12:33] lessless: like company.update(normal_column: "text", :"json_column.jsonprop" => "amazin syntax")
[08:12:34] ruurd: has joined #RubyOnRails
[08:12:40] htmldrum: has joined #RubyOnRails
[08:14:11] rromanch_: has joined #RubyOnRails
[08:15:24] siddart: has joined #RubyOnRails
[08:17:55] DEA7TH: has joined #RubyOnRails
[08:19:16] marienz: has joined #RubyOnRails
[08:20:06] tbuehlmann: norc, in what context? a unit test?
[08:20:26] Peg-leg: has joined #RubyOnRails
[08:21:25] norc: tbuehlmann: Yeah, rspec in my case
[08:21:34] norc: (Controller tests to be exact)
[08:23:10] norc: I could either expect(delete(...)).to change(City, :count).by(-1) or expect(assigns(:city)).to be_persisted
[08:23:15] stannard: has joined #RubyOnRails
[08:23:32] norc: (Technically the last would pass on creation too though)
[08:25:27] jenrzzz: has joined #RubyOnRails
[08:25:56] WhereIsMySpoon_: has joined #RubyOnRails
[08:26:36] marr: has joined #RubyOnRails
[08:27:26] ruurd: has joined #RubyOnRails
[08:28:04] MaDErroR123: has joined #RubyOnRails
[08:28:37] l_tonz: has joined #RubyOnRails
[08:29:53] Zackio: has joined #RubyOnRails
[08:30:37] hephaestus_rg: has joined #RubyOnRails
[08:31:48] pawnbox: has joined #RubyOnRails
[08:32:55] seank_: has joined #RubyOnRails
[08:33:30] thejamespinto: has joined #RubyOnRails
[08:33:30] njero: has joined #RubyOnRails
[08:35:52] Kara: has joined #RubyOnRails
[08:36:03] karam: has joined #RubyOnRails
[08:37:03] Oog: has joined #RubyOnRails
[08:37:24] workmad3: has joined #RubyOnRails
[08:37:28] pawnbox: has joined #RubyOnRails
[08:38:04] bitsapien: has joined #RubyOnRails
[08:38:52] n00bDev: has joined #RubyOnRails
[08:39:22] thejamespinto_: has joined #RubyOnRails
[08:40:06] CheckYourSix: has joined #RubyOnRails
[08:41:17] adre: has joined #RubyOnRails
[08:41:30] Cervajz: has joined #RubyOnRails
[08:44:19] hephaestus_rg: has joined #RubyOnRails
[08:46:05] tbuehlmann: norc, is it important for the controller test that you test the persistence of the record? I personally would allow model.save to return true and test what the controller is actually doing
[08:49:45] norc: tbuehlmann: Yeah. It is an atomic operation on a set of objects, so I want to make sure that either all get created/destroyed/updated or none.
[08:50:05] n008f4g_: has joined #RubyOnRails
[08:50:15] norc: (The controller sets up a transaction and then does its thing)
[08:50:28] MaDErroR123: has joined #RubyOnRails
[08:53:07] trollga: has joined #RubyOnRails
[08:53:12] Ropeney: has joined #RubyOnRails
[08:53:34] njero: has joined #RubyOnRails
[08:54:04] jgt: has joined #RubyOnRails
[08:54:59] rgtk: has joined #RubyOnRails
[08:55:00] ruurd: has joined #RubyOnRails
[08:57:29] FailBit: https://i.imgur.com/x2BUWG0.gif
[08:58:31] boombadaroomba: has joined #RubyOnRails
[09:01:41] lollysticky: has joined #RubyOnRails
[09:04:30] trollga: has joined #RubyOnRails
[09:05:17] freezevee: has joined #RubyOnRails
[09:08:17] lollysticky: can any one help me out with a migration issue? (http://pastie.org/10482907)
[09:08:29] lollysticky: I received an app folder structure from a friend
[09:08:31] gremax: has joined #RubyOnRails
[09:08:34] lollysticky: and need to get it to work on a new system
[09:09:03] Linuus: has joined #RubyOnRails
[09:09:05] lollysticky: I am trying to figure out how to but I can't get it to wo rk :/
[09:09:08] rvanlieshout: and what's the issue?
[09:09:21] l_tonz: has joined #RubyOnRails
[09:09:23] n00bDev: has joined #RubyOnRails
[09:09:31] AnoHito: has joined #RubyOnRails
[09:09:42] lollysticky: well the public folder does not contain any index.html file or something similar
[09:09:47] lollysticky: so I guess I need to generate this?
[09:10:02] matthewd: That looks like a much older version of rails than 4.2
[09:10:04] rvanlieshout: why would you expect it to contain index.html?
[09:10:10] lollysticky: yes it's an v2.3.2 or something
[09:10:30] lollysticky: well because that's what I'm used to :) How else can my webserver serve the content
[09:10:38] rushed: lollysticky: you probably don't want to be using v2 at this point
[09:10:41] rvanlieshout: it servers dynamic content
[09:10:51] rushed: lollysticky: especially if it's exposed to the internet
[09:11:19] rvanlieshout: and this is not something you just place and *go*...
[09:11:22] rvanlieshout: it's not a static set of files
[09:11:34] senny: has joined #RubyOnRails
[09:12:53] lollysticky_: has joined #RubyOnRails
[09:12:56] stardiviner: has joined #RubyOnRails
[09:13:01] lollysticky_: sorry weird glitch here
[09:13:11] lollysticky_: anyway I'm using v4.2.4? not 2.3.2
[09:13:17] nyanz: has joined #RubyOnRails
[09:13:18] lollysticky_: but the friend's code is from 2.3.2
[09:13:33] lollysticky_: so how do i get it to work on my system? :/
[09:13:46] demonlove: has joined #RubyOnRails
[09:13:49] matthewd: Updating the application across two major versions will require substantial development effort
[09:14:11] lollysticky_: that's what I thought :/
[09:14:22] rushed: lollysticky: what does the application do? is there an existing database with data in it you care about?
[09:14:35] lollysticky_: It's a support application for scientists
[09:14:40] lollysticky_: let's say it's important enough
[09:14:43] kitsuneyo: has joined #RubyOnRails
[09:15:16] lollysticky_: I got the database backed up but I need the frontend to work so others can use it
[09:16:10] lollysticky_: and what if I somehow install the old ruby and rails versions?
[09:16:14] rushed: lollysticky_: you'll need to install the old version of rails that corrisponds to the version it last worked with then (and if the project is pre-bundler all the support gems it needed in the correct version)
[09:16:31] lollysticky_: rushed: that was also my idea
[09:16:42] lollysticky_: I'm not going to update the code so I guess that's the only way
[09:16:51] lollysticky_: Is there a way to know which gems need to be installed?
[09:16:56] lollysticky_: there is no Gemfile :/
[09:16:58] rushed: lollysticky_: if you decide to work with versions that old it would be important not to expose the machine to the internet as there would be significant security implications for the server
[09:17:30] lollysticky_: it will be on a seperate machine with no connection to the internal network anyway
[09:17:33] rushed: lollysticky_: if you have access to a machine or vm where the application was running previously you could interrogate what's installed on it
[09:17:34] lollysticky_: security can be dealt with
[09:17:43] closer: has joined #RubyOnRails
[09:19:39] rvanlieshout: ok.. i have this really really annoying issue
[09:19:48] rvanlieshout: rake assets:precomopile just doesn't give expected results
[09:19:53] rvanlieshout: it retains old js
[09:20:09] rushed: rvanlieshout: "retains"?
[09:20:48] rvanlieshout: i've changed some js
[09:20:56] rvanlieshout: and the old stuff stays in the precompiled versions
[09:21:01] rvanlieshout: removed tmp/cache/assets
[09:21:10] rvanlieshout: just got no clue how to debug this
[09:21:20] rvanlieshout: solved several times by just removing public/assets
[09:21:23] rvanlieshout: but that's not really the way to go
[09:21:54] rvanlieshout: bundle exec rake assets:precompile just indicates that files have been comopiled
[09:22:13] rvanlieshout: confirmed that old stuff is gone from app/assets/javascripts
[09:22:42] rvanlieshout: it's included by require_tree ./partials
[09:23:47] blackmesa: has joined #RubyOnRails
[09:25:30] Uptime: has joined #RubyOnRails
[09:28:10] eggoez: has joined #RubyOnRails
[09:28:11] elektronaut: has joined #RubyOnRails
[09:28:29] Senjai: has joined #RubyOnRails
[09:28:32] leeky: has joined #RubyOnRails
[09:29:09] nettoweb: has joined #RubyOnRails
[09:29:37] rvanlieshout: it also happens when you include a new file in partials/*
[09:30:10] rvanlieshout: include = place
[09:30:14] rvanlieshout: it won't get picked up
[09:31:42] wpp: has joined #RubyOnRails
[09:33:13] arup_r: has joined #RubyOnRails
[09:34:25] DoubleMalt: has joined #RubyOnRails
[09:34:48] RTG`: rvanlieshout: running in correct env?
[09:35:22] srinidhi: has joined #RubyOnRails
[09:35:33] Spami: has joined #RubyOnRails
[09:35:54] senny: has joined #RubyOnRails
[09:36:44] rvanlieshout: through capistrano
[09:37:00] rvanlieshout: so it's set when runned through cap, but does that even matter for precompile?
[09:37:03] kitsuneyo: has joined #RubyOnRails
[09:37:46] wpp: Hello I'm using Redis for storing caching fragments. Now I'd like retrieve these KEYS but I don't know which pattern I could use. Does someone happen to know if the fragment keys are stored in a particular way? "rails-fragment-xzy"
[09:38:10] workmad3: has joined #RubyOnRails
[09:38:33] wpp: Ah got it, nvm
[09:38:54] monq: has joined #RubyOnRails
[09:41:03] zpe_: has joined #RubyOnRails
[09:41:46] norc: rvanlieshout: Can you explain exactly what you mean by "retains"? How do you know?
[09:42:10] rvanlieshout: if i change alert(1); to alert(2); the alert(1) would be in the compiled version
[09:44:08] norc: rvanlieshout: Are your assets properly fingerprinted?
[09:44:30] rushed: rvanlieshout: how did you verify that the change in the source file made it to the server? how did you verify that the change in the source file was not in the precompiled output?
[09:45:08] tbuehlmann: norc, yeah, I still wouldn't test that in a controller test. maybe in an integration test, but not in a controller test. in a controller test I'd test http statuses, redirections, flash messages, ???. things, the controller does
[09:45:43] elektronaut: has joined #RubyOnRails
[09:45:52] norc: tbuehlmann: Isn't making calls into AR part of its job though? I mean I get what you mean
[09:46:39] tbuehlmann: that's part of it, right, but that's code I'd test otherwise. in the controller I'd mock/stub that dependency away
[09:47:01] chi6rag: has joined #RubyOnRails
[09:47:09] rvanlieshout: rushed: checked the new thing to be present in app/assets
[09:47:15] tbuehlmann: s/otherwise/elsewhere
[09:47:16] rvanlieshout: and not being present in any of the files in public/assets
[09:47:45] rgtk_: has joined #RubyOnRails
[09:48:05] rushed: rvanlieshout: have you gisted those results and/or your deploy log?
[09:48:09] bitsapien: has joined #RubyOnRails
[09:48:27] rvanlieshout: rushed: no, problem is that removing assets fixed it
[09:48:42] rvanlieshout: deploy log just shows normal precompile and logs shows that it compiled the application js and css
[09:48:49] rvanlieshout: it just didn't pick up new changes
[09:50:58] GriffinHeart: has joined #RubyOnRails
[09:51:21] norc: tbuehlmann: The only way this would help me, if I moved the logic completely into the model. (Which might not be a bad idea actually)
[09:51:48] tbuehlmann: norc, or a service object, but yeah, I agree
[09:53:11] tbuehlmann: as of rails 5 there won't be controller tests anymore, btw. they are kind of replaced by integration tests, since they do the same (and more: going through the middleware stack) and aren't slower than controller tests
[09:54:46] tvw: has joined #RubyOnRails
[09:55:48] yogeshrt: has joined #RubyOnRails
[09:56:22] workmad3: tbuehlmann: heh :) I've been ignoring controller tests for years because I've never found isolating controllers useful
[09:56:40] roshanavand: has joined #RubyOnRails
[09:57:16] arup_r: has joined #RubyOnRails
[09:57:43] tbuehlmann: I wrote quite a lot controller tests, tbh
[09:57:46] tbuehlmann: not anymore :)
[09:58:33] wethu: has joined #RubyOnRails
[09:59:10] workmad3: tbuehlmann: yeah, I wrote a lot too... the real kicker for me was when I stopped and looked at one once... and realised it was worthless! I was able to churn out both the controller code and the test code on autopilot, and any mistakes in the controller code weren't being picked up by the isolated controller test, they were being picked up by integration tests or acceptance tests (which could also pi
[09:59:16] workmad3: ck up the odd syntax error in controllers too)
[09:59:18] workmad3: so I just stopped writing them :D
[09:59:50] tbuehlmann: can't agree more
[10:00:25] ror15: has joined #RubyOnRails
[10:00:51] workmad3: tbuehlmann: I'd say they're useful if you want some form of characterization test for an untested legacy system though... just to basically help figure out wtf a huge, crufty controller action with business logic is doing prior to refactoring :)
[10:01:16] sevenseacat: has joined #RubyOnRails
[10:01:48] tbuehlmann: I think you get the most out of high level integration tests if you don't have too much time
[10:02:58] Grundell: has joined #RubyOnRails
[10:04:56] tbuehlmann: (another + for integration tests that is)
[10:05:45] pawnbox: has joined #RubyOnRails
[10:07:37] toy_: has joined #RubyOnRails
[10:09:11] jenrzzz: has joined #RubyOnRails
[10:09:26] norc: DEPRECATION WARNING: You are passing an instance of ActiveRecord::Base to `find`. Please pass the id of the object by calling `.id`. -- why is this being deprecated?
[10:09:47] rvanlieshout: norc: cause find expects an integer
[10:09:51] rvanlieshout: like find me record 123
[10:10:00] rvanlieshout: not find me record Book.first
[10:10:02] norc: That is not an answer to my question. :p
[10:10:06] matthewd: norc: Because it makes no sense... if you already have the record, why are you trying to find it?
[10:10:09] workmad3: norc: also, if you already have the object, why are you finding it? :P
[10:10:26] norc: matthewd: my_city = City.first; City.update(city, {})
[10:10:27] elaptics: well technically it accepts anything that'll convert to an int, you can pass a string containing a number to find too :)
[10:10:28] workmad3: norc: it's a pretty silly case to support, and it means `.find` needs to special-case it to produce correct results
[10:10:36] norc: workmad3: Look at my example above
[10:10:46] workmad3: norc: you mean `city.update({})`? :P
[10:10:50] matthewd: Same question.
[10:11:52] norc: Oh. Can we assume the question was never asked? :-)
[10:12:07] workmad3: norc: nope, it's going in your 'strikes' column ;)
[10:12:40] roshanavand: has joined #RubyOnRails
[10:13:55] lessless: has joined #RubyOnRails
[10:14:07] matthewd: workmad3: pardon?
[10:14:29] EdwardIII: so if you have 2 kind of controllers for the same model, e.g. one is REST and one is like an admin panel, what's the convention? RestEntryController and AdminEntryController?
[10:14:40] dionysus69: where do I check logs for passenger/nginx production setup? in rails root/logs there are no updated logs even though I am getting nasty errors on site
[10:14:56] matthewd: norc: Well, I guess my question does change slightly: if you already have the record, why aren't you using it?
[10:15:34] norc: matthewd: I was hoping we (except workmad3) were assuming I never asked a question. :-p
[10:15:56] arup_r: has joined #RubyOnRails
[10:16:13] rushed: dionysus69: it depends on your stack, /var/log apache and/or nginx would be a good place to start
[10:16:14] workmad3: matthewd: ^ that was my interpretation, hence why I joked about not letting him forget it ;)
[10:16:24] pawnbox: has joined #RubyOnRails
[10:16:42] dionysus69: rushed: thanks will look into it
[10:17:44] matthewd: Ah, right... I missed assume=pretend, and had a different reading.
[10:18:45] matthewd: I actually thought we'd deprecated that form of update, but apparently not
[10:19:14] roshanavand: has joined #RubyOnRails
[10:20:04] dEPy: has joined #RubyOnRails
[10:20:25] rickmasta: has joined #RubyOnRails
[10:23:06] trollga: has joined #RubyOnRails
[10:23:24] yogeshrt: has joined #RubyOnRails
[10:27:33] sheepman: has joined #RubyOnRails
[10:27:48] sheepman: has left #RubyOnRails: ()
[10:29:09] dhjondoh: has joined #RubyOnRails
[10:30:11] dEPy: has joined #RubyOnRails
[10:30:50] EdwardIII: ok so i created a controller with: `rails generate controller EntriesAdminController index`, but the auto-generated route is get 'entries_admin_controller/index'
[10:31:12] EdwardIII: what should i be doing so that gets generated as /entries/admin/ ?
[10:31:29] EdwardIII: and is this a sane expectation? if i want to represent a sort of hierachy shoudl i just be doing the routes manually?
[10:31:53] EdwardIII: (also i'd want /admin/entries/ really, but i gues i'd just generate admin_entries_controller instead)
[10:32:12] Kara: has joined #RubyOnRails
[10:32:27] trollga: has joined #RubyOnRails
[10:32:31] rushed: EdwardIII: I would just "rails generate controller EntriesAdminController" and add resource routes as desired
[10:32:57] rushed: EdwardIII: but /entries/admin is weird, usually you would probably see /admin/entries
[10:32:58] karam: has joined #RubyOnRails
[10:33:19] rushed: EdwardIII: /entries/admin would generally read as the entry with an identifier or slug of "admin"
[10:33:31] EdwardIII: rushed: right, that's what i thought too ^
[10:36:01] stamina: has joined #RubyOnRails
[10:38:48] GriffinHeart: has joined #RubyOnRails
[10:39:34] arup_r: has joined #RubyOnRails
[10:44:53] nfk|laptop: has joined #RubyOnRails
[10:47:05] EdwardIII: hrm so rails doesn't have a built in auth system? people tend to use devise or authlogic?
[10:48:43] l_tonz: has joined #RubyOnRails
[10:49:23] rvanlieshout: EdwardIII: it has all methods you need
[10:49:24] tbuehlmann: there is no such built-in, correct. I think people tend to use devise
[10:49:25] qejk: has joined #RubyOnRails
[10:49:38] bmalum: has joined #RubyOnRails
[10:50:30] EdwardIII: any standout differences between devise & authlogic? devise seems a bit more flexible, Authlogic seems less complex?
[10:50:54] Jasaka: has joined #RubyOnRails
[10:51:44] weihan: has joined #RubyOnRails
[10:52:04] workmad3: EdwardIII: devise provides a complete auth framework (including things like reset password flows, confirmation, sign-in tracking, account locking, etc. and even ways to integrate with SSO mechanisms through omniauth)... authlogic, last time I checked, provides a way to authenticate a session
[10:54:11] seank_: has joined #RubyOnRails
[10:54:36] darrencauthon: has joined #RubyOnRails
[10:55:16] roshanavand: has left #RubyOnRails: ()
[10:55:57] lessless: has joined #RubyOnRails
[10:56:07] roshanavand: has joined #RubyOnRails
[10:56:14] siaW: has joined #RubyOnRails
[10:56:36] GreatSage: has joined #RubyOnRails
[10:57:44] blackmes1: has joined #RubyOnRails
[10:58:03] senny: has joined #RubyOnRails
[10:59:28] mostlybadfly: has joined #RubyOnRails
[10:59:48] etrae: has joined #RubyOnRails
[11:00:40] Linuus: has joined #RubyOnRails
[11:01:40] Deck`: has joined #RubyOnRails
[11:03:39] DEA7TH: has joined #RubyOnRails
[11:07:11] ProLoser: has joined #RubyOnRails
[11:07:58] jenrzzz: has joined #RubyOnRails
[11:08:25] rodfersou: has joined #RubyOnRails
[11:09:15] Senjai: has joined #RubyOnRails
[11:09:24] chills42: has joined #RubyOnRails
[11:10:55] yekta: has joined #RubyOnRails
[11:11:04] awrfas2: has joined #RubyOnRails
[11:13:34] atomical: has joined #RubyOnRails
[11:14:01] p8m: has joined #RubyOnRails
[11:14:42] Rixius: has joined #RubyOnRails
[11:15:44] blackmes1: has joined #RubyOnRails
[11:16:01] chills42: has joined #RubyOnRails
[11:16:26] qejk: has joined #RubyOnRails
[11:19:58] basiles: has joined #RubyOnRails
[11:22:12] rromanch_: has joined #RubyOnRails
[11:23:05] GriffinHeart: has joined #RubyOnRails
[11:25:05] hahuang65: has joined #RubyOnRails
[11:28:59] MaDErroR123: has joined #RubyOnRails
[11:29:25] jenrzzz: has joined #RubyOnRails
[11:30:48] artto: has joined #RubyOnRails
[11:32:12] norc: Why is this test failing? http://pastie.org/10483240
[11:32:51] universa1: norc: you're checking for new and persisted...
[11:32:53] syath: has joined #RubyOnRails
[11:33:02] universa1: .new? and .persisted? are not true at the same time.
[11:33:43] nya: has joined #RubyOnRails
[11:34:54] qejk: has joined #RubyOnRails
[11:34:55] norc: universa1: Ah gotcha.
[11:35:18] norc: universa1: Guess I should have actually read the AR documentation.
[11:35:41] universa1: that is always a good idea to check the docs of the methods one is using ;)
[11:36:26] rushed: norc: unrelated to the failure you don't need to explicilty "return" things (the last result is returned) and you can use "def self.foo" instead of "class <<" if you like
[11:36:31] norc: universa1: Well I did read the matcher docs from rspec.
[11:36:40] zpe: has joined #RubyOnRails
[11:36:57] rushed: norc: also, testing for the class of things is generally unnecessary
[11:37:40] rromanch_: has joined #RubyOnRails
[11:38:12] norc: rushed: I prefer explicit returns for larger code blocks though, but you make a good point about testing for the class.
[11:38:59] universa1: personally i would write the service class differently ;) especially since it looks like it only does creating right now ;)
[11:39:01] l_tonz_: has joined #RubyOnRails
[11:39:30] norc: universa1: No, it does a lot more. I just cut away the unnecessary pieces :)
[11:39:59] rushed: norc: your preference is generally frowned upon, but enjoy :) you might also check out using respond_with and a json builder if you get to the point that you would like to clean up your respond to blocks
[11:40:38] matthewd: norc: Depending on those other pieces, create! save you from manually checking the errors
[11:42:00] matthewd: .. and would avoid AR::Rollback, which can have surprising behaviour if nested transactions get involved
[11:42:47] norc: matthewd: Dont have nested transactions. The difficulty I have here regarding create! is that I want a response for every sub-resource that gets created
[11:43:09] norc: matthewd: If I used create! it would unwind the stack (and thus I wouldnt get information about the other LoopPathways)
[11:43:31] ldnunes: has joined #RubyOnRails
[11:43:50] matthewd: Fair enough
[11:46:07] yogeshrt: has joined #RubyOnRails
[11:46:51] dhjondoh: has joined #RubyOnRails
[11:50:38] WizJin: has joined #RubyOnRails
[11:53:17] defsdoor: has joined #RubyOnRails
[11:53:41] youngbaks: has joined #RubyOnRails
[11:55:36] weihan_: has joined #RubyOnRails
[11:56:26] kitsuneyo: has joined #RubyOnRails
[11:57:06] bitsapien_: has joined #RubyOnRails
[11:57:33] diegobiavati: has joined #RubyOnRails
[11:59:01] atmosx: has joined #RubyOnRails
[11:59:10] dhjondoh: has joined #RubyOnRails
[12:03:04] dhjondoh: has joined #RubyOnRails
[12:03:33] l_tonz: has joined #RubyOnRails
[12:03:45] ror15: has joined #RubyOnRails
[12:05:18] rromanch_: has joined #RubyOnRails
[12:06:03] dici: has joined #RubyOnRails
[12:07:11] doodlehaus: has joined #RubyOnRails
[12:07:35] kalusn: has joined #RubyOnRails
[12:11:17] rgtk: has joined #RubyOnRails
[12:11:37] htmldrum: has joined #RubyOnRails
[12:12:14] ayonkhan: has joined #RubyOnRails
[12:13:29] futilegames: has joined #RubyOnRails
[12:14:22] agit0: has joined #RubyOnRails
[12:15:54] Kara: has joined #RubyOnRails
[12:16:36] karam: has joined #RubyOnRails
[12:17:00] quazimodo: has joined #RubyOnRails
[12:18:03] AntiSpamMeta: has joined #RubyOnRails
[12:20:26] l_tonz_: has joined #RubyOnRails
[12:23:37] tbuehlmann: has joined #RubyOnRails
[12:25:20] momomomomo: has joined #RubyOnRails
[12:25:24] chills42: has joined #RubyOnRails
[12:26:23] mrbubbles: has joined #RubyOnRails
[12:27:00] EdwardIII: cool, got my first devise user + login
[12:29:27] renegadeandy: Can anybody explain why this line : https://gist.github.com/renegadeandy/b1a01770cc661e4083dc is giving me the error app/controllers/events_controller.rb:244: syntax error, unexpected ',', expecting =>
[12:30:06] artto: has joined #RubyOnRails
[12:30:34] deception1: has joined #RubyOnRails
[12:30:37] yardenbar: has joined #RubyOnRails
[12:31:58] matthewd: renegadeandy: You can't pass a regular parameter after you start the implicit/keyword hash parameter
[12:32:17] renegadeandy: oh right, wow, ok thank you matthewd
[12:32:51] freezevee: I have a self.search function in a User model and I am trying to create a test for it. Unfortunately it returns an Activerecord::Relation instead of an object -> got: #<ActiveRecord::Relation [#<User id: 1,
[12:33:06] freezevee: I tried with .first and [0] but they return nil
[12:33:25] freezevee: how could I get the first object from the relation ?
[12:33:42] jhass: .first would do this, I think your try was somehow flawed
[12:33:54] freezevee: the test does expect(User.search('blabla')).to eq(user)
[12:34:23] rushed: freezevee: .first or contain
[12:34:38] rushed: freezevee: a collection is never going to equal a single instance
[12:34:50] freezevee: rvanlieshout: it returns nil
[12:34:51] freezevee: https://gist.github.com/chrisvel/5d73c95a05f5e1007726
[12:34:59] freezevee: but the relation seems right
[12:35:13] jhass: you've shown to prove to that claim so far
[12:35:24] rushed: freezevee: expect(User.search('jmurdock').first).to eq(user)
[12:35:36] freezevee: rushed: it returns nil
[12:35:40] freezevee: how could it happen ?
[12:36:07] doodlehaus: has joined #RubyOnRails
[12:36:11] jhass: it can't according to what you've shown so far
[12:36:28] freezevee: jhass: https://gist.github.com/chrisvel/9cf08b4ae6a8abfbdcc9
[12:37:04] freezevee: it isn't logical
[12:37:35] rushed: freezevee: show us search
[12:37:49] freezevee: rushed: meaning ?
[12:37:57] jhass: also show us all specs with that line
[12:37:58] freezevee: the model's def ?
[12:38:00] matthewd: freezevee: Try it with .load.first
[12:38:16] rushed: freezevee: and maybe add a test to confirm that User.search('jmurdock').present?
[12:38:27] freezevee: matthewd: nil
[12:38:38] l_tonz: has joined #RubyOnRails
[12:38:39] srinidhi: has joined #RubyOnRails
[12:39:55] freezevee: rushed: https://github.com/chrisvel/ticketbox/blob/master/spec/models/user_spec.rb
[12:41:00] vmarcetic: has joined #RubyOnRails
[12:41:07] freezevee: and here is the search function https://github.com/chrisvel/ticketbox/blob/master/app/models/user.rb
[12:42:24] jamiejackson: has joined #RubyOnRails
[12:43:06] SPYGAME: has joined #RubyOnRails
[12:43:17] renegadeandy: Hi folks, I am getting error unpermitted parameter event_categories on my form, can somebody explain to me why : https://gist.github.com/renegadeandy/ff8565a424fd412e12b1
[12:43:45] jhass: freezevee: I guess given you create the user lazily with let, it's not there yet when you do the search but gets created when you compare the result
[12:43:59] IFrank00: has joined #RubyOnRails
[12:44:02] freezevee: jhass: should I use before :all ?
[12:44:07] jhass: freezevee: try the (anyway more robust) expect(User.search(user.username).first).to eq user
[12:44:14] rickmasta: has joined #RubyOnRails
[12:44:24] Octophore: has joined #RubyOnRails
[12:44:35] pydave6367: has joined #RubyOnRails
[12:44:54] freezevee: jhass: nope got: #<ActiveRecord::Relation instead of...
[12:45:54] jhass: freezevee: pay attention to detail
[12:46:05] hfp: So picking up my issue from last night. What is the proper way to have a drop down to select the number of records to show on page? This is what I'm doing right now: https://gist.github.com/Coaxial/120bf994c389bf90f695 but it messes the URL. Someone suggested a POST but I don't think it should be, I'm not passing anything to update any record so I think it should be a GET. Any pointers?
[12:46:49] bePolite: has joined #RubyOnRails
[12:46:52] EdwardIII: now... i should decide whether to use coffeescript for this new angular frontend heh. wouldn't have considered it but i see rails suggests it by default
[12:48:57] bePolite: has joined #RubyOnRails
[12:48:57] bePolite: has joined #RubyOnRails
[12:49:15] stardiviner: has joined #RubyOnRails
[12:49:50] wethu: has joined #RubyOnRails
[12:50:57] freezevee: jhass: it's fine
[12:50:57] paolodoors: has joined #RubyOnRails
[12:51:06] freezevee: jhass: but I don't understand why
[12:51:14] matthewd: hfp: It sounds like you already understand the trade-offs of the two options. I'm not sure what your question is?
[12:51:14] EdwardIII: i bet the poor sods coming to webdev for the first time picking up rails have a bit of a headache with that. "ok i'll learn rails. now i'll learn coffeescript. oh and sass. now what's this linux thing?"
[12:51:26] freezevee: jhass: I am sure that using user.username is more robust as you said
[12:51:43] jhass: freezevee: do you know what let does?
[12:51:52] Linuus: has joined #RubyOnRails
[12:52:09] renegadeandy: Hi folks, I am getting error unpermitted parameter event_categories on my form, can somebody explain to me why : https://gist.github.com/renegadeandy/ff8565a424fd412e12b1
[12:52:13] hfp: matthewd: is there a commonly accepted best practice?
[12:52:58] jhass: renegadeandy: permit it?
[12:53:03] freezevee: jhass: I know that you can create a symbol in order to memoize a call
[12:53:06] CanTonic: has joined #RubyOnRails
[12:53:10] renegadeandy: jhass: I thought I had, look at my permit?
[12:53:30] jhass: I only see event_categories_attributes there
[12:53:51] freezevee: jhass: and you can use it instead of FactoryGirl every time. But I suppose it is lazy because otherwise it could create the same records again and again
[12:54:03] EdwardIII: hmm all my tests are failing with ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: users.email: INSERT INTO "users" ("created_at", "updated_at", "id") VALUES ('2015-10-15 12:53:33', '2015-10-15 12:53:33', 298486374)
[12:54:03] jhass: freezevee: exactly, it's lazy
[12:54:21] puba: has joined #RubyOnRails
[12:54:25] jhass: freezevee: so the first call executes the block, subsequent calls return the memoized value
[12:54:30] EdwardIII: but even just tests that hit an index
[12:54:40] EdwardIII: why is that test trying to create a new user?
[12:54:42] renegadeandy: jhass: this is for a nested form.....what exactly is the event_categories parameter and why would i need to require it...i don't need to do that for event_images which is the same style of association -- has many?
[12:54:47] arup_r: i am using "#" so that the url shouldn't do any request. https://gist.github.com/aruprakshit/ab3b4b4672ecba25368d But if I click on it it is making a get request. So when I hove the text "complete sharing", I see this "http://localhost:3000/tenants/1/resources/1/resources#" and that is causing this issue. So how to change the link_to method, so that I can get what I am looking for
[12:54:51] jhass: freezevee: the inspect was misleading since it reexecuted the query after the failure happened
[12:54:58] rushed: EdwardIII: you're probably looking for database cleaner
[12:55:08] rromanch_: has joined #RubyOnRails
[12:55:25] renews: has joined #RubyOnRails
[12:55:55] jhass: renegadeandy: dunno, look at your request parameters? they're in the log
[12:55:59] puba: has left #RubyOnRails: ()
[12:56:12] renegadeandy: jhass: ive included them in the gist.....
[12:56:30] freezevee: jhass: thanks
[12:57:01] jhass: renegadeandy: something in the form is different then I guess
[12:57:05] freezevee: jhass: it makes sense, I'll keep reading more about this because I wouldn't have figured it out on myself
[12:58:36] l_tonz_: has joined #RubyOnRails
[13:00:10] yogeshrt: has joined #RubyOnRails
[13:00:40] Oog: has joined #RubyOnRails
[13:01:38] gerep: has joined #RubyOnRails
[13:01:50] renegadeandy: jhass: hmm can you explain this : https://gist.github.com/renegadeandy/d16e1b9aea077291fe6b
[13:02:49] bePolite: has joined #RubyOnRails
[13:03:42] dhjondoh: has joined #RubyOnRails
[13:04:25] bePolite: has joined #RubyOnRails
[13:05:34] EdwardIII: what's a common way of doing this? in django when you create a test the class you inherit from does fixtures loading on setUp and db destruction on tearDown
[13:05:40] ror15: has joined #RubyOnRails
[13:05:46] erich: has joined #RubyOnRails
[13:05:49] EdwardIII: do rails peeps do the same, but by hand?
[13:05:59] TPBallbag: has joined #RubyOnRails
[13:06:32] EdwardIII: pulling in something like this to do the job on setup and teardown? https://github.com/DatabaseCleaner/database_cleaner#how-to-use
[13:06:47] jenrzzz: has joined #RubyOnRails
[13:06:55] renegadeandy: jhass: thats the only difference, event_images has [0] in the name, whereas event categories does not
[13:08:15] gerep: I have these two tests that are checking for error messages on two different situations but the first one is return a route error: https://gist.github.com/gerep/df6ff4691885b6fbb1db
[13:08:29] gerep: Can someone please show me what I'm missing here?
[13:08:32] Kara: has joined #RubyOnRails
[13:08:59] gerep: I understand that the route error is valid because it is trying to generate a route with the wrong parameters I just don't know why
[13:09:13] gerep: Both tests are calling the same action but are validating different error messages
[13:09:14] EdwardIII: the fact this doesn't seem to be a common issue suggests to me i'm testing my rails app incorrectly
[13:09:17] gerep: The second test is passing
[13:09:32] karam: has joined #RubyOnRails
[13:10:26] matthewd: gerep: The error has a backtrace
[13:10:34] bmurt: has joined #RubyOnRails
[13:11:05] etrae: has joined #RubyOnRails
[13:11:26] gerep: matthewd: sorry for that, updated: https://gist.github.com/gerep/df6ff4691885b6fbb1db
[13:11:29] jhass: renegadeandy: you do fields_for for all subcategories, not a specific or single one
[13:11:54] matthewd: EdwardIII: Depending on what sorts of tests you're writing, transactional fixtures should Just Work -- as long as you start with an empty test database
[13:12:43] arup_r: I again hits some bugs it seems.. oh *shit*
[13:12:52] arup_r: rails bug*
[13:13:05] EdwardIII: matthewd: mmm i tried running "RAILS_ENV=test bin/rake db:setup" and even rm db/*.sqlite3 but it still does the same error
[13:13:26] renegadeandy: jhass: ahaaaaa, ok....but if i want to make the select list contain all subcategories....but make it assign the one chosen to [0] event category...?
[13:13:41] EdwardIII: i'm not even sure where that's coming from, i don't have a test anywhere that looks like this: INSERT INTO "users" ("created_at", "updated_at", "id") VALUES ('2015-10-15 12:55:58', '2015-10-15 12:55:58', 298486374)
[13:13:52] jhass: renegadeandy: pick a different fields_for, I guess
[13:14:12] matthewd: gerep: The code on those mentioned lines is presumably doing something different under your different error condition
[13:14:15] EdwardIII: is it possible devise is doing something on setup that's breaking it?
[13:14:21] renegadeandy: jhass: can you make a suggestion, im not sure what you mean
[13:14:48] matthewd: EdwardIII: Are transactional fixtures still enabled? Are you using fixtures?
[13:14:51] jhass: renegadeandy: http://guides.rubyonrails.org/form_helpers.html / http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-fields_for
[13:15:31] gerep: matthewd: yes, the first is trying to generate billing without logs, which in the browser works as expected
[13:15:34] matthewd: arup_r: I'm not seeing the bug
[13:15:35] EdwardIII: matthewd: i'm not loading any fixtures yet but probably will do soon. but i do have a controller test that creates a new entity (not a user)
[13:15:37] ramortegui: has joined #RubyOnRails
[13:15:42] EdwardIII: er new model sorry. SAVES a new model
[13:16:05] arup_r: read my question again. :D
[13:16:09] matthewd: arup_r: You have a link to '#', so when you click it, you navigate to '#'
[13:16:42] arup_r: well. So how can I make a it something which shouldn't do anything..
[13:16:43] gerep: matthewd: the problem is that it is trying to run my show action with incorrect parameters, as you can see, it is passing a Billing object where should be a Company object
[13:16:48] GnuYawk: has joined #RubyOnRails
[13:17:01] matthewd: EdwardIII: Presumably the backtrace should tell you who/what is creating your phantom users... or at least, the second one
[13:17:02] arup_r: matthewd: What is the valid link_to syntac for that
[13:17:19] renegadeandy: jhass: having read that....I am still unsure what my alternative forms_form would be....a bit of direction from you would let me piece the suggestion to the docs to make an understanding?
[13:17:36] renegadeandy: alternative fields_for apologies
[13:17:36] jhass: renegadeandy: I don't know what you're actually trying to do
[13:17:38] arup_r: Rails making anchor while I am trying to create a url which don't do anything
[13:18:12] tetraktys: has joined #RubyOnRails
[13:18:12] gerep: matthewd:updated with controller actions: https://gist.github.com/gerep/df6ff4691885b6fbb1db
[13:18:40] renegadeandy: jhass: I have a has_many association for event_categories in the event model. However, I only want to allow the user to create one of these associations to begin with. So I build a select where each option is the SubCategory name, and when the user submits their form i wnt the hash to arrive as the event_categories[0][id]
[13:19:03] arup_r: matthewd: that `#` shouldn't build a link with anchor . should it ?
[13:19:06] matthewd: arup_r: That sounds like not-a-link to me... but I'll admit I'm not really familiar with the ujs stuff, so I can't say with certainty that it can't be done
[13:19:20] gerep: matthewd: I don't get why this is happening: :action=>"show", :company_id=>#<Billing id: 43,...
[13:19:28] arup_r: not a link means ?
[13:19:31] gerep: Is it passing a Billing object instead of a company object
[13:19:43] crankharder: does anyone know if the default datetime format changed from rails 3.2 to 4.2 -- and if so, is there a configuration option for that?
[13:19:45] ritic: has joined #RubyOnRails
[13:19:53] l_tonz: has joined #RubyOnRails
[13:19:53] jhass: renegadeandy: so pass EventCategory.new to fields_for ?
[13:20:16] matthewd: gerep: The error's coming from your view, so I think we'll need that too -- at least the relevant part
[13:20:30] renegadeandy: jhass: like this : <%= f.fields_for EventCategory.new do |category_form| %>?
[13:20:35] helpa: Why don't you try it and find out for yourself?
[13:22:13] renegadeandy: well that results in Unpermitted parameter: event_category
[13:22:32] renegadeandy: the form is sending : "event_category"=>{"sub_category_id"=>"2"}, "
[13:22:47] renegadeandy: and i want that to build a new event.event_categories object
[13:22:49] renegadeandy: which i dont think it would
[13:22:50] stannard: has joined #RubyOnRails
[13:23:03] EdwardIII: matthewd: heh hrm i'm getting confused. bin/rake test --help shows: "--backtrace=[OUT] full backtrace...." but when i try running "bin/rake test --backtrace=stderr" it says invalid option: --backtrace=stderr
[13:24:41] awrfas2: has joined #RubyOnRails
[13:25:51] GriffinHeart: has joined #RubyOnRails
[13:28:25] EdwardIII: ok, so i can make it work if i use the env var instead of the switch (?), but the stack trace is not helping much. i don't actually see any of my code in the trace? am i showing the wrong kind of trace or something? https://gist.github.com/EdwardIII/e81ff150c63125df91a0
[13:28:27] crankharder: anyone know what this time format is? "09:12:56.232" .. hour:minute:??.??
[13:29:28] youngbaks: has joined #RubyOnRails
[13:29:46] matthewd: EdwardIII: I see a lot of fixtures.rb... so it sounds like you do have a users fixture defined
[13:30:04] EdwardIII: rails created some fixtures by default
[13:30:11] matthewd: crankharder: seconds.milliseconds
[13:32:36] EdwardIII: cool, now i see some of the tests don't work because they require auth. i can work it from there heh
[13:33:04] renegadeandy: im fed up using rails form helpers, spent all day on one field, im just gonna hardcode it, i know what i want so that will just work.
[13:33:05] rromanch_: has joined #RubyOnRails
[13:33:15] renegadeandy: Convention is fine, but if you dont understand it and its not clear from docs, then its pointless
[13:33:19] jkamenik: has joined #RubyOnRails
[13:34:09] rushed: renegadeandy: ya, you be a renegade!
[13:34:19] renegadeandy: rushed: LOL YEAH!
[13:34:23] rushed: stupid helpers, being all helper and stuff
[13:35:09] devdazed: has joined #RubyOnRails
[13:35:24] smathy: has joined #RubyOnRails
[13:35:37] Jon30: has joined #RubyOnRails
[13:35:39] kitsuneyo: has joined #RubyOnRails
[13:36:16] Jon30: hey guys, do png files need to be in utf8 format in order to be compiled by sprockets? cause assets precompile works locally, but crashes in production due to invalid utf8 sequence
[13:36:45] arup_r: nah,, lossing patience.. tried lot of combinations
[13:37:24] jhass: Jon30: png files are not subject to a character encoding
[13:38:08] vasilakisFiL: has joined #RubyOnRails
[13:38:31] jhass: Jon30: filenames perhaps?
[13:39:10] thither: has joined #RubyOnRails
[13:39:15] vasilakisFiL: on a huge table that contains millions of row would that Following.where(user_id: 109, following_id: 18).select(:id) be significanly faster than Following.where(user_id: 109, following_id: 18) given that I want to only check if this record exists?
[13:39:33] vasilakisFiL: or doesn't worth the optimization ?
[13:39:42] vasilakisFiL: "optimization"
[13:39:56] matthewd: vasilakisfil: Use .exists? ?
[13:40:02] thither: So I don't think I'm using merge() correctly. It seems to run but only keeps the results of the first relation.
[13:40:50] crankharder: does the fact that datetime and time respond differently here seem like a bug to anyone? https://gist.github.com/crankharder/2bb5bac9648ded42dcf7
[13:40:52] matthewd: vasilakisfil: But the answer to your question is no... particularly for a (presumably) narrow table, it's not going to make any actual difference
[13:41:19] vasilakisFiL: aha exists seems better for the reader! thanks!
[13:41:32] thither: Here's what my code looks like: http://pastebin.com/7zHeWCSF
[13:41:45] treehug88: has joined #RubyOnRails
[13:41:51] siddart: has joined #RubyOnRails
[13:42:51] arBmind1: has joined #RubyOnRails
[13:43:22] matthewd: crankharder: Time and DateTime have a variety of behavioural differences in stdlib... we narrow them down where feasible, but I don't think we can outright override an existing behaviour
[13:44:06] matthewd: crankharder: ... and given the other differences, I don't think ruby/ruby would consider that difference inherently bugful
[13:44:21] jhass: thither: "Returns an array representing the intersection of the resulting records with other, if other is an array." sure that's what you want?
[13:45:00] jhass: thither: in your example it's the same as chaining both where calls, where(...).where(...)
[13:45:00] Jon30: jhass: all files seem to have a proper name... I am not sure what I am missing. here's the error log: https://gist.github.com/slavajacobson/f032264248551ddd8271
[13:45:26] crankharder: meh, I guess Time's %z is the same as Date and DateTime's %Z
[13:45:31] crankharder: bit wonky, but ok
[13:46:11] EdwardIII: hell yeah, factory_girl is working, i know how to side-step devise for unit tests, great stuff
[13:46:19] jhass: Jon30: well, make sure your local and server encoding are both utf-8 for starters, there's not much anybody can do without access
[13:46:28] thither: jhass, oh I guess I understand. Merge is logical AND, I want logical OR
[13:46:32] thither: How do I do that
[13:46:47] rushed: Jon30: you probably have garbage in one of your js files, potentially from copy and pasting something in from the web
[13:46:52] matthewd: Jon30: That error seems to be in a JS file.. not the PNG mentioned above
[13:47:37] Jon30: matthewd: is it?? hmm
[13:47:57] dcp__: has joined #RubyOnRails
[13:48:15] EdwardIII: i'm picking through the Gemfile.lock to see which test framework comes by default, it looks like minitest. is that right?
[13:48:30] Jon30: matthewd: how can you tell?
[13:49:11] jhass: thither: I think it's still supplying a fragment as string or going down to arel sadly
[13:49:37] matthewd: Jon30: The backtrace mentions uglifyjs, which is the JS preprocessor
[13:50:00] matthewd: Sprockets could definitely do a less awful job of telling you that... along with which file is at fault :/
[13:50:04] matthewd: Patches welcome ;)
[13:50:17] blackmes1: has joined #RubyOnRails
[13:50:20] thither: jhass: I don't understand what you mean by "fragment as string" or "arel"
[13:50:52] jamiejackson: hi folks. i want to deliberately create an error on a view if a certain url parameter exists. how do i write that test? this wasn't correct: if (defined? params[:deliberate_error])
[13:50:55] Dopagod: has joined #RubyOnRails
[13:51:03] jhass: where("things = ? OR other_things = ?", things, other_things) and arel is the underlying DSL (and a gem which docs you can google)
[13:51:10] matthewd: I think someone gemified a backport of Relation#or
[13:51:19] jhass: thither: ^
[13:52:07] smathy: crankharder, it's governed by what both object's .zone method returns.
[13:52:39] trollga_: has joined #RubyOnRails
[13:52:44] bruno-: has joined #RubyOnRails
[13:52:58] Jon30: thank you
[13:54:14] thejamespinto: has joined #RubyOnRails
[13:54:19] matthewd: jamiejackson: params.key?(:foo) -- though params[:foo] will likely suffice too... a present-but-false value is highly unlikely (impossible?)
[13:54:49] thither: jhass: that would be too messy I think. I'm just going to stick .to_a on all of my .where()s and concat the arrays (removing duplicates later)
[13:56:04] dcp__: QQ: What would cause a form to fail to submit if sent by a link... however if you load directly to the url will work fine.
[13:56:16] dcp__: not sure how to go about googling for this...
[13:56:39] matthewd: thither: #or will do exactly what you want, if you're happy with the extra gem [until rails 5]
[13:57:37] suchness: has joined #RubyOnRails
[13:58:06] dcp__: clarification - link is on the index and takes you to new. If you go to new fr: the link the form won't work. However if you load new directly it'll work fine..
[13:58:52] bePolite: has joined #RubyOnRails
[13:59:05] thither: matthewd: I don't just need OR I also need and, like: result = ((a AND b) OR (c AND d) OR (e AND f))
[14:00:26] matthewd: thither: That's what it does. It works exactly like you were expecting merge to work.
[14:00:43] matthewd: (only you need to keep the return value -- it doesn't mutate the original relation)
[14:02:28] thither: matthewd: so condensed it's like: results = Model.where('a = ? OR b = ?', Model.where(...), Model.where(...)) ?
[14:02:53] matthewd: Model.where('a AND b').or(Model.where('c AND d'))
[14:03:48] JohnHirbour: has joined #RubyOnRails
[14:04:15] MaDErroR123: has joined #RubyOnRails
[14:04:26] thither: So that required the arel gem
[14:04:32] l_tonz: has joined #RubyOnRails
[14:05:44] JohnHirbour: has left #RubyOnRails: ()
[14:06:04] Kara: has joined #RubyOnRails
[14:06:30] The_Phoenix: has joined #RubyOnRails
[14:06:40] ror15: has joined #RubyOnRails
[14:07:15] karam: has joined #RubyOnRails
[14:07:31] srinidhi: has joined #RubyOnRails
[14:08:40] darrencauthon: has joined #RubyOnRails
[14:08:44] matthewd: thither: Did you find a relevant backport gem?
[14:08:55] matthewd: I've just found http://www.benjaminfleischer.com/backport-activerelation-or/, but I thought someone had gemified it
[14:10:51] The_Phoenix1: has joined #RubyOnRails
[14:12:12] Shoutsid: has joined #RubyOnRails
[14:12:17] ericjphillips: has joined #RubyOnRails
[14:12:23] htmldrum: has joined #RubyOnRails
[14:13:42] Shoutsid: has joined #RubyOnRails
[14:14:13] thither: matthewd: No I haven't. I thought I could just add the arel gem
[14:14:50] nfk|laptop: has joined #RubyOnRails
[14:15:03] norc: This test always fails if both are defined. Is there some dependency between the both im not seeing? http://pastie.org/10483629
[14:15:56] sankaber: has joined #RubyOnRails
[14:16:11] norc: Or is this because they get executed in parallel?
[14:16:17] bendangelo: has joined #RubyOnRails
[14:16:26] matthewd: thither: Ah, there we go: https://github.com/rails/rails/pull/16052#issuecomment-140736666
[14:16:29] norc: (They are defiend in seperate files)
[14:16:33] matthewd: https://rubygems.org/gems/where-or
[14:16:42] ericjphillips: has left #RubyOnRails: ()
[14:16:58] thither: Nice, thanks!
[14:17:33] ritic_: has joined #RubyOnRails
[14:17:34] sankaber: has joined #RubyOnRails
[14:17:40] bendangelo: has joined #RubyOnRails
[14:17:55] The_Phoenix: has joined #RubyOnRails
[14:18:50] matthewd: At a quick scroll-through, it all looks familiar, so it sounds like it should work. It monkey-patches AR, so there's some theoretical risk of future breakage there, but we rarely move things around in point releases... and you'll obviously remove it when you're on 5.0 anyway.
[14:19:47] dionysus69: has joined #RubyOnRails
[14:20:12] thither: matthewd: well I'm probably going to be locked into Rails 4.2.3 until 5.X
[14:20:18] thither: So it should be safe
[14:21:22] l_tonz_: has joined #RubyOnRails
[14:21:25] matthewd: Point releases are bug/security fixes, so locking that down is.. discouraged. But by that same token, they aim to change very little, to keep it easy to update.
[14:22:04] thither: It's an internal application for now, so I'm not super worried about that
[14:22:32] EdwardIII: hrm i guess really i should have a functional test that ensures access denied happens too
[14:22:37] thither: It may be public eventually, but probably after 5
[14:23:06] feignt: has joined #RubyOnRails
[14:24:26] rabbai: has joined #RubyOnRails
[14:24:33] The_Phoenix1: has joined #RubyOnRails
[14:25:14] norc: Nevermind, seems like I accidentally reverted an old change, where Ienabled the use of transactional fixtures....
[14:25:24] norc: Woah. That gave me quite a brain fart. :)
[14:26:05] dionysus69: asset_url is this a proper way to point to urls inside scss file?
[14:26:38] mostlybadfly: has joined #RubyOnRails
[14:26:47] dionysus69: because I have used image_path too so I am confused about the difference
[14:27:29] jenrzzz: has joined #RubyOnRails
[14:27:44] mary5030: has joined #RubyOnRails
[14:28:52] bendangelo: has joined #RubyOnRails
[14:28:52] dopamean_: has joined #RubyOnRails
[14:29:27] sarink: has joined #RubyOnRails
[14:29:28] rabbai: Good morning
[14:29:59] thither: matthewd: is there a way to do where(foo: 'bar', fizz: not 'buzz')?
[14:30:02] jlyndon: has joined #RubyOnRails
[14:30:08] corioliss: has joined #RubyOnRails
[14:30:11] rabbai: Any one know how to get ruby on rails app to run multi threaded? I use thin server but seems its not doing what it supposed to do
[14:30:18] thither: I guess I can just do where(...).where_not(...), right?
[14:30:52] momomomomo: rabbai: "not doing what its supposed to do"
[14:30:54] momomomomo: rabbai: !ask
[14:30:54] helpa: rabbai: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[14:31:35] matthewd: thither: Right. Well, where.not(..), but yeah.
[14:31:36] rabbai: helpa: thanks for the pointer
[14:31:38] mary5030: has joined #RubyOnRails
[14:32:23] The_Phoenix: has joined #RubyOnRails
[14:32:36] rabbai: well I have my rails app working fine but when one person is running a process and someone else tries to run the same or another process using the interface, it stalls and waits for the first task to complete before the app is free to do more. Also note the app calls shell scripts in the back end
[14:33:26] ellisTAA: has joined #RubyOnRails
[14:34:15] ruurd: has joined #RubyOnRails
[14:35:09] rabbai: @momomomomo thats what it does
[14:35:16] EdwardIII: hmm printing out the routing table shows this, but when i "curl localhost:300" i get 404? "root GET / root#index"
[14:35:27] EdwardIII: is it something to do with having the prefix 'root'?
[14:35:30] thither: Great, this is all working perfectly
[14:35:38] naftilos76: has joined #RubyOnRails
[14:35:46] rabbai: I was thinking multithreaded webserver would help so I tried using thin
[14:35:46] thither: I suppose it's much better than doing to_a on relations performance-wise
[14:35:51] momomomomo: rabbai: have you set thin up for multithreading? i.e. in your config file, "threaded: true"? Also, note that multithreading in thin is experimental
[14:35:54] momomomomo: rabbai: try Puma
[14:36:00] EdwardIII: in routes.rb i've got this which, i think, is pretty correct: root :to => 'root#index'
[14:36:20] rabbai: ahhhh ok cool I set multithreading to true, I will try puma also
[14:37:32] rabbai: so since the front end is calling shell scripts in the back end ... can that hinder the way things flow or do i set it up to just send the ssh request and drop it in the background or something?
[14:37:43] joshkovach: has joined #RubyOnRails
[14:38:07] dopie: has joined #RubyOnRails
[14:38:39] erich: has joined #RubyOnRails
[14:39:26] l_tonz: has joined #RubyOnRails
[14:42:17] umgrosscol: has joined #RubyOnRails
[14:43:38] jenrzzz: has joined #RubyOnRails
[14:44:54] tubbo: rabbai: one thing you might want to consider is to use background jobs to actually run those shell scripts in the backend. you don't want the system, I/O, whatever the script is doing, or anything else to stop the http request/response cycle.
[14:46:05] kitsuneyo: has joined #RubyOnRails
[14:46:14] Linuus: has joined #RubyOnRails
[14:47:10] rabbai: yeah tubbo thanks, I was looking at doing that today, it really bummed out on me yesterday. Another thing could be the output files I am redirecting to, maybe I should add something like time stamp to it so every call creates a new file to avoid clashes
[14:47:17] rabbai: I wil give it a try and see how that goes
[14:47:20] rabbai: thanks guys
[14:47:57] EdwardIII: ahh it seems "devise_for :users" breaks all routes that come underneath it heh nice
[14:48:15] senny: has joined #RubyOnRails
[14:48:47] dionysus69: is this syntax correct? background: image_path("sy-loader.gif")
[14:49:06] thither: Is there a way to set the page title from a send_data command?
[14:50:11] bePolite: has joined #RubyOnRails
[14:50:39] arBmind: has joined #RubyOnRails
[14:50:49] The_Phoenix1: has joined #RubyOnRails
[14:50:52] hephaestus_rg: has joined #RubyOnRails
[14:51:15] Kara: has joined #RubyOnRails
[14:52:29] bePolite: has joined #RubyOnRails
[14:52:53] MaDErroR123: has joined #RubyOnRails
[14:55:52] ellisTAA: anyone know why the nil part of my query isn???t working? @interviews = Interview.where("time > ? AND interviewer_id = ?", Time.now.utc, nil)
[14:57:24] bitsapien: has joined #RubyOnRails
[14:57:42] jkamenik1: has joined #RubyOnRails
[15:00:15] syzygy_: has joined #RubyOnRails
[15:00:23] hobodave: has joined #RubyOnRails
[15:02:02] wldcordeiro: has joined #RubyOnRails
[15:02:04] rabbai: @tubbo, that helped, the issue was the log file it was writing to. It kind of had a lock on it so I couldnt run the same process twice to write to the same file. I just appened time to the file name and now every session uses a different file and it works
[15:02:08] rabbai: thanks for your time
[15:02:34] shmilan: has joined #RubyOnRails
[15:03:16] Lightsword: has joined #RubyOnRails
[15:04:33] bePolite: has joined #RubyOnRails
[15:04:34] bePolite: has joined #RubyOnRails
[15:04:55] hfp: How can I count how many records were just created by my controller (it's not the same as the total number of records so Record.count won't cut it)?
[15:06:41] beauby: has joined #RubyOnRails
[15:09:55] ProLoser: has joined #RubyOnRails
[15:10:38] tubbo: rabbai: that'll do it :) another great reason to use a background job queue :)
[15:11:04] rabbai: yeah i was not thinking of that at all
[15:11:14] etrae: has joined #RubyOnRails
[15:12:29] helpa: hfp: 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:13:13] EminenceHC: has joined #RubyOnRails
[15:14:54] chouhoulis: has joined #RubyOnRails
[15:14:55] hfp: elaptics: https://gist.github.com/Coaxial/b65f0491b41c329f7cc9
[15:15:23] towski_: has joined #RubyOnRails
[15:15:56] GriffinHeart: has joined #RubyOnRails
[15:16:50] pwnd_nfsw: has joined #RubyOnRails
[15:16:51] kblake: has joined #RubyOnRails
[15:17:16] freezevee: has joined #RubyOnRails
[15:17:35] freezevee: has joined #RubyOnRails
[15:18:29] disgrntld: has joined #RubyOnRails
[15:18:38] elaptics: hfp: I presume .import is where you're creating several records?
[15:19:20] elaptics: hfp: is there a reason to have both a single create and an import to be in the same action? Why not just have two actions?
[15:19:30] kblake: has left #RubyOnRails: ()
[15:19:33] jenrzzz: has joined #RubyOnRails
[15:19:39] elaptics: one for a bulk import and a typical create action for the single?
[15:20:06] elaptics: Then, for the import one, I'd have the Model.import return how many were created
[15:20:12] suchness: Has anyone here found a good way to separate methods when using STI with ActiveRecord? I don't want my subclasses having a method just because the underlying table has it.
[15:20:26] n1lo: has joined #RubyOnRails
[15:20:31] elaptics: suchness: sounds like you don't want STI then
[15:20:44] hfp: elaptics: that makes sense, but how do I get the model to report that?
[15:21:03] elaptics: hfp: well it's your .import method. it can do what you like
[15:21:08] elaptics: hfp: what does it currently look like?
[15:21:14] Fire-Dragon-DoL: has joined #RubyOnRails
[15:21:20] suchness: I have users, they all have a name and an email, and a bunch of other things. I have a subclass of user, UserA, that has properties specific to only usera.
[15:21:43] roshanavand: has joined #RubyOnRails
[15:21:51] Peteykun: has joined #RubyOnRails
[15:21:52] hfp: elaptics: Ok, I thought there was a built in method. I'll try to do it myself and ask for more help if I get stuck
[15:23:08] suchness: elaptics: You are telling me that the scenario to use STI in means all your underlying db attributes for all subclasses are exactly the same?
[15:23:12] suchness: I don't buy it.
[15:23:29] elaptics: suchness: no, but if there are significant differences then it suggests that STI is not the best fit
[15:23:57] matthewd: suchness: I think the traditional solution is to just ignore the extra methods
[15:24:04] elaptics: e.g. if you have a load of attributes just for one subset and a different set for another subset such that most columns are null most of the time, then it suggests a different structure may be appropriate
[15:25:21] elaptics: for example maybe put the common things in a Person table and associate that with each different user type class
[15:25:50] elaptics: so you have a model for each different user type and they all have a has_one :person
[15:26:38] elaptics: if there aren't ridiculous numbers of attributes on person then you can simply delegate those methods to person in those classes
[15:26:44] rofi: has joined #RubyOnRails
[15:29:09] workmad3: suchness: btw "You are telling me that the scenario to use STI in means all your underlying db attributes for all subclasses are exactly the same?" <-- the answer there is 'yes'
[15:29:22] paolodoors: has joined #RubyOnRails
[15:29:27] tedi: has joined #RubyOnRails
[15:30:04] imp4t: has joined #RubyOnRails
[15:34:51] hfp: elaptics: My way doesnt work :( https://gist.github.com/Coaxial/246ec33e042d9b157bf5
[15:35:36] hfp: it doesn't show the count
[15:35:37] elaptics: hfp: instance variables don't span models and controllers
[15:36:04] elaptics: hfp: you need to return the @create_count from the model's import method
[15:36:21] elaptics: it doesn't need to be an instance variable either since it's just needed within that method
[15:36:34] hfp: elaptics: Do I `return create_count`? Will it be enough?
[15:36:39] polishdub: has joined #RubyOnRails
[15:36:48] elaptics: then you need to capture that in the controller
[15:36:58] elaptics: created_count = Model.import...
[15:37:11] siddart: has joined #RubyOnRails
[15:38:04] elaptics: hfp: bear in mind that your import could fail with a dodgy row of data so consider what happens in that scenario
[15:38:20] chopin: has joined #RubyOnRails
[15:38:45] elaptics: you will probably want to make sure that the whole import gets rolled back if anything fails
[15:40:12] dionysus69: has joined #RubyOnRails
[15:40:19] clamstar: has joined #RubyOnRails
[15:40:49] blackmes1: has joined #RubyOnRails
[15:41:39] blackmesa: has joined #RubyOnRails
[15:41:47] Moonlight-Angel: has joined #RubyOnRails
[15:42:35] MaDErroR123: has joined #RubyOnRails
[15:43:30] kristofferR: has joined #RubyOnRails
[15:44:28] shmilan: has joined #RubyOnRails
[15:44:42] jenrzzz: has joined #RubyOnRails
[15:44:49] abc: has joined #RubyOnRails
[15:45:44] lacuna: has joined #RubyOnRails
[15:45:49] ngscheurich: has joined #RubyOnRails
[15:47:44] Maletor: has joined #RubyOnRails
[15:47:48] decaff: has joined #RubyOnRails
[15:48:14] momomomomo: has joined #RubyOnRails
[15:48:26] decaff: do I need to define a method in the models to retrieve information from the database?
[15:48:54] senny: has joined #RubyOnRails
[15:49:12] Kara: has joined #RubyOnRails
[15:49:21] hobodave: has joined #RubyOnRails
[15:49:43] draig: has joined #RubyOnRails
[15:49:46] tubbo: decaff: depends on what information you want
[15:50:36] decaff: tubbo just the data from a field, so if I have a Tweet model with a field "tweet_text" I don't seem to be able to retrieve that field directly when I look at the methods available to me
[15:51:23] tubbo: decaff: oh yeah, that's true. ActiveRecord is an ORM and thus doesn't actually know what columns you have defined in the table your Tweet class is mapped to (which is probably 'tweets'). so if you tried to do Tweet.new.public_methods, you probably wouldn't see any of your fields.
[15:51:46] tubbo: decaff: however, if you did Tweet.all.first.tweet_text, it would not throw a NoMethodError, it would return the value of the 'tweet_text' column for that row in the database.
[15:51:53] suchness: workmad3: elaptics: Reevaluating my situation, I agree with you both.
[15:52:03] snockerton: has joined #RubyOnRails
[15:52:15] decaff: okay thanks tubbo
[15:52:22] tubbo: decaff: this is that 'meta-programming' thing you might have heard about before...AR::Base defines method_missing to look up that data from the DB if the method isn't already defined.
[15:52:34] [Butch]: has joined #RubyOnRails
[15:53:00] decaff: I'm used to django where this is all explicitly defined. In rails it seems parameters get passed around implicitly so I never really know what I'm working wth
[15:53:14] gusrub: has joined #RubyOnRails
[15:53:19] matthewd: In sufficiently recent releases, at least, it should be in public_methods after the first instance is created
[15:53:22] herbst: has joined #RubyOnRails
[15:53:47] rushed: has joined #RubyOnRails
[15:53:53] sunya7a: has joined #RubyOnRails
[15:55:07] n00bDev: has joined #RubyOnRails
[15:57:18] poikon: has joined #RubyOnRails
[15:57:24] big|bad|wolf: has joined #RubyOnRails
[15:58:24] big|bad|wolf: some help please. what is the best admin gem I can use?
[15:59:29] bruno-: has joined #RubyOnRails
[15:59:46] sarink: has joined #RubyOnRails
[16:01:36] senny: has joined #RubyOnRails
[16:02:43] smathy: has joined #RubyOnRails
[16:04:50] siddart: has joined #RubyOnRails
[16:05:12] momomomomo: has joined #RubyOnRails
[16:05:34] dstarh: has joined #RubyOnRails
[16:08:59] annlewis: has joined #RubyOnRails
[16:09:12] User458764: has joined #RubyOnRails
[16:12:30] shinnya: has joined #RubyOnRails
[16:13:09] htmldrum: has joined #RubyOnRails
[16:16:03] wldcordeiro: has joined #RubyOnRails
[16:16:29] rushed: big|bad|wolf: not using one, they're all bags of disappointment and misunderstanding which you might tolerate for a little while if you have other things to worry about~
[16:16:42] jamiejackson: has joined #RubyOnRails
[16:16:59] ijiijijjjijiij: has joined #RubyOnRails
[16:17:49] bePolite: has joined #RubyOnRails
[16:19:32] michaeldeol: has joined #RubyOnRails
[16:20:08] unreal: has joined #RubyOnRails
[16:20:24] doodlehaus: has joined #RubyOnRails
[16:22:00] smathy: Best admin gem: Rails.
[16:22:33] maletor_: has joined #RubyOnRails
[16:23:21] tubbo: i kinda wish there was an admin gem that would basically let me define what i want to do behind the scenes but gave me a "starting point" for which to create an admin
[16:23:42] tubbo: the issue with rails-admin and active_admin, as i see it, is that they attempt to be fully-featured admin solutions for all possible applications
[16:24:56] smathy: tubbo, AFAIC that's the scaffold generator.
[16:25:28] SteenJobs: has joined #RubyOnRails
[16:26:36] Dopagod: has joined #RubyOnRails
[16:27:58] Lightsword: has joined #RubyOnRails
[16:27:58] yardenbar: has joined #RubyOnRails
[16:29:36] jenrzzz: has joined #RubyOnRails
[16:34:48] ruurd: has joined #RubyOnRails
[16:35:38] Fire-Dragon-DoL: tubbo: what I really wanted from activeadmin, is not the entire thing they created (although some things are nice), but mostly the UI that auto-change based on permissions
[16:35:52] Fire-Dragon-DoL: that's really lovely, I'm too lazy to develop that part
[16:39:16] ritic: has joined #RubyOnRails
[16:39:35] Shoutsid: has joined #RubyOnRails
[16:41:12] User458764: has joined #RubyOnRails
[16:41:19] lytol_: has joined #RubyOnRails
[16:42:04] mary5030: has joined #RubyOnRails
[16:47:05] SeanLazer: has joined #RubyOnRails
[16:47:31] stannard: has joined #RubyOnRails
[16:47:32] cschneid_: has joined #RubyOnRails
[16:48:02] stannard: has joined #RubyOnRails
[16:48:06] roshanavand: has joined #RubyOnRails
[16:48:56] n00bDev: has joined #RubyOnRails
[16:50:34] momomomomo: has joined #RubyOnRails
[16:53:39] Jon30: has joined #RubyOnRails
[16:55:42] hephaestus_rg: has joined #RubyOnRails
[16:56:13] cnk: has joined #RubyOnRails
[16:56:36] bmalum: has joined #RubyOnRails
[16:56:53] dionysus69: has joined #RubyOnRails
[16:59:54] gusrub: has joined #RubyOnRails
[17:01:59] arup_r: has joined #RubyOnRails
[17:02:16] SeanLazer: has joined #RubyOnRails
[17:03:53] siaW: has joined #RubyOnRails
[17:05:36] jenrzzz: has joined #RubyOnRails
[17:06:17] ruurd: has joined #RubyOnRails
[17:06:43] cswelin: has joined #RubyOnRails
[17:07:49] Lincee: has joined #RubyOnRails
[17:08:04] Shoutsid: has joined #RubyOnRails
[17:08:18] thejamespinto: has joined #RubyOnRails
[17:09:02] User458764: has joined #RubyOnRails
[17:09:12] siaW: has joined #RubyOnRails
[17:09:14] thejamespinto: has left #RubyOnRails: ()
[17:09:19] thejamespinto: has joined #RubyOnRails
[17:09:27] thejamespinto: has left #RubyOnRails: ()
[17:09:32] thejamespinto: has joined #RubyOnRails
[17:10:05] annlewis: has joined #RubyOnRails
[17:10:54] bePolite: has joined #RubyOnRails
[17:11:13] awrfas2: has joined #RubyOnRails
[17:11:37] safety_cut: has joined #RubyOnRails
[17:12:31] siaW: has joined #RubyOnRails
[17:12:48] jenrzzz: has joined #RubyOnRails
[17:13:50] doodlehaus: has joined #RubyOnRails
[17:14:23] darkxploit: has joined #RubyOnRails
[17:14:39] djbkd: has joined #RubyOnRails
[17:15:15] mikecmpbll: has joined #RubyOnRails
[17:15:20] petricore: has joined #RubyOnRails
[17:17:14] Technodrome: has joined #RubyOnRails
[17:17:56] Technodrome: is there any good resources out there for showing the rails stack in action? Like what happens from the time somone request something up until the template render gives it back the response?
[17:18:02] kennyfrc: has joined #RubyOnRails
[17:18:12] siaW: has joined #RubyOnRails
[17:18:40] rushed: has joined #RubyOnRails
[17:18:41] kalusn: has joined #RubyOnRails
[17:19:04] PlasmaStar: has joined #RubyOnRails
[17:20:16] goodapollo: has joined #RubyOnRails
[17:20:24] smathy: Technodrome, not that I've ever seen.
[17:20:30] Or1on: has joined #RubyOnRails
[17:20:40] Technodrome: i would like a high level overview of that process
[17:22:45] elaptics: Technodrome: this is the only one I've seen http://railscasts.com/episodes/395-action-controller-walkthrough
[17:23:28] Technodrome: yeah, not that one, he goes way to indepth there
[17:23:41] ijiijijjjijiij: has joined #RubyOnRails
[17:24:05] siaW: has joined #RubyOnRails
[17:24:22] momomomomo: has joined #RubyOnRails
[17:24:23] matthewd: Technodrome: How high level do you want? Just the framework-user-visible parts?
[17:24:25] hephaestus_rg: has joined #RubyOnRails
[17:24:41] smathy: request -> router -> controller -> response
[17:24:52] Technodrome: i mean a bit lower than that :)
[17:24:59] smathy: So picky.
[17:25:07] smathy: Goldilocks.
[17:25:17] jenrzzz: has joined #RubyOnRails
[17:25:28] jobewan: has joined #RubyOnRails
[17:25:42] Technodrome: yeah i know, there was one for drupal i was reading a bit back and django which went sorta far in, without going over the functions themselves
[17:28:07] roshanavand: has joined #RubyOnRails
[17:28:19] siaW: has joined #RubyOnRails
[17:28:25] ProLoser: has joined #RubyOnRails
[17:30:06] imp4t: has joined #RubyOnRails
[17:31:11] arup_r: How in Rails you should make <a> without any href attr using link_to ? Any possibilities ?
[17:31:15] hephaestus_rg: has joined #RubyOnRails
[17:31:37] Kara: has joined #RubyOnRails
[17:31:45] elaptics: arup_r: what's the point of it being a link then?
[17:31:55] karam: has joined #RubyOnRails
[17:31:59] renegadeandy: is there a rails form helper for radio buttons, i cannot find one, i cannot do f.radio_field
[17:32:00] arup_r: elaptics: there is.. I am not stupid.
[17:32:12] elaptics: arup_r: which is?
[17:32:18] renegadeandy: there is radio_button_tag but that doesnt name the variable as I would expect
[17:32:53] elaptics: renegadeandy: f.radio_button
[17:33:55] arup_r: well, elaptics I have a link which opens a new form. But the button should open a form where somone will select at least one out of many items from a list of checkboxes. Otherwise I do want the link to be useless. Once someone will select a checkbox, I will put the url back to the href.
[17:34:24] arup_r: elaptics: makes sense.. ? href="#" is not helping.
[17:34:32] EminenceHC: has joined #RubyOnRails
[17:34:41] arup_r: it is making an anchor with current page url
[17:34:47] elaptics: arup_r: I was about to suggest "#"
[17:35:17] elaptics: if you're doing it all with javascript then just use a span tag and style it to look like a link and add your click events,etc as needed
[17:36:14] tubbo: Fire-Dragon-DoL: what do you mean "auto change based on permissions"?
[17:36:32] siaW: has joined #RubyOnRails
[17:36:38] renegadeandy: elaptics: so why does this not work : <%= f.radio_button :event, :quantity_type, "1-To-1", {class: "newevent input-radio check-radio",:required => true } %>1 to 1</label> -- it expects 4 params whuch im passing it
[17:36:50] rushed: has joined #RubyOnRails
[17:36:51] elaptics: tubbo: I assume something like = f.input :foo if current_user.admin?
[17:36:55] tubbo: Technodrome: you ever use RailsPanel? it tells you what view templates/models/controllers are being used in every request you make, and is implemented as a Chrome plugin
[17:37:30] User458764: has joined #RubyOnRails
[17:37:33] elaptics: renegadeandy: is event your model?
[17:37:40] Technodrome: yeah thats cool tubbo , but i was curious moree about the request to return process
[17:37:53] fedexo: has joined #RubyOnRails
[17:37:53] renegadeandy: elaptics: yeah
[17:38:10] elaptics: renegadeandy: drop the first arg then, so it's just f.radio_button :quantity_type, ...
[17:38:29] elaptics: renegadeandy: when you're using a form builder it knows about the object so you only need to specify the attribute it's for
[17:38:47] MaDErroR123: has joined #RubyOnRails
[17:38:48] renegadeandy: elaptics: awesome
[17:38:50] elaptics: renegadeandy: that's basically the difference between the form builder version and the plain helper methods
[17:38:53] Fire-Dragon-DoL: tubbo: stuff disappear if user cannot read/create/whatever a record or another, even "partially" (show some actions but not all, based on what you can do)
[17:38:55] elaptics: applies to them all
[17:38:57] renegadeandy: elaptics: thank you!
[17:39:16] greengriminal: has joined #RubyOnRails
[17:39:31] tubbo: Fire-Dragon-DoL: did you see elaptics' message above? `= f.input :foo if current_user.admin?`
[17:39:38] jenrzzz: has joined #RubyOnRails
[17:39:50] broman: has joined #RubyOnRails
[17:40:18] Contigi: has joined #RubyOnRails
[17:40:31] Kara: has joined #RubyOnRails
[17:40:45] elaptics: tubbo, Fire-Dragon-DoL: I'm assuming that it does that sort of behaviour "automatically". I.e. you specify which roles can access which attributes somewhere else and then the form is just f.input :this; f.input :that, and it'll hide/show them accordingly
[17:40:46] Fire-Dragon-DoL: elaptics: I missed the message but I was referring more to something like `= f.input :foo if can? :update_foo, @object`
[17:40:49] Contigi777: has joined #RubyOnRails
[17:40:49] broman: can someone help me? im new to ruby on rails... I want to do something like this: http://pastie.org/10484049 but arrays are different in this language
[17:40:50] adac: has joined #RubyOnRails
[17:41:12] elaptics: Fire-Dragon-DoL: yeah, you mean it's automatically using cancan or something similar?
[17:41:33] Fire-Dragon-DoL: elaptics: exactly, but it's not only that, it does that for menu items too: if you don't have read access for, let's say, User, it won't show you the menu, same for other stuff... It's not complicated to do, is just extremely boring
[17:41:52] tubbo: Fire-Dragon-DoL: when i need to do stuff like that, i write helper methods.
[17:41:54] madebymarkca: has joined #RubyOnRails
[17:41:59] Fire-Dragon-DoL: elaptics: well, no you have to tell it you use cancan, but sure it use the same interface (ducktyping for the win!)
[17:42:10] tubbo: Fire-Dragon-DoL: like i always write a nav_item method in a lot of my projects that tests whether the item is active and applies class: 'active' to the <li>
[17:42:21] elaptics: tubbo: +1, that's basically what I do
[17:42:25] siaW: has joined #RubyOnRails
[17:42:58] Fire-Dragon-DoL: yes I do that too, but that's really what I identify as "very boring" (no challenge in doing that, it's more or less simple stuff, nothing special)
[17:43:33] Fire-Dragon-DoL: I used activeadmin in a project which was 99% CRUD stuff AND permission stuff and it saved me, ages probably
[17:43:36] rakm: has joined #RubyOnRails
[17:44:26] tubbo: yeah me too, activeadmin worked very well for a long time. then we needed to do something activeadmin didn't do out of the box, and it took way longer than it should have.
[17:44:26] elaptics: boring yes, but no magic == easier maintenance
[17:44:29] SPYGAME: has joined #RubyOnRails
[17:44:41] tubbo: been working on an "admin gem" that looks a lot more like devise than AA
[17:45:02] tubbo: wherein you can just override views whenever you need to, and include functionality in the admin controllers
[17:45:32] broman: can someone help me? im new to ruby on rails... I want to do something like this: http://pastie.org/10484049 but arrays are different in this language... what can i do to accomplish that array attribution?
[17:45:47] roshanavand: has joined #RubyOnRails
[17:45:49] bePolite_: has joined #RubyOnRails
[17:46:00] DCameronMauch: has joined #RubyOnRails
[17:47:37] siaW: has joined #RubyOnRails
[17:47:39] Abhijit: has joined #RubyOnRails
[17:48:01] Abhijit: i am doing <%= form_for :pet_activity, url: user_pet_pet_activities_path(:user_id=>@current_user.id,:pet_id=>@current_user.pets.first.id) do |p| %> and it works iin dev. but in production it gives error undefined method id for nil nilclass? how come?
[17:48:21] tubbo: abhijit: @current_user is nil.
[17:48:43] Abhijit: how to troubleshoot this? why its nill? iit works in dev?
[17:49:00] workmad3: tubbo: could also be that the current user has no pets
[17:49:07] tubbo: oh yeah, that's true
[17:49:21] Abhijit: this error occurns only after adding pets.
[17:49:25] Abhijit: if 0 pets then no error.
[17:49:26] tubbo: abhijit: might wanna see what part of that line is causing the problem, whether it's @current_user or @current_user.pets.first
[17:49:44] Abhijit: tubbo, its on one line. how can i narrow search?
[17:50:58] big|bad|wolf: has joined #RubyOnRails
[17:51:10] jameswork: has joined #RubyOnRails
[17:51:48] tubbo: abhijit: i would just output both variables on two separate lines into the markup, one of them will throw an error and it will tell you what line that's on
[17:51:53] tubbo: "it" being the ruby server
[17:52:32] n008f4g_: has joined #RubyOnRails
[17:52:59] siaW: has joined #RubyOnRails
[17:54:38] siaW: has joined #RubyOnRails
[17:54:45] northfurr: has joined #RubyOnRails
[17:57:39] hobodave: has joined #RubyOnRails
[17:57:59] Abhijit: due to some reason my user_iid field it pets table in production is empty. but how come its not empty in my dev?
[17:58:06] Abhijit: thats my foreign key
[17:59:01] cnk: abhijit: Sounds like you have a data integrity issue
[17:59:06] tubbo: abhijit: two different databases
[17:59:15] tubbo: data is most likely going to be different...
[17:59:34] Abhijit: tubbo, yeah but on production i created new user. added new pets. then it should add data to table?
[17:59:37] baweaver: has joined #RubyOnRails
[17:59:47] Abhijit: cnk, will rake db miigrate solve it?
[17:59:53] broman: has joined #RubyOnRails
[17:59:56] cnk: Unlikely
[18:00:22] shoerain: has joined #RubyOnRails
[18:00:24] cnk: You need to log into your data base and compare 2 things - the table definitiions and the actual data
[18:00:45] shoerain: is there a way to list generated models and controllers from the command line? like `rails routes`
[18:00:47] mary5030: has joined #RubyOnRails
[18:00:53] Abhijit: does it being on heroku make in difference?
[18:01:18] cnk: not to having a data problem
[18:01:36] fahrradflucht2: has joined #RubyOnRails
[18:01:36] tubbo: shoerain: ls app/models && ls app/controllers
[18:01:38] cnk: you have something that let you get incorrect data in production
[18:01:59] shoerain: tubbo: oh fine
[18:02:07] shoerain: simple is easy I guess
[18:02:33] cnk: abhijit: What I would be focusing on is making sure you have not null constraints where you need them in your models
[18:02:57] Abhijit: right. let me fiix that.
[18:03:00] cnk: and then figuring out how to fix the data errors you have in production because the constraints were not in place
[18:04:00] mary5030: has joined #RubyOnRails
[18:06:45] simkessy: has joined #RubyOnRails
[18:06:56] Abhijit: thanks all. bye.
[18:06:58] smathy: ls app/{models,controllers}
[18:08:24] jenrzzz: has joined #RubyOnRails
[18:09:11] renegadeandy: CAn somebody help me with my attempt at a validation based on a condition : https://gist.github.com/renegadeandy/64a8b037cf0243364517 - its throwing the error you see
[18:09:22] User458764: has joined #RubyOnRails
[18:09:39] etrae: has joined #RubyOnRails
[18:10:15] elaptics: renegadeandy: you need to put it in a proc or lambda, e.g. unless: -> (r) { r.quantity_type == "1-To-1" }
[18:10:20] ducklobster: has joined #RubyOnRails
[18:10:38] baweaver: has joined #RubyOnRails
[18:10:52] annlewis: has joined #RubyOnRails
[18:11:31] renegadeandy: elaptics: its giving me a syntax error :unless -> (r) { r.quantity_type == "1-To-1"}
[18:11:49] elaptics: renegadeandy: you have the colon on the wrong side of the unless
[18:11:58] elaptics: I used the 1.9 hash syntax
[18:12:14] elaptics: or you could do :unless => -> (r) { r.quantity_type == "1-To-1"}
[18:12:35] Kara: has joined #RubyOnRails
[18:12:37] elaptics: or as a proc :unless Proc.new { |r| r.quantity_type == "1-To-1"}
[18:12:45] elaptics: oops that should be:
[18:12:55] elaptics: :unless => Proc.new { |r| r.quantity_type == "1-To-1"}
[18:13:32] renegadeandy: elaptics: how confusing!!!!!
[18:13:35] FailBit: people still write Proc.new ?
[18:13:41] elaptics: renegadeandy: which bit?
[18:13:45] renegadeandy: :unless => Proc.new { |r| r.quantity_type == "1-To-1"}
[18:13:50] renegadeandy: im not sure i follow it entirely
[18:13:51] htmldrum: has joined #RubyOnRails
[18:13:55] FailBit: proc{} syntax is fine
[18:13:56] renegadeandy: blocks and procs and lambdas confuse me in general
[18:14:07] deception1: has joined #RubyOnRails
[18:14:10] elaptics: renegadeandy: it takes a bit of getting used to at first
[18:14:13] FailBit: renegadeandy: they all capture scope
[18:14:19] FailBit: lambdas are procs
[18:14:25] FailBit: blocks are something else
[18:14:41] elaptics: renegadeandy: generally for those simple conditionals on validations I think most people will use the stabby lambda syntax now
[18:15:20] VeryBewitching: has joined #RubyOnRails
[18:15:36] jenrzzz: has joined #RubyOnRails
[18:15:47] tubbo: wait are lambdas actually Procs?
[18:15:50] tubbo: i thought they were different
[18:15:55] tubbo: in some stupid small way
[18:15:57] elaptics: they are different
[18:16:07] elaptics: return works differently
[18:16:28] elaptics: and how arity is handled
[18:16:48] cball: has joined #RubyOnRails
[18:17:01] VeryBewitching: Return in a lambda returns to the caller, return in a Proc returns out of the scope in which it was called.
[18:17:16] tubbo: the difference in the way `return` works is what i was thinking of
[18:17:35] netzfisch: has joined #RubyOnRails
[18:18:04] FailBit: Lambda.new # => says proc in the inspect output
[18:18:21] ikangiec: has joined #RubyOnRails
[18:18:25] decaff: http://dpaste.com/21AQ92Y anyone have any idea what might be going on here. Rails is trying to create a FK with a value that increments every time a request is made instead of using the value supplied by the url parameter like I am trying to specify?
[18:19:33] Technodrome: has joined #RubyOnRails
[18:19:42] tubbo: FailBit: right, but the difference between Proc and lambda is more functional than purely syntactical...contrasting that with the difference between `lambda {}` and `-> {}`.
[18:19:57] tubbo: which are just two ways of defining a lambda
[18:20:05] FailBit: ruby is weird...
[18:20:23] DEA7TH: has joined #RubyOnRails
[18:20:26] tubbo: FailBit: but yeah, i think every kind of "piece of code that can be executed later" that isn't a method or class inherits from Proc at the start.
[18:20:40] manfrin: has joined #RubyOnRails
[18:20:43] FailBit: blocks are interesting in that regard
[18:21:00] tubbo: one thing i don't like about ruby's syntax is how every method implicitly takes a block argumetn
[18:21:08] tubbo: never understood the point of that
[18:21:11] FailBit: also, modules can technically be executed as code
[18:21:29] FailBit: once required they can create ivars and stuff
[18:21:39] manfrin: has joined #RubyOnRails
[18:21:41] barhum2013: has joined #RubyOnRails
[18:22:24] tubbo: well, modules *are* code
[18:22:46] FailBit: everything is Class
[18:23:04] simkessy: Hey I'm having some trouble with some scopes I'm trying to create http://tinyurl.com/pdegkf2 I put the details in a stack question
[18:23:21] tubbo: FailBit: yeah, like you can programatically define modules by using Module.new
[18:23:51] tubbo: we do that in our 'decorator' framework that allows us to decorate classes (not like draper decoration, it actually prepends code into the definition of the object) using Module#prepend
[18:24:16] tubbo: kind-of a new way of inheritance that plays nicely with rails. pretty fun stuff :P
[18:24:19] joelsmith: has joined #RubyOnRails
[18:24:39] smathy: Precisely how I would always do "decoration" tubbo - works well.
[18:24:49] kramsee: has joined #RubyOnRails
[18:25:04] Dopagod: has joined #RubyOnRails
[18:25:13] renegadeandy: I wanted to thank everyone for your continued support - this community has helped me unimaginably! Thank you!
[18:25:40] bobbobbins: has joined #RubyOnRails
[18:25:42] tubbo: smathy: it's cool, but we've had some issues
[18:25:50] renegadeandy: For 10 points can somebody suggest a neater way to do this kind of thing in your view : https://gist.github.com/renegadeandy/c4db979fa58eb619804d
[18:26:12] tubbo: most notably when rails reloads code and it "misses" some decorators, causing weird loss of functionality. also spring gets a little annoying, every time you touch a decorated class it changes the ruby method cache and the footprint of your app, so you have to restart spring
[18:26:24] jenrzzz: has joined #RubyOnRails
[18:26:37] tubbo: i've been working 5 mins at a time here and there trying to figure out a way to make that better.
[18:27:21] siddart: has joined #RubyOnRails
[18:27:50] basiles: has joined #RubyOnRails
[18:29:11] EminenceHC: has joined #RubyOnRails
[18:30:21] smathy: tubbo, yeah, spring especially isn't good with non first-class Rails files.
[18:30:42] tubbo: which is weird to me..
[18:32:18] ikangiec: has joined #RubyOnRails
[18:32:56] renegadeandy: can anybody offer a nicer way to do my conditional form output!?
[18:33:03] manfrin_: has joined #RubyOnRails
[18:33:18] renegadeandy: ive read that rails should be 'say don't ask' but i don't know how ot apply that to this example
[18:33:37] joelsmith: has joined #RubyOnRails
[18:34:23] smathy: renegadeandy, OMG, come on now! You're trolling, surely?
[18:34:31] renegadeandy: smathy: im actually not!
[18:34:40] tubbo: renegadeandy: that's pretty vague
[18:34:51] safety_cut: has joined #RubyOnRails
[18:35:08] renegadeandy: i want to say to my form helper only have this attribute, IF this condition is true
[18:35:15] smathy: renegadeandy, the only difference between the two lines is :disabled=>true vs :disabled=>false and you want to know how to rewrite that instead of using an if block that uses <a condition that RETURNS TRUE OR FALSE> ????
[18:35:18] renegadeandy: witout having a conditional in the middle of the view
[18:35:26] blackmesa: has joined #RubyOnRails
[18:35:44] decaff: anyone know what might be going on with a bug I'm having? I'm trying to create an object in the database that has a foreign key pointing to the users table. So I find the user and assign it to the new object but instead of taking the id from the user it just uses an arbitrary integer that increments by 1 every time I attempt to make the request
[18:35:46] renegadeandy: smathy: it may be more of a syntax based question!?
[18:35:52] imp4t: has joined #RubyOnRails
[18:35:52] decaff: really driving me mad
[18:36:08] smathy: renegadeandy, come on, please tell me you're kidding here. I'm losing faith.
[18:36:12] tubbo: renegadeandy: what's the big deal with having a condition in the middle of the view?
[18:36:20] hephaestus_rg: has joined #RubyOnRails
[18:36:22] gusrub: has joined #RubyOnRails
[18:36:41] renegadeandy: smathy: lol! im not sure? I just wonder if there is a nicer more compact way to do it tubbo . smathy could i do this with a proc?
[18:36:55] ror15: has joined #RubyOnRails
[18:36:58] renegadeandy: smathy: I don't want to loose your faith but im not sure, hence why im asking.
[18:37:37] barhum2013: has joined #RubyOnRails
[18:37:44] smathy: renegadeandy, So, you have this statement `@event.quantity_type=="Group"` and you want: `:disabled => true` when it returns `true` and `:disabled => false` when it returns `false`.
[18:38:00] sunya7a: has joined #RubyOnRails
[18:38:11] SamGerber: has joined #RubyOnRails
[18:38:15] smathy: ACTION gets his hopes up
[18:38:25] renegadeandy: smathy: woudl this work : <%= f.radio_button :quantity_type, "1-To-1", {class: "newevent input-radio check-radio",:required => @event.quantity_type=="Group" } %>
[18:38:29] broman: has joined #RubyOnRails
[18:38:34] smathy: OMG, give it a try!
[18:38:38] tubbo: renegadeandy: !try
[18:38:38] helpa: renegadeandy: Why don't you try it and find out for yourself?
[18:38:41] renegadeandy: hahah ok ok ok
[18:39:21] tubbo: renegadeandy: but more importantly, you might be thinking of cleaning up your view by providing methods that will fill in the values based on a given condition
[18:39:44] tubbo: renegadeandy: like <%= f.radio_button :quantity_type, @model.value, class: @model.quantity_type_css, required: @model.is_quantity_type_required?
[18:39:54] tubbo: that looks a little nicer, right? :)
[18:39:59] ruurd: has joined #RubyOnRails
[18:40:12] tubbo: then you can test the values of those methods without needing to write a whole (slow) feature test and verify that the DOM has the correct classes and junk
[18:40:25] MaDErroR123: has joined #RubyOnRails
[18:40:34] tubbo: then, your feature tests are just testing whether content makes it on the page, as a kind-of last resort acceptance test after you've already built all your unit tests
[18:40:39] smathy: Btw, renegadeandy, from reading the gist it was not the :required attribute that varied between the two blocks.
[18:40:48] srinidhi: has joined #RubyOnRails
[18:40:59] renegadeandy: it was disabled smathy was a bad paste
[18:41:10] smathy: Ok, so did your new code work?
[18:41:40] ritic: has joined #RubyOnRails
[18:42:18] elaptics: Oooh the suspense :)
[18:42:35] siaW: has joined #RubyOnRails
[18:42:44] smathy: My very opinion of all humanity rests on this answer.
[18:42:46] roshanavand: has joined #RubyOnRails
[18:42:53] elaptics: no pressure then renegadeandy
[18:43:09] smathy: He's a renegade, he can handle it.
[18:43:30] ajb: Are there any opinions about phoeix?
[18:43:34] ajb: *phoenix
[18:43:35] renegadeandy: smathy: lol - embarassingly ... no
[18:43:38] renegadeandy: :disabled=> @event.quantity_type=="Group"
[18:43:45] smathy: decaff, !code please
[18:43:45] helpa: decaff: 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.
[18:43:46] renegadeandy: the conditional does return true or false
[18:43:58] kadoppe: has joined #RubyOnRails
[18:44:10] smathy: ...and you worked it out for yourself.
[18:44:16] smathy: My faith is restored.
[18:44:26] smathy: ajb, plenty, which one would you like?
[18:44:34] elaptics: high-fives all round :)
[18:44:40] Cervajz: has joined #RubyOnRails
[18:44:42] smathy: ACTION doesn't high five
[18:44:43] ajb: the good one?
[18:44:45] renegadeandy: smathy: im just surprised you can put some code like that in the middle of a helper and it all works. Im still quite new to this stuff
[18:44:51] renegadeandy: tubbo: and yes the model based version is nicer
[18:45:00] renegadeandy: im with you on that
[18:45:18] elaptics: renegadeandy: it's all just code :)
[18:45:21] smathy: Not new enough to be pulling that excuse out.
[18:45:23] mrchris: has joined #RubyOnRails
[18:45:27] renegadeandy: smathy: but who said ive been working on rails for 261 days ;)
[18:45:35] renegadeandy: smathy: awwww
[18:45:43] renegadeandy: smathy: hey....even renegades get tired smathy
[18:45:54] smathy: renegadeandy, so yeah, in ruby there are no statements, everything's an expression.
[18:46:13] smathy: (although in every language a boolean is an expression)
[18:47:01] elaptics: renegadeandy: it's why you don't need to use an explicit return at the end of a method for the result to be returned
[18:47:17] renegadeandy: elaptics: only just started doing that ;)
[18:48:03] dmarr: I am trying to use rspec-rails and I get the following warnings when i run `rspec spec`: warning: loading in progress, circular require considered harmful
[18:48:10] decaff: smathy helpa http://dpaste.com/2994AHS is dpaste okay? I prefer not to give out real id on irc. http://dpaste.com/3S5T3GX
[18:48:13] bmalum: has joined #RubyOnRails
[18:48:22] decaff: first link is to the code, second is to the error
[18:48:41] dmarr: basically i see warnings from all my dependencies in my gem dir
[18:48:54] dmarr: but i didn't think thy were deps that were actually loaded
[18:49:07] mrchris: im passing a view context into a presenter spec but the ApplicationHelper methods are not available. How can I load them?
[18:49:29] smathy: decaff, gist is hugely preferable, which is why it's mentioned in the TOPIC and the auto-response from the bot. But I'm looking at your dpaste URLs.
[18:49:55] n1lo: has joined #RubyOnRails
[18:50:04] zcreative: has joined #RubyOnRails
[18:50:10] decaff: smathy I'll use it next time.
[18:50:11] elaptics: __chris: !code
[18:50:11] helpa: __chris: 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.
[18:50:47] zcreative: Has anybody ever heard of Postgres (using active record) save 0.47 as 0.466666666666666666666 in the database using a decimal field?
[18:51:12] mrchris: this channel get less friendly by the day
[18:51:14] elaptics: zcreative: no
[18:51:40] Cervajz_: has joined #RubyOnRails
[18:52:07] mrchris: not all questions require code snippes
[18:52:14] elaptics: __chris: me using the bot as a shortcut doesn't mean I'm not being friendly
[18:52:28] elaptics: __chris: no, but it usually helps
[18:52:47] mrchris: if you dont know the answer to a question you can ignore it.
[18:52:50] elaptics: and when your question is specifically about something not working, then almost always the code helps
[18:53:12] smathy: decaff, ok so `f.follower_id = current_user.id` suggests that `current_user.id` is returning IDs that don't exist in your users table - assuming your fkey is correct.
[18:53:17] tubbo: __chris: we give you a lot of leeway when you start out asking in here because most people don't know the proper etiquitte. but we get tired of saying the same things to people over and over, hence the bot commands.
[18:53:20] elaptics: I can guess at some answers for you, e.g. have you explicitly tried requiring the helpers?
[18:53:30] smathy: decaff, and you're saying that each time it is run you see an incremented integer in the failure message from PG?
[18:54:04] tubbo: __chris: it would help a lot so we don't have to play 20 questions with you figuring out whether you're using e.g. Draper or your own view model library, or anything else that might get in the way.
[18:54:29] zcreative: decaff: i ran into this same problem yesterday. Just make sure your foreign_key and primary_key are correct where you are defining your relations
[18:54:38] tubbo: __chris: if you're using draper you need to use `h.your_helper_method` to access helper methods.
[18:54:51] decaff: smathy, yes, so I have tried also params[:user_id] and get the same problem, I have also tried just assigning a plain integer like "2" and it just gives the same incrementing integer.
[18:55:07] smathy: zcreative, not for a decimal, no.
[18:55:14] mrchris: its much faster to say "hey has any one ever encountered this?" rather than waste a bunch of time creating a gist with examples etc.
[18:55:20] decaff: zcreative, did you ever figure out where the integer is coming from?
[18:55:34] elaptics: __chris: faster for you, yes, but you're making the people you're asking for help work harder
[18:56:00] zcreative: I'm beginning to think my large decimal is just the way my postgres GUI is displaying it. AR is returning all the right values -- still strange
[18:56:01] smathy: decaff, and what if you do this in your rails console?
[18:56:29] elaptics: zcreative: how is your decimal defined in your schema?
[18:56:33] smathy: decaff, like f = Follower.new; f.follower_id = 2; f.save!
[18:56:44] zcreative: just default
[18:56:44] decaff: smathy I'll try hold on
[18:57:14] zcreative: its a float
[18:57:18] zcreative: default 0.0
[18:57:29] elaptics: zcreative: so not a decimal at all then :)
[18:57:35] elaptics: zcreative: there's your problem :D
[18:57:54] elaptics: zcreative: I hope you're not using this to hold currency values
[18:58:04] decaff: smathy it has the same issue
[18:58:09] zcreative: Football Fantasy points
[18:59:02] elaptics: zcreative: you're measuring the points that accurately? Isn't integer enough?
[18:59:22] elaptics: What do I get if I have 0.356 fantasy points?
[18:59:37] smathy: decaff, !gist your Follower model then please, and also copy-paste your rails console so I can see this happening in the console.
[18:59:37] helpa: decaff: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:59:49] smathy: decaff, !gist-usage seeing as you're new to it.
[18:59:49] helpa: decaff: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[18:59:54] zcreative: probably but i dont want to lose any accurecy. Its eventually deciding who wins money and who doesnt, so accurecy is still important
[19:00:18] arup_r: yes money is the thing comes end of the day
[19:00:21] elaptics: zcreative: you probably want to switch it to an actual decimal column then and set appropriate precision and scale on it
[19:00:32] zcreative: Yeah its what I'm looking into
[19:01:04] decaff: smathy https://gist.github.com/anonymous/5f7b1ebd812fa7c09bba there is the console
[19:01:58] decaff: smathy https://gist.github.com/anonymous/03ff0ed4408f7da03f9f there is the Follower model
[19:02:21] decaff: ignore the comments on the model I made those before I did anything with the app
[19:02:26] smathy: decaff, no, no, no. Same gist please, read the gist guide. Make my life easier.
[19:02:33] arup_r: hahaaaaaaa
[19:02:41] momomomomo: has joined #RubyOnRails
[19:03:05] arup_r: ACTION wants to share some coffee with smathy 
[19:03:32] decaff: smathy https://gist.github.com/anonymous/6ef91a057e99d3463369 okay same gist
[19:03:53] zcreative: Nice elaptics that fixed the problem.
[19:03:58] smathy: decaff, look back up, helpa sent you a link to how to use Gist properly.
[19:04:05] smathy: My life is too short, and my eyes are too old.
[19:04:21] elaptics: decaff: it's worth reading the gist guide properly. You can add multiple files to the gist and each one can have syntax highlighting applied accordingly
[19:04:58] sunya7a_: has joined #RubyOnRails
[19:05:55] decaff: smath elaptics https://gist.github.com/anonymous/88224d7e1c67f04512a5 better?
[19:08:18] Technodrome: tubbo: i guess you don???t really need to know the internals in the end, oh well lol
[19:08:19] elaptics: decaff: can you add your schema.rb to the gist? And your user model
[19:09:03] Dor: has joined #RubyOnRails
[19:09:26] decaff: working on it
[19:09:41] tubbo: Technodrome: huh?
[19:10:56] decaff: elaptics smathy https://gist.github.com/anonymous/eacf48e54f5ec92db1b6
[19:11:24] awrfas2: has joined #RubyOnRails
[19:11:39] annlewis: has joined #RubyOnRails
[19:12:17] sunya7a__: has joined #RubyOnRails
[19:12:21] bphogan: has joined #RubyOnRails
[19:12:22] jenrzzz: has joined #RubyOnRails
[19:12:31] greengriminal: has joined #RubyOnRails
[19:12:42] Emily: has joined #RubyOnRails
[19:13:38] artto: has joined #RubyOnRails
[19:14:20] rromanch_: has joined #RubyOnRails
[19:14:43] elaptics: decaff: I think you have your foreign key definition backwards
[19:14:46] smathy: dcope, column: "id" in your add_foreign_key should be column: "follower_id"
[19:14:50] pwnd_nsfw: has joined #RubyOnRails
[19:14:56] smathy: decaff, ^ (sorry dcope )
[19:15:02] h7br1x: has joined #RubyOnRails
[19:15:14] adac: has joined #RubyOnRails
[19:15:20] decaff: in which file? the schema?
[19:15:42] smathy: decaff, well, they'd have been in a migration at some point.
[19:15:43] elaptics: you'll need to create a new migration unless it's your latest one that added it and you could then redo it
[19:15:45] smathy: decaff, https://gist.github.com/anonymous/eacf48e54f5ec92db1b6#file-schema-rb-L72-L73
[19:16:24] ijiijijjjijiij: has joined #RubyOnRails
[19:16:27] decaff: smathy thanks, so what you're saying is that I want it to be "users", "followers"
[19:16:30] smathy: decaff, I think that foreign key is confusing Rails and so it's setting f.follower_id to the new Follower record's own primary key on save.
[19:16:41] decaff: so that followers points to users
[19:16:43] Lightsword: has joined #RubyOnRails
[19:16:43] honzahovorka: has joined #RubyOnRails
[19:16:51] smathy: decaff, no, I'm saying what I said.
[19:16:56] decaff: smathy, ahh okay that makes sense. thanks
[19:17:06] smathy: Ie. column: "id" in your add_foreign_key should be column: "follower_id"
[19:17:17] elaptics: i.e. what you've set to name
[19:17:34] elaptics: hence my backwards comment
[19:17:46] elaptics: which probably wasn't that clear looking back now :)
[19:18:18] decaff: okay, and in that case what does name refer to? can I omit it?
[19:19:08] scpike: has joined #RubyOnRails
[19:19:17] artto_: has joined #RubyOnRails
[19:19:27] baweaver: has joined #RubyOnRails
[19:20:00] decaff: actually I think I got it. smathy and elaptics thanks so much
[19:20:01] h7br1x: Hey guys, I want to have my app's layout change based on the domain used to access it. For example displaying a different logo if abc123.com or xyz456.com is used. Any suggestions? I found this stack overflow article but it's from 2011. http://stackoverflow.com/questions/6748168/changing-rails-3-apps-layout-based-on-the-hostname-domain-for-branding
[19:21:37] tubbo: h7br1x: that information hasn't really changed since then.
[19:22:05] tubbo: h7br1x: though i would still change that given code to gsub out anything other than the domain name
[19:22:25] tubbo: so in your case your layout names would be 'abc123.html.erb' or 'xyz456.html.erb', not 'abc123.com.html.erb'...
[19:24:46] broman: has joined #RubyOnRails
[19:25:25] FailBit: who writes code like this...
[19:25:28] FailBit: # Remove any and all notifications associated with an actor
[19:25:30] FailBit: def self.cleanup actor
[19:25:30] yfeldblum: has joined #RubyOnRails
[19:25:49] FailBit: the entire file is written with basically no parens
[19:25:53] FailBit: it's a nightmare
[19:26:42] h7br1x: tubbo: I'm still pretty green to rails, can you expand on this process a little?
[19:26:44] Technodrome: tubbo: i meant i gave up trying to see how the internals work
[19:27:28] judetucker: has joined #RubyOnRails
[19:28:11] djbkd: has joined #RubyOnRails
[19:28:37] tubbo: h7br1x: yeah, the `layout` method in ActionController::Base configures the layout that controller uses when rendering templates. if you pass it a block, it will execute the code in that block, which must either return a string of the layout name (e.g. 'application') or `false` if you don't want to render a layout (useful for xhr requests)
[19:29:00] tubbo: h7br1x: you can also pass it a symbol which refers to a method name, for which it will call when it needs the layout name, and that method should return a similar kind of value as the block
[19:31:04] sunya7a__: has left #RubyOnRails: ()
[19:31:18] sunya7a: has joined #RubyOnRails
[19:32:01] baweaver: has joined #RubyOnRails
[19:32:36] workmad3: has joined #RubyOnRails
[19:32:45] djbkd: has joined #RubyOnRails
[19:33:05] elaptics: FailBit: that's known as seattle style :)
[19:33:51] VeryBewitching: Technodrome: The internals of Rails?
[19:34:25] Technodrome: VeryBewitching: earllier I was looking for an article on how rails requst process works
[19:34:52] VeryBewitching: Technodrome: Read the source code. Learning about Rack is a good idea too.
[19:35:04] h7br1x: tubbo: Okay, I think I understand. Would you be able to give me an example of how to set it up in my application?
[19:35:22] nettoweb: has joined #RubyOnRails
[19:35:49] Technodrome: VeryBewitching: reading the rails source code would take me a month :)
[19:36:11] tubbo: h7br1x: absolutely. i have to do it in practically every app i make :) here's the method i use to determine what layout to serve -> https://github.com/tubbo/openishkur/blob/master/app/controllers/application_controller.rb#L35-L37, and here is the `layout` macro used to actually run that other method: https://github.com/tubbo/openishkur/blob/master/app/controllers/application_controller.rb#L16
[19:36:15] Technodrome: maybe a big stacktrace would be nice
[19:36:22] VeryBewitching: Technodrome: I can't promise it'll be worth your while, it depends on how much you need to know for what you're building.
[19:36:40] Technodrome: was just curious
[19:36:46] tubbo: Technodrome: oh i see what you mean, did you watch that railscasts about the action controller walkthrough?
[19:36:49] Technodrome: dont need it reall
[19:36:49] VeryBewitching: Technodrome: You can also run Rails through a debugger and inspect everything, I've learned some interesting stuff about Rails that way.
[19:36:53] tubbo: i thought that one was really interesting
[19:37:10] Technodrome: tubbo: yes, i did watch it, that helpeed
[19:37:14] towski_: has joined #RubyOnRails
[19:38:09] VeryBewitching: The only thing that makes Rails difficult to interpret is that there's a lot of meta-programming going on. Difficult to find the source files sometimes for methods as they made be included from a module, inherited from a class, dynamically defined.
[19:38:31] n008f4g_: has joined #RubyOnRails
[19:39:00] meoblast001: has joined #RubyOnRails
[19:40:01] h7br1x: tubbo: So then where would I define which layout is used for a domain?
[19:40:20] tubbo: h7br1x: there's only one place to define it, in the method
[19:40:25] TPBallbag: has joined #RubyOnRails
[19:41:51] isjaylee1: has joined #RubyOnRails
[19:42:59] isjaylee1: has left #RubyOnRails: ()
[19:43:00] ijiijijjjijiij: one thing that you can use is Class.instance_method(:method).source_location
[19:43:06] isjaylee1: has joined #RubyOnRails
[19:43:06] ijiijijjjijiij: Which helps find where to hone in. Also great for debugging gems.
[19:43:15] h7br1x: tubbo: So if I create a new layout in layouts/abc123.html.erb, when abc123.com is used it should that layout and if something else is used it will return the default application layout?
[19:44:23] isjaylee1: has left #RubyOnRails: ()
[19:44:28] IFrank00: Hi im trying for the first time to create a custom action that "cancel" when Hit cancel_task_path(task) I like to have a custom form with date and note.
[19:44:51] cball: has joined #RubyOnRails
[19:44:55] atmosx: Are there any freelancers here that have experience selling services from non-US to US companies?
[19:45:08] thither: Can I store the results of a conditional check into a variable? Rails isn't happy with: variable = (this != that)
[19:45:10] IFrank00: any guide or simple tutorial to get me going with this as I always have use the create and update action
[19:46:05] workmad3: thither: !code
[19:46:05] helpa: thither: 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.
[19:46:35] workmad3: thither: and that snippet doesn't count because that's perfectly fine ruby, so need to see your context
[19:46:59] thither: http://pastie.org/10484351
[19:47:09] ijiijijjjijiij: IFrank00: cancel creating or updating a model?
[19:47:32] IFrank00: updating a model
[19:47:40] workmad3: thither: local variables can't have a ? at the end
[19:47:47] thither: Okay thanks
[19:48:20] ijiijijjjijiij: thither: a couple of other things you could do are `should_validate` or turn `validate?` into a method
[19:48:30] IFrank00: ijiijijjjijiij, ill add the code
[19:50:01] [Butch]: has joined #RubyOnRails
[19:50:09] isjaylee: has joined #RubyOnRails
[19:50:11] SegFaultAX: I'm having one of those "I know how to do this in SQL but I'm having a hard time converting it to ORM" moments. Anyone care to help?
[19:50:24] SegFaultAX: Here's a mockup of the schema and query in question: https://gist.github.com/SegFaultAX/32ffb608b9bd8408e500
[19:51:58] Kara: has joined #RubyOnRails
[19:52:41] jun: has joined #RubyOnRails
[19:52:53] karam: has joined #RubyOnRails
[19:53:04] dmarr: what does activerecord::base.create! do?
[19:53:25] dmarr: for example flow = Flow.create! valid_attributes
[19:53:39] roshanavand: has joined #RubyOnRails
[19:54:22] FailBit: create and create! store the attributes and save a new record
[19:54:32] safety_cut: has joined #RubyOnRails
[19:54:32] FailBit: bang version raises exception on failure
[19:54:50] VeryBewitching: On validation error, more specifically.
[19:55:27] yardenbar: has joined #RubyOnRails
[19:56:45] Dreamer3: has joined #RubyOnRails
[19:57:02] alexhartley: has joined #RubyOnRails
[19:58:40] dmarr: looks like i hosed my migrations
[19:58:53] IFrank00: ijiijijjjijiij, https://gist.github.com/Frank004/9f4eb758fe313127cdff
[19:59:26] dmarr: i basically did a scaffold, ran the migrations, then decided to scaffold the same thing but specify name:string. i had to use --force and now the migrations don't run
[19:59:47] dmarr: i tried db:rollback but i think since the file was overwritten its not going to work
[20:00:34] isjaylee: dmarr: do you care about your data? if not, run rake db:migrate:reset
[20:00:47] isjaylee: dmarr: it'll basically clear out your entire database and rerun your migrations
[20:00:55] dmarr: thats fine :)
[20:01:03] IFrank00: ijiijijjjijiij, I know im over looking but can't find this simple task of updating the task and creating another one is the task gets update :/ I had it work with a form_tag but know I have to validate data so move it to a form_for and can't get the same result
[20:01:05] dmarr: i just don't see that task in my rake -T output
[20:01:09] isjaylee: dmarr: great, should work then. just make sure you don't have 2 scaffolds
[20:02:00] isjaylee: anyone here know of a way to override a gem's runtime dependency?
[20:02:10] dmarr: isjaylee++
[20:02:52] isjaylee: dmarr: that work for ya?
[20:03:11] ijiijijjjijiij: isjaylee: looking, confirmed reading
[20:03:14] dmarr: adding my db/ to git now:)
[20:03:17] ijiijijjjijiij: Sorry, meant that for IFrank00
[20:03:29] isjaylee: it's a great rake command. i do it all the time in development
[20:04:03] Radar: SegFaultAX: !rule10
[20:04:03] helpa: SegFaultAX: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[20:04:17] ijiijijjjijiij: IFrank00: Why not just have a simple link_to in the form?
[20:04:24] tubbo: h7br1x: well, you'd have to gsub out the '.com' stuff
[20:04:28] tubbo: h7br1x: but yeah
[20:04:34] FailBit: [11] pry(Notification)> User.where(id: notification.watcher_ids).only(:id).to_sql
[20:04:36] FailBit: => "SELECT \"users\".* FROM \"users\""
[20:05:03] IFrank00: ijiijijjjijiij, link_to the form ??
[20:05:13] CanTonic: has joined #RubyOnRails
[20:05:14] stannard: has joined #RubyOnRails
[20:05:40] ijiijijjjijiij: IFrank00: just an <a href> or a <%= link_to "cancel_path" %> or something, just anything that doesn't have <%= f.submit %>
[20:05:55] ijiijijjjijiij: IFrank00: unless you explicitly click the "submit form" button, you aren't submitting the form.
[20:06:21] dmarr: ijiijijjjijiij: why not use a normal nick
[20:06:36] tubbo: dmarr wins today
[20:07:34] EminenceHC: has joined #RubyOnRails
[20:07:36] ijiijijjjijiij: dmarr: this is my normal nick :(
[20:07:53] ijiijijjjijiij: dmarr: if it's causing clutter problems I'd be happy to change it
[20:07:57] h7br1x: tubbo: You lost me on that part lol
[20:08:03] safety_cut: has joined #RubyOnRails
[20:08:08] dmarr: ijiijijjjijiij: yeah it just looks kind of out of place
[20:08:43] dmarr: thanks! UhOhWendigo++
[20:08:47] smathy: FailBit, look at the only docs.
[20:09:09] Jon30: has joined #RubyOnRails
[20:09:23] h7br1x: tubbo: how would I test this locally?
[20:09:48] h7br1x: tubbo: I'm getting Your layout method :use_layout? returned application. It should have returned a String, false, or nil
[20:09:54] CanTonic: has joined #RubyOnRails
[20:10:07] tubbo: UhOhWendigo: incidentally, your name boils down to 'K' in binary.
[20:10:48] IFrank00: ijiijijjjijiij, Im look for 2 thing one learn how the update action work from scratch and the second I need to save one record and create another one by the system with one value form the pass record.
[20:10:50] tubbo: UhOhWendigo: `echo 'ijiijijjjijiij' | sed 's/i/0/g' | sed 's/j/1/g'`, ran that through an online converter.
[20:11:04] UhOhWendigo: tubbo: wish I could say that's intentional
[20:11:09] dmarr: oh cmon IFrank00
[20:11:28] tubbo: h7br1x: !gist it
[20:11:28] helpa: h7br1x: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:12:05] towski_: has joined #RubyOnRails
[20:12:34] annlewis: has joined #RubyOnRails
[20:12:59] h7br1x: tubbo: https://gist.github.com/ktdmedia/3cb83292dcd389408235
[20:13:39] tubbo: h7br1x: what is that? https://gist.github.com/ktdmedia/3cb83292dcd389408235#file-application_controller-rb-L26-L30
[20:13:57] momomomomo: has joined #RubyOnRails
[20:14:36] htmldrum: has joined #RubyOnRails
[20:14:57] dmarr: isjaylee: so if you ran a migration which just did a create, and then realized you wanted to insert some rows after running the migration, what do you do
[20:15:10] h7br1x: tubbo: It shouldn't be there anymore.
[20:15:40] isjaylee: dmarr: run that command again :)
[20:15:50] dmarr: isjaylee: i'd think i could run db:migrate:reset but that might be heavy-handed.
[20:16:05] isjaylee: dmarr: you could to a rake db:rollback
[20:16:06] dmarr: IFrank00: you were using his hold nick :p
[20:16:33] dmarr: isjaylee: and then add the data into the migration file before running it?
[20:16:40] diegoviola: has joined #RubyOnRails
[20:16:49] isjaylee: dmarr: yep. make your changes and then rake db:migrate
[20:16:56] tubbo: h7br1x: hmm, not sure. that definitely works for me (tubbo/openiskur is deployed to http://openishkur.herokuapp.com)...are you doing any other fancy thing reopening String or something?
[20:17:04] isjaylee: dmarr: if you're ever unsure about the status of your database, look in schema.rb
[20:17:29] qejk: has joined #RubyOnRails
[20:17:31] syzygy_: has joined #RubyOnRails
[20:17:41] h7br1x: tubbo: uhh.. no?
[20:17:42] isjaylee: dmarr: so do a rake db:rollback, look in your schema.rb to see that your newly created table is gone, make your changes, run rake db:migrate
[20:17:44] dmarr: IFrank00: *old nick
[20:18:00] bruno-: has joined #RubyOnRails
[20:18:16] dmarr: isjaylee: ok. i'm looking into this seed task now http://railscasts.com/episodes/179-seed-data
[20:18:17] tubbo: h7br1x: strange. your layout method is indeed returning a string.
[20:18:21] smathy: h7br1x, either you've pasted code that you're not running, or maybe you have spring running and it has cached a previous version of your code.
[20:18:37] tubbo: duh i should've known that :D
[20:19:01] smathy: In my mind I really have "could this be spring?" as an ever present question.
[20:19:01] h7br1x: wow, I feel stupid :P
[20:19:04] sunya7a_: has joined #RubyOnRails
[20:19:12] h7br1x: Fixed it lol
[20:19:25] smathy: h7br1x, don't, it gets the best of all of us. (well, unless you pasted not-your-code, then yes, feel stupid)
[20:19:31] IFrank00: dmarr, did not see it lol
[20:19:45] tubbo: smathy: yeah i have a "bag of errors" that happen on my app instantly that i know are caused by spring
[20:19:51] manfrin: has joined #RubyOnRails
[20:19:56] brandonshowers: has joined #RubyOnRails
[20:20:00] tubbo: like "unitialized constant <some-code-i-just-wrote>" or "undefined method <method-i-made> for <vendored-class>"
[20:20:23] tubbo: h7br1x: join the feel stupid club :D
[20:20:27] tubbo: i'm right there with you
[20:20:28] h7br1x: smathy: It was the latter
[20:20:28] smathy: I actually just always stop spring before running my full test suite.
[20:20:56] UhOhWendigo: has left #RubyOnRails: ("WeeChat 1.3")
[20:21:02] smathy: h7br1x, I'll choose to believe the latter of my first comment, so it was spring. Yay!
[20:21:02] rhizome: innovation!
[20:21:06] pvac: has joined #RubyOnRails
[20:21:21] smathy: (what game are we playing?)
[20:21:33] rhizome: the how-awesome-is-spring game
[20:21:35] h7br1x: smathy: That is correct.
[20:21:44] smathy: Heh, that'll be a short game ;)
[20:21:54] smathy: h7br1x, good one.
[20:21:58] jkamenik: has joined #RubyOnRails
[20:22:08] h7br1x: Thanks, I try.
[20:22:19] petricore: has joined #RubyOnRails
[20:22:59] smathy: When there's an exception in a file in your app, spring should rescue that, reload the app, and then raise its own "ProbablySpringError: 'just try again before worrying'" exception.
[20:23:26] maxx88: has left #RubyOnRails: ()
[20:23:33] tubbo: smathy: how does spring know when it
[20:23:41] tubbo: is a real problem vs. a spring reload problem?
[20:24:16] smathy: tubbo, it doesn't, it'd have to show the full stacktrace from what it rescued.
[20:24:42] smathy: ...so the second time you run it you'd know to actually start investigating :)
[20:24:44] tubbo: smathy: i'd rather bin/spring stop all the time than have to deal with the exact same backtrace every time
[20:24:53] workmad3: tubbo: spring could just assume it's shitted something up, reload and raise that... if the next request raises the same error, spring goes "Nope, not me, dumbass"
[20:25:23] smathy: Yeah, if you wanted to get even trickier it could track that state ^
[20:25:47] smathy: ...I was just thinking it'd always do the same thing, so all exceptions would have one spring line at the top of the trace.
[20:26:09] smathy: ...at the very least you're being reminded that it's running ;)
[20:26:34] NBarnes: has joined #RubyOnRails
[20:26:39] tubbo: so i have a question...why does spring break all the time, but watchman/ember-cli/livereload seems to reload my pages whenever i make changes?
[20:26:40] podman: has joined #RubyOnRails
[20:26:45] tubbo: what are we doing wrong? :)
[20:27:11] workmad3: tubbo: we're assuming code is something that we can reload in place, rather than just trashing the entire current state and reloading everything
[20:27:28] tubbo: yeah see that's the issue
[20:27:34] h7br1x: tubbo: so where am I supposed to set that gsub part?
[20:27:38] tubbo: but we can't just trash the current state and reload again i assume
[20:27:44] workmad3: tubbo: also, I don't think spring lets you configure the rules that cause it to issue a restart, which is a PITA at times too
[20:28:05] workmad3: tubbo: we can, but that means that we reload rails... and rails has shit startup time, which is the problem spring (badly) solves
[20:28:45] tubbo: h7br1x: well, if you're just outputting `request.host` as the layout name, it's going to return "abc123.com", and you want "abc123" because i think that '.com' will fuck with ActionView...
[20:28:54] dmarr: is there a way to slugify a string? like 'Login/Signup' -> 'login-signup'
[20:28:56] momomomomo: has joined #RubyOnRails
[20:29:16] workmad3: tubbo: and because rails has crap startup time, we've gone through a series of preloading app servers that attempt to solve the same problem, with the latest one being pulled into rails as a 'default' rather than trying to sort out trying to speed up load times for tests
[20:29:19] tubbo: h7br1x: so to perform a string substitution based on a regex, you'd use the gsub method (http://ruby-doc.org/core-2.1.4/String.html) on the String that request.host returns
[20:29:43] tubbo: workmad3: i only know of two...zeus and spring.
[20:29:52] workmad3: tubbo: there was also spork
[20:29:56] tubbo: yeah that's the part i think is the most irritating about spring
[20:30:05] tubbo: i forgot about spork because it broke all the damn time ;)
[20:30:18] workmad3: I find it really telling that the only time I ever had a stable spork config was when I used guard-spork and let *that* handle it :)
[20:30:23] maxx88: has joined #RubyOnRails
[20:31:21] smathy: dmarr, .parameterize
[20:31:41] Scripore: has joined #RubyOnRails
[20:31:51] tubbo: i like spring though, it does make my rails app run ultra-fast
[20:32:04] smathy: Me too, for all its warts.
[20:32:24] blackmesa: has joined #RubyOnRails
[20:32:29] dmarr: thanks smathy++
[20:32:31] smathy: What has to happen is that a Rails app has to be able to (without unloading Rails) re-load a given app at runtime.
[20:32:35] smathy: dmarr, you're welcome.
[20:32:57] smathy: I think most people could wear their own app's load time. It's just Rails that's annoying.
[20:33:16] rhizome: does it come in pinstripes?
[20:33:36] workmad3: smathy: oh, you mean like passenger and unicorn can achieve by loading rails into a master process and forking before loading the app? :)
[20:34:01] ruurd: has joined #RubyOnRails
[20:34:01] tubbo: workmad3: but not as naive as that...smarter. reload the app, not the gems that surround the app
[20:34:09] tubbo: here's the problem: how do you know what came from a gem and what came from the app?
[20:34:32] tubbo: feels like we need rb-fsevent at some point, in order to detect exactly where a change took place so spring can determine whether the app needs to be reloaded.
[20:34:37] SteenJobs: has joined #RubyOnRails
[20:34:48] tubbo: but right now spring just reloads any files when it happens to come across them
[20:35:09] smathy: It doesn't use fsevents ?
[20:35:15] jenrzzz: has joined #RubyOnRails
[20:35:17] artto: has joined #RubyOnRails
[20:35:44] workmad3: tubbo: well, the fun bit there is that rails handles all your app loading, and provides hooks for some of that prior to loading your app... so you could either a) load the bundle in a master process and fork before delegating to rails or b) hook into one of rails' hooks prior to your app being loaded at all, and do clever forking at that point
[20:36:25] tubbo: per-request app forking ftw
[20:36:34] tvw: has joined #RubyOnRails
[20:36:38] centrx: has joined #RubyOnRails
[20:36:56] SegFaultAX: Is there a shorthand for doing `Foo.select("foos.*")` if I'm going to have multiple #select calls?
[20:36:57] workmad3: oh damn, now I've thought about it, I kinda want to play with those ideas :(
[20:37:28] rakm: has joined #RubyOnRails
[20:37:43] baweaver: has joined #RubyOnRails
[20:37:52] smathy: Oh, look at that: https://github.com/jonleighton/spring-watcher-listen
[20:38:00] rhizome: SegFaultAX: you mean like Foo.all?
[20:38:30] SegFaultAX: rhizome: No I mean like Foo.select("foos.*").joins(otherthing).select("otherthing.bar")
[20:38:47] dideler: has joined #RubyOnRails
[20:38:48] SegFaultAX: If I omit the first select then the foos.* columns won't be in the projection.
[20:39:14] unreal_: has joined #RubyOnRails
[20:39:16] rhizome: i don't understand
[20:39:18] workmad3: a bundle preloader could be quite easy too... it's much easier to tell when a bundle needs to reload, you just watch for changes to Gemfile.lock
[20:39:32] rhizome: shocking resemblance to guard
[20:39:56] smathy: In that it watches for changes?
[20:40:32] SegFaultAX: rhizome: What don't you understand?
[20:40:40] smathy: That's where the similarity starts and ends though.
[20:40:43] rhizome: SegFaultAX: the what and the why
[20:41:21] rhizome: smathy: https://github.com/mknapik/guard-spring
[20:41:28] manfrin: has joined #RubyOnRails
[20:41:38] rhizome: i'm only half paying attention tho. apols for irrelevance
[20:42:01] tubbo: neat rhizome
[20:42:06] tubbo: sorry, smathy
[20:42:16] smathy: For what?
[20:42:53] isjaylee: has left #RubyOnRails: ()
[20:43:07] tubbo: the spring-watcher-listen link, looks cool
[20:43:32] smathy: Oh, you were redirecting your "neat" :)
[20:44:21] smathy: ...and yeah, it's better than polling. Still doesn't solve the other issues though.
[20:44:24] h7br1x: tubbo: After reading that section on gsub I'm even more confused lol. But I tried naming the layout with and without .com, but it doesn't load the layout either way.
[20:44:26] smathy: I didn't know spring polled.
[20:44:28] smathy: Stupid spring.
[20:44:34] avemestr_: has joined #RubyOnRails
[20:45:44] dmarr: not sure why but following this example, the Fixtures.create_fixtures call fails here: http://railscasts.com/episodes/179-seed-data
[20:45:52] smathy: I've often thought that if restarting spring pissed me off enough then I'd just use guard to do it for me when needed. Not sure what that guard-spring plugin does.
[20:46:09] smathy: dmarr, you pasted the wrong URL?
[20:46:14] baweaver: has joined #RubyOnRails
[20:46:31] dmarr: that last line fails on: NameError: uninitialized constant Fixtures
[20:46:51] dmarr: see in their db/seeds.rb example
[20:47:40] aquiles: has joined #RubyOnRails
[20:48:06] workmad3: dmarr: you mean in the 6 year old railscast from before ActiveRecord properly namespaced stuff it was introducing?
[20:48:35] dmarr: thats how i'm getting all my info
[20:48:36] workmad3: dmarr: and maybe try it with the version of rails they're using before claiming it's broken too ;)
[20:48:39] smathy: dmarr, oh right. Yeah, Fixtures didn't make it into Rails 4
[20:48:43] Rixius: has joined #RubyOnRails
[20:48:50] workmad3: `When you create a Rails application under Rails 2.3.4`...
[20:49:14] smathy: I think that, more than anything, led to Ryan's burnout(s).
[20:49:26] MartinElvar: has joined #RubyOnRails
[20:49:49] tubbo: turns out it *is* possible to care too much
[20:49:53] workmad3: smathy: constant emails saying "Why doesn't X work?" about railscasts that are 2 or 3 major versions out of date?
[20:49:54] bonhoeffer: has joined #RubyOnRails
[20:50:02] dmarr: don't see too much recent seeding info
[20:50:32] MaDErroR123: has joined #RubyOnRails
[20:52:00] bonhoeffer: has joined #RubyOnRails
[20:52:06] sunya7a: has joined #RubyOnRails
[20:53:09] jun: has joined #RubyOnRails
[20:54:52] tubbo: dmarr: it's one of those "ehh we'll get to it later" problems
[20:55:27] karam: has joined #RubyOnRails
[20:55:27] Kara: has joined #RubyOnRails
[20:55:29] pwnd_nsfw: I hate how, most of the time, I'm able to study something, but when it goes to actually applying it
[20:55:35] aquiles: has joined #RubyOnRails
[20:55:37] pwnd_nsfw: I have nfi what I'm doing
[20:55:40] dmarr: heh.. my test and dev db are both postgres, and im trying to think if i'd even be able to use fixtures
[20:55:51] hephaestus_rg: has joined #RubyOnRails
[20:56:07] tubbo: pwnd_nsfw: maybe you should study less and apply more
[20:56:14] tubbo: dmarr: sure, why not?
[20:56:18] neanderslob: has joined #RubyOnRails
[20:56:22] tubbo: i use fixtures and pg
[20:56:24] dmarr: pwnd_nsfw: as abraham lincoln said 'Give me 6 hours to chop down a tree, I'll spend the first 4 sharpening my axe'
[20:56:26] snockerton: has joined #RubyOnRails
[20:56:37] workmad3: tubbo: do you use fixtures as the basis for your db/seeds.rb file though? :)
[20:56:53] workmad3: dmarr: for some reason I've heard that attributed to washington, not lincoln
[20:57:01] dmarr: workmad3: well i was just trying to generate them into my specs/fixtures folder
[20:57:07] dmarr: *spec/fixtures
[20:57:17] pwnd_nsfw: tubbo, the applying part is where I get stuck :p
[20:57:26] pwnd_nsfw: I'll get thre though;
[20:57:36] dmarr: tubbo: it would make sense for the specs to use them instead of the real db
[20:57:53] dmarr: 'im getting to that'
[20:58:11] ruurd: has joined #RubyOnRails
[20:58:12] dmarr: workmad3: nice, i've been misquoting lincoln all week
[20:58:16] Technodrome: has joined #RubyOnRails
[20:58:33] slash_nick: "where's my top hat, i'm going to the movies" - lincoln
[20:58:53] dmarr: https://www.brainyquote.com/quotes/quotes/a/abrahamlin109275.html workmad3 it was lincoln
[20:59:00] tubbo: workmad3: i do
[20:59:14] pwnd_nsfw: Wondering if, until I get fluent, I should write code then tests..
[20:59:16] workmad3: dmarr: fair enough :) I'm british anyway
[20:59:19] pwnd_nsfw: Trying to focus on BDD.
[20:59:31] arBmind: has joined #RubyOnRails
[20:59:39] dmarr: "You Can't Believe Most of the Quotes You Read On the Internet" -Abraham Lincoln
[20:59:39] pwnd_nsfw: Feels most natural to me, but I think where I get fucked up on is what to test.
[21:00:47] pwnd_nsfw: "I'm the king, baby" - Duke Nukem
[21:00:49] siddart: has joined #RubyOnRails
[21:01:01] slash_nick: pwnd_nsfw: pretty sure that one was lincoln too
[21:01:34] ritic: has joined #RubyOnRails
[21:02:27] momomomomo: has joined #RubyOnRails
[21:02:34] slash_nick: "all i want to do is be more like me and less like you" - also lincoln
[21:04:15] safety_cut: has joined #RubyOnRails
[21:06:25] pwnd_nsfw: "No, I don't want no scrub" - Abraham Lincoln
[21:06:46] EminenceHC: has joined #RubyOnRails
[21:09:00] duderonomy: has joined #RubyOnRails
[21:09:45] wethu: has joined #RubyOnRails
[21:09:48] slash_nick: "many years ago prince darkness stole one of the triforce power" - lincoln
[21:10:12] safety_cut: has joined #RubyOnRails
[21:10:25] Pazician: has joined #RubyOnRails
[21:11:20] blackmesa: has joined #RubyOnRails
[21:11:31] etrae: has joined #RubyOnRails
[21:11:47] rhizome: now you've gone too far
[21:13:10] smathy: workmad3, yeah, not sure he ever put things like the version/currency up in people's faces enough.
[21:13:12] annlewis: has joined #RubyOnRails
[21:13:57] hephaestus_rg: has joined #RubyOnRails
[21:16:25] pwnd_nsfw: "You're dereferencing a nullpointer" - Abraham Lincoln
[21:18:08] safety_cut: has joined #RubyOnRails
[21:18:44] Radar: GOOD MORNING
[21:20:04] pwnd_nsfw: Got in there just in time
[21:20:26] workmad3: Radar: good evening
[21:25:48] Pazician: has joined #RubyOnRails
[21:26:31] ellisTAA: has joined #RubyOnRails
[21:27:13] ellisTAA: when i go to ???.com/users/<%= @user.id %>/interviews/all??? on localhost, it works, but when i go to it on my production site i get a 404 ??? anyone have a guess as to why?
[21:28:05] shinnya: has joined #RubyOnRails
[21:28:33] gusrub: has joined #RubyOnRails
[21:28:59] djbkd: has joined #RubyOnRails
[21:31:02] mary5030: has joined #RubyOnRails
[21:31:04] ritic: has joined #RubyOnRails
[21:33:21] sunya7a_: has joined #RubyOnRails
[21:33:23] yfeldblum: has joined #RubyOnRails
[21:33:38] ellisTAA: the file exists on the server, and the route exists ...
[21:35:54] artto: has joined #RubyOnRails
[21:36:24] NBarnes: I'm updating a site from Rails 3 to Rails 4, and doing so appears to have thrown all the work I did on positioning HTML elements via CSS offsets off. Is that something Rails 4 did? (It would be baffling to me that the change to Rails 4 made all my CSS layouts go cattywumpus).
[21:37:22] Shoutsid: has joined #RubyOnRails
[21:37:35] safety_cut: has joined #RubyOnRails
[21:37:38] nyaa: has joined #RubyOnRails
[21:38:57] Lightsword: has joined #RubyOnRails
[21:39:34] Radar: EllisTAA: Check the logs on the production server?
[21:39:45] Radar: EllisTAA: And what file are you talking about?
[21:39:52] ellisTAA: Radar: the html file
[21:39:55] Radar: nbarnes: Rails 4 would not do that
[21:40:04] Radar: EllisTAA: That is only 1% less vague than your original statement
[21:40:36] ellisTAA: i am using puma
[21:40:51] Radar: > Radar says statement is vague
[21:40:56] Radar: > EllisTAA refuses to clarify
[21:41:24] NBarnes: Radar; yeah, I pretty much figured. I must have changed something else somewhere.
[21:41:34] NBarnes: Not that I can figure out where. >_<
[21:41:57] Technodrome: has joined #RubyOnRails
[21:44:44] ellisTAA: Radar: so according to my logs, it says it cant find user 2, who i deleted because it was a dummy account ???.
[21:45:38] Radar: EllisTAA: So why are you trying to access that user?
[21:45:52] ellisTAA: Radar: i???m not ???
[21:45:58] Radar: ACTION sighs
[21:46:09] ellisTAA: lol but for some reason it???s trying to let me check
[21:46:13] Radar: I am tired of playing 20 questions with you
[21:46:26] Radar: Give me the answers to the questions I ask, or I will put you on /ignore with everyone else who does the same.
[21:46:55] Radar: Give us all the information that you have so that we can help you debug the problem
[21:47:03] Radar: Show the logs for the request from production.log
[21:47:19] Radar: Give us the EXACT path to the html file, rather than just saying "HTML file" because that's extremely vague.
[21:47:25] Radar: Help us help you.
[21:48:50] djbkd: has joined #RubyOnRails
[21:49:43] SteenJobs: has joined #RubyOnRails
[21:51:06] wcalderipe: has joined #RubyOnRails
[21:51:26] ellisTAA: Radar: i???m a noob, be a patient, ill get there. but thanks for offering to help, i ended up figuring it out.
[21:51:39] Radar: I thought that had been longer.
[21:51:40] Radar: Like 600 days
[21:52:07] djbkd: has joined #RubyOnRails
[21:52:17] ellisTAA: in december ill be programming for a year, so hopefully ill be better
[21:55:27] Jon30: has joined #RubyOnRails
[21:55:43] Coldblackice: has joined #RubyOnRails
[21:56:29] roshanavand: has joined #RubyOnRails
[21:56:55] paolodoors: has joined #RubyOnRails
[21:59:34] djbkd: has joined #RubyOnRails
[21:59:39] safety_cut: has joined #RubyOnRails
[22:03:03] Kara: has joined #RubyOnRails
[22:03:24] tfitts: has joined #RubyOnRails
[22:03:30] nettoweb: guys Im following a taturial on how to setup rails+nginx+unicorn on ubuntu on DO... and I always get this error: [crit] 1053#0: *12 connect() to unix:/home/deployer/apps/events/current/tmp/sockets/unicorn.events.sock failed (13: Permission denied) while connecting to upstream,
[22:03:41] nettoweb: Im following this guide: https://gist.github.com/ChuckJHardy/f44dda5f94c6bbdba9a4
[22:04:17] nettoweb: I dont know why it's happening because the PIDs an sockets files were created by capistrano with the command: cap production deploy:check and then cap production deploy
[22:05:05] njero: has joined #RubyOnRails
[22:06:34] kayloos: has joined #RubyOnRails
[22:07:19] avemestr: has joined #RubyOnRails
[22:07:59] wldcordeiro: has joined #RubyOnRails
[22:08:04] beingjohnm: question, I want to create an in-app help system. If I'm on such-and-such page it will show the help text assoicated with that page. I'm thinking I should create a model and a controller for that. Any ideas on database fields? Trying to think through the problem by talking out loud.
[22:08:18] htmldrum: has joined #RubyOnRails
[22:08:34] ritic: has joined #RubyOnRails
[22:09:22] Grundell: has joined #RubyOnRails
[22:09:23] djbkd: has joined #RubyOnRails
[22:09:49] baweaver: has joined #RubyOnRails
[22:10:34] smathy: beingjohnm, you sure it isn't just a shared directory of partials?
[22:10:47] tweeeaks: has joined #RubyOnRails
[22:11:00] beingjohnm: smathy: is that how you would handle?
[22:11:02] kalusn: has joined #RubyOnRails
[22:11:24] smathy: beingjohnm, in vanilla Rails, yes.
[22:11:36] tweeeaks: has left #RubyOnRails: ()
[22:11:42] tweeeaks: has joined #RubyOnRails
[22:11:54] jessemcgilallen: has joined #RubyOnRails
[22:11:59] beingjohnm: smathy: I could definitely do that but was thinking storing the data in the db would be more flexible long term. Though I really don't need to be thinking long term now.
[22:12:22] beingjohnm: smathy: btw, heroku was seriously easy to get going on. Thanks.
[22:12:50] smathy: beingjohnm, but then I'd be thinking I'd probably want help to be more fine grained than just a controller/action level. Like help at different parts of the one page, so that's why my mind goes instantly for putting it in the views, which leads me to take the next logical step and put the content itself in partials.
[22:13:01] smathy: beingjohnm, yeah, it's great for getting a demo up and running quickly.
[22:13:58] annlewis: has joined #RubyOnRails
[22:14:00] PlasmaStar: has joined #RubyOnRails
[22:14:05] artto: has joined #RubyOnRails
[22:14:36] beingjohnm: I think you're right. I can put the help content in the main views and then pass it onto the partial. That way I'm keeping the content with what I'm creating and not forgetting about it.
[22:15:07] iamayam: has joined #RubyOnRails
[22:15:27] smathy: Yep, and being partials makes them easier to style if you need to bold something, or add a link.
[22:15:40] smathy: (vs storing them in your DB)
[22:16:16] beingjohnm: True. Going to get started on this right now. Thank you.
[22:17:13] riotjones: has joined #RubyOnRails
[22:17:39] rromanch_: has joined #RubyOnRails
[22:17:41] wcalderipe: has joined #RubyOnRails
[22:17:46] skweek: has joined #RubyOnRails
[22:21:54] Lytol: has joined #RubyOnRails
[22:21:54] cornerma1: has joined #RubyOnRails
[22:22:51] dstarh: has joined #RubyOnRails
[22:23:02] ror15: has joined #RubyOnRails
[22:23:43] ikangiec: has joined #RubyOnRails
[22:25:19] bollullera: has joined #RubyOnRails
[22:27:17] patrick99e99: has joined #RubyOnRails
[22:28:10] rickmasta: has joined #RubyOnRails
[22:28:28] patrick99e99: hey rails buddies....................... Is this a bug?????????? If I do: Foo.joins(:bars).order('lower(bars.baz)').to_sql I see the correct sql, but if I do Foo.includes(:bars).order('lower(bars.baz)") it totally truncates the query and is broken
[22:28:40] dmarr: i'm seeing a scaffolded rspec spec fail but i'm not sure why: expected #<Flow id: 26, name: nil, code: nil, created_at: "2015-10-15 22:25:58", updated_at: "2015-10-15 22:25:58"> to be a new Flow(id: integer, name: string, code: string, created_at: datetime, updated_at: datetime)
[22:28:48] patrick99e99: why why why is it doing that?
[22:28:50] helpa: Do not repeat your question every 5 minutes expecting somebody to answer it. If you do not get a reply after the first time perhaps posting your question on StackOverflow (http://stackoverflow.com) would help you. Linking to the question in the channel after you've posted it is OK.
[22:29:01] Radar: That's what I get for trying to remember the rules
[22:29:08] Radar: patrick99e99: !rule9
[22:29:08] helpa: patrick99e99: Do not use excessive punctuation. This includes question marks (?), exclamation marks (!) and ellipsis (...).
[22:29:31] patrick99e99: so sorry Radar. didn't mean to offend anyone with my punctuation.
[22:29:35] Radar: patrick99e99: You're not showing us the broken SQL
[22:30:02] Radar: dmarr: !unworthy
[22:30:02] helpa: dmarr: You are not worthy of this bot!
[22:30:55] patrick99e99: Radar: basically, without the order, I see the usual sql query SELECT "shares"."id" AS t0_r0, "shares"."user_id" AS t0_r1, etc-- However, if I do .lower('relation_name.column'), then it turns into: "SELECT \"shares\".* FROM \"shares\" ORDER BY lower(share_recipients.email)"
[22:31:21] Radar: patrick99e99: Gist the two queries please.
[22:31:27] RoboZoom: has joined #RubyOnRails
[22:31:30] Scripore: has joined #RubyOnRails
[22:31:49] Prkl8r: has joined #RubyOnRails
[22:31:51] kalusn: has joined #RubyOnRails
[22:32:05] dmarr: seems like there should be more info in that failure. the assertion is expect(assigns(:flow)).to be_a_new(Flow)
[22:32:21] patrick99e99: Radar: https://gist.github.com/patrick99e99/11d18fa998f46bfe7469
[22:32:39] Radar: dmarr: !rule3
[22:32:39] helpa: dmarr: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[22:32:54] Radar: patrick99e99: Weird. I don't know what's happening, sorry :(
[22:33:05] GriffinHeart: has joined #RubyOnRails
[22:33:10] patrick99e99: Radar: thanks.
[22:33:12] Radar: patrick99e99: Maybe downcase the emails for share_recipients in the table so you don't need to do the lower every query?
[22:33:38] patrick99e99: Radar: yeah. thought of that, but was just thinking this is nonsense and shouldn't be a problem to do.
[22:36:25] smathy: patrick99e99, what are you expecting `includes` to do there?
[22:36:41] patrick99e99: smathy: uhh.. preload an association
[22:37:07] smathy: patrick99e99, the gist you showed doesn't demonstrate that it's not doing that.
[22:37:24] patrick99e99: smathy: what are you talking about? im demonstrating .to_sql shows that it breaks the query
[22:37:26] smathy: patrick99e99, it seems more like that you expect the SQL to be a certain way. "preload an association" isn't saying what you expect in the SQL.
[22:37:28] dmarr: spec + schema here https://gist.github.com/marr/1ce385d57949eb83775b
[22:37:36] patrick99e99: smathy: I expect to sql to look right
[22:37:47] smathy: patrick99e99, explain what "right" means to you?
[22:37:56] patrick99e99: smathy: sorry not interested in this discussion now... have a good day
[22:38:43] Radar: dmarr: flows_controller_spec.rb in the gist is not 98 characters long
[22:38:47] Radar: 98 lines*
[22:39:14] smathy: Awww, and here I was thinking I was a rails buddy :(
[22:40:21] Prkl8r: Hello! Hopefully someone will be able to help me figure a problem i'm having trying to iterate through an array that I'm passing from a form. https://goo.gl/feitlP
[22:40:49] dmarr: Radar: updated
[22:41:23] Radar: dmarr: Controller too please.
[22:41:33] Dopagod: has joined #RubyOnRails
[22:41:47] Radar: Prkl8r: fix your indentation here https://gist.github.com/Prkl8r/57adb43c0ae6d5f3fc55#file-invitations_controller-rb-L18-L27
[22:42:31] Radar: dmarr: I don't know what that test is expecting to happen
[22:42:36] Radar: The controller is the defualt scaffold controller
[22:42:41] Radar: I guess test is default scaffold too
[22:42:57] briansump: has joined #RubyOnRails
[22:42:59] Radar: https://gist.github.com/marr/1ce385d57949eb83775b#file-flows_controller_spec-rb-L97
[22:43:03] Radar: Stick a binding.pry after this point please
[22:43:15] Radar: then run the test again and tell me what assigns(:flow) shows
[22:43:21] dmarr: says, "newly created but unsaved"
[22:43:32] Ropeney: has joined #RubyOnRails
[22:43:51] Prkl8r: Radar: Hopefully that part looks better now.
[22:43:54] defswork: has joined #RubyOnRails
[22:44:03] smathy: Prkl8r, you have to indicate when you're expecting nested data (like an array) in your `.permit` call. It's not that well documented in the API docs, but look at Nested Parameters in the strong_parameters readme: https://github.com/rails/strong_parameters#nested-parameters
[22:44:34] brandonshowers: has joined #RubyOnRails
[22:44:41] dmarr: Radar: #<Flow id: 44, name: "Some Flow", code: "xx/some-flow", created_at: "2015-10-15 22:44:18", updated_at: "2015-10-15 22:44:18">
[22:44:51] diegoviola: has joined #RubyOnRails
[22:44:52] Shoutsid: has joined #RubyOnRails
[22:45:00] Radar: dmarr: So it looks like it's saving it. I guess the Flow model does not have any validations in it.
[22:45:27] dmarr: ah ok.. thats the case
[22:45:38] Jon30: has joined #RubyOnRails
[22:46:02] briansump: has joined #RubyOnRails
[22:46:05] Radar: So the save is succeeding, and it's never getting to the "else" in the create action.
[22:46:22] dmarr: i guess the db allows nulls on those name, code fields so the scaffold didn't add them
[22:48:12] baweaver: has joined #RubyOnRails
[22:48:30] smathy: dmarr, the Flow you pasted in the channel isn't the one with invalid_attributes.
[22:48:53] Prkl8r: smathy: ok thanks... so if I'm reading that correctly, it looks like I just need to update it to something like: https://goo.gl/feitlP
[22:48:57] smathy: dmarr, but your last comment suggests you think the scaffold generator will create Rails validations for you in your models. It won't.
[22:49:33] smathy: Prkl8r, give it a try and see :)
[22:49:33] RoboZoom: has joined #RubyOnRails
[22:49:56] dmarr: smathy: ok, i guess simplest way to get the test passing is updating invalid_attributes to { name: nil, code: nil }
[22:50:41] smathy: dmarr, ? They were both effectively nil already.
[22:51:15] briansump: has joined #RubyOnRails
[22:51:15] dmarr: ah, ok, so adding the validation to the model is really the only way forward
[22:51:31] smathy: dmarr, my point that wherever you put that `binding.pry` and copied the `assigns(:flow)` from was in a test with valid_attributes not invalid_attributes
[22:51:49] dmarr: and is there a way to make that known at scaffold time that the attributes would be required?
[22:52:00] smathy: dmarr, yes, if you want saving to fail because certain fields are not present, then you need validations in your model checking that they're preent.
[22:52:10] smathy: dmarr, no.
[22:52:14] Prkl8r: smathy: I seem to get the same undefined method 'map' error I have been getting. Which, in looking through the hash, everything seems there. After the help I got here yesterday, I was able to get the hidden tag to work and the object created by manually typing in the user_id. So 50% figured out!
[22:52:35] toydestroyer: has joined #RubyOnRails
[22:52:48] smathy: Prkl8r, copy and paste the log of the request into a new file in your gist.
[22:54:11] diegobiavati: has joined #RubyOnRails
[22:55:06] briansump: has joined #RubyOnRails
[22:55:08] Shoutsid: has joined #RubyOnRails
[22:55:19] wldcordeiro: has joined #RubyOnRails
[22:55:43] RoboZoom: has joined #RubyOnRails
[22:56:05] Prkl8r: smathy, server log added (hopefully that's the one you were looking for..
[22:56:55] beingjohnm: smathy: spot on again! so easy to just do it with partials. I'm always overthinking things.
[22:58:30] RoboZoom: Greetings - I have a complete beginner question - I'm trying to learn if learning Ruby on Rails would be beneficial for me. For website deployment, what capability will the server need to have?
[22:59:07] Shoutsid: has joined #RubyOnRails
[22:59:20] Aeyrix: Unix-based, at least 256MB of memory for database + app server
[22:59:26] RoboZoom: ie - is there Ruby on Rails server software? Or does it compile to PHP, or what?
[22:59:33] smathy: beingjohnm, good to hear :)
[22:59:41] smathy: Prkl8r, weird, that's what I would have expected.
[22:59:42] Aeyrix: Ruby on Rails is a web framework, written in Ruby.
[22:59:58] Aeyrix: So you'll write the code in Ruby, and it won't "compile" to anything.
[23:00:53] RoboZoom: ok - so is it comparable to Microsoft .Net, where when I write in C# using their MVC framework, I need a "Windows Server" to run the site?
[23:01:24] Prkl8r: smathy: yeah. So I'm not sure if it's something with the iteration code or if something else is broken.
[23:02:01] Aeyrix: You'll have something like IIS (Apache, or nginx), as the HTTP server, and then something like the ASP.NET framework server (Unicorn, or Puma) as the application server which the HTTP server passes back to.
[23:02:07] yfeldblum: has joined #RubyOnRails
[23:02:08] RoboZoom: So I need a "Unix Server" to operate a Ruby site?
[23:03:37] Kara: has joined #RubyOnRails
[23:03:39] RoboZoom: Sorry for the world's most basic question - I have limited access to what I can deploy to... so I want to figure out that I can deploy to an environment that would be compatible with Ruby before I go through the effort of learning the language
[23:04:28] bendangelo: has joined #RubyOnRails
[23:05:27] smathy: Prkl8r, you don't have to use the strong params for what you''re doing, you could just change https://gist.github.com/Prkl8r/57adb43c0ae6d5f3fc55#file-invitations_controller-rb-L11 to params[:invitation][:attendee_id].map ...
[23:06:00] iamjarvo_: has joined #RubyOnRails
[23:06:59] karam: has joined #RubyOnRails
[23:07:10] Prkl8r: smathy: I was under the impression strong params should always be used for forms for security. Obviously for this training app, I don't care but what is typically the guideline there?
[23:07:42] Aeyrix: RoboZoom: What can you deploy to?
[23:08:02] smathy: RoboZoom, just use heroku.
[23:08:15] RoboZoom: I'm 90% sure I can only deploy to a Windows Server
[23:08:20] smathy: Prkl8r, strong params are really only relevant if you're doing mass assignment.
[23:08:22] bollullera: has joined #RubyOnRails
[23:08:29] havenwood: RoboZoom: Why?
[23:08:45] RoboZoom: what my company has space on
[23:08:52] smathy: ...or more generally if you're passing an unknown structure of params into a method that's going to do some automatic shit with them.
[23:08:57] RoboZoom: I'm tagging onto already present space
[23:08:57] tvw: has joined #RubyOnRails
[23:09:09] Aeyrix: RoboZoom: Yeah use Heroku fam.
[23:09:17] Aeyrix: If this was in a month's time I'd offer you space on one of my boxen
[23:09:22] Aeyrix: but unfortunately, I do not have any right now.
[23:09:54] smathy: RoboZoom, so no, you can't realistically deploy a Rails app onto a Windows server.
[23:10:10] Shoutsid: has joined #RubyOnRails
[23:10:17] Prkl8r: smathy: ah ok. I'll try and not use the strong params and see if I can get it working. Thanks for taking a look!!
[23:10:45] smathy: RoboZoom, so if you are effectively being forced to deploy to Windows then no, Rails isn't a good choice.
[23:10:53] RoboZoom: I think I can load things on top of a windows server, and need to figure out what those are called and if I can get the permissions to do so
[23:11:07] smathy: Prkl8r, what you have should really work though, maybe spring is stuck.
[23:11:32] smathy: RoboZoom, what it'd be called is a virtual machine running *nix.
[23:11:37] awrfas2: has joined #RubyOnRails
[23:12:11] RoboZoom: so I can't load the ruby framework into the windows server environment?
[23:12:18] havenwood: RoboZoom: Familiar with Vagrant or Docker?
[23:12:28] RoboZoom: I am not, but I can research
[23:12:38] rhizome: RoboZoom: yes, you can run rails under windows
[23:13:52] pydave6367: has joined #RubyOnRails
[23:13:52] smathy: RoboZoom, rhizome failed to add a trollface emoji to that statement. It's a clusterfuck nightmare.
[23:14:33] RoboZoom: so would I be better off staying with C# on a windows server, or does Ruby, in your opinion, offer enough benefits to swap over
[23:14:40] artto: has joined #RubyOnRails
[23:14:45] annlewis: has joined #RubyOnRails
[23:14:56] smathy: Stay with Windows ecosystem frameworks on Windows.
[23:15:52] RoboZoom: understand - thanks for the help!
[23:16:05] smathy: Windows isn't even a pleasant/workable DEVELOPMENT platform for Rails.
[23:16:33] rromanch_: has joined #RubyOnRails
[23:16:36] Prkl8r: smathy: Tried restarting the rails server as well as the cloud9 server as well but still no go...
[23:16:40] Aeyrix: s/ for rails//
[23:17:37] RoboZoom: smathy, aeyrix thanks for the help
[23:17:38] quazimodo: has joined #RubyOnRails
[23:20:20] smathy: Prkl8r, weird. Did you try using the params directly?
[23:20:45] Prkl8r: Smathy: Trying that now...
[23:20:47] decaff: has joined #RubyOnRails
[23:21:18] seank_: has joined #RubyOnRails
[23:21:29] Prkl8r: Getting a no implicit conversion of Symbol into Integer error on that same line 11...
[23:21:59] Lytol: has joined #RubyOnRails
[23:22:05] Coldblackice: has joined #RubyOnRails
[23:22:19] Kara: has joined #RubyOnRails
[23:22:30] smathy: Prkl8r, oh, sorry, I misread your logs before.
[23:22:44] sevenseacat: has joined #RubyOnRails
[23:22:50] karam: has joined #RubyOnRails
[23:24:01] dmarr: Radar you mentioned that controller was the default scaffold. do you know if everything works as in that file if i don't include all the scaffolded bits
[23:25:07] helpa-bot: has joined #RubyOnRails
[23:25:22] Lightsword: has joined #RubyOnRails
[23:25:24] smathy: The name of the check_box_tag is missing the invitation bit.
[23:25:35] Jon30: has joined #RubyOnRails
[23:25:38] nertzy3: has joined #RubyOnRails
[23:26:42] tfittsy: has joined #RubyOnRails
[23:27:09] helpa-bot: has joined #RubyOnRails
[23:27:22] MiracleBlue_: has joined #RubyOnRails
[23:27:30] smathy: Prkl8r, no, just "invitation[attendee_id][]"
[23:27:31] rromanch_: has joined #RubyOnRails
[23:27:43] deavidsedice: has joined #RubyOnRails
[23:27:44] neilf_: has joined #RubyOnRails
[23:27:46] kapowaz_: has joined #RubyOnRails
[23:27:54] smathy: Prkl8r, take a look at the HTML produced for the other field.
[23:28:06] smathy: Prkl8r, and you can go back to using your strong params now.
[23:28:25] johnflux_: has joined #RubyOnRails
[23:29:10] helpa-bot: has joined #RubyOnRails
[23:29:17] crdpink: has joined #RubyOnRails
[23:29:33] Prkl8r: smathy: AH!! I see it's all within the same {} as the attended_event_id param!
[23:29:35] brandonshowers: has joined #RubyOnRails
[23:29:45] shaman42_: has joined #RubyOnRails
[23:29:52] max_Q_: has joined #RubyOnRails
[23:29:56] ernesto_1imenez: has joined #RubyOnRails
[23:29:58] kramsee_: has joined #RubyOnRails
[23:30:01] epochwolf|vps2: has joined #RubyOnRails
[23:30:01] epochwolf|vps2: has joined #RubyOnRails
[23:30:05] insu_: has joined #RubyOnRails
[23:30:14] Kilobyte22: has joined #RubyOnRails
[23:30:14] rickmasta: has joined #RubyOnRails
[23:30:19] Derasi: has joined #RubyOnRails
[23:30:19] Hawson_: has joined #RubyOnRails
[23:30:22] LiquidIn1ect: has joined #RubyOnRails
[23:30:35] funnel_: has joined #RubyOnRails
[23:30:53] smathy: There are no actual rules here when adding something like this, so you could leave it up at the top level, and then just change your code to use `params[:attendee_id].map`
[23:30:53] orolo: has joined #RubyOnRails
[23:31:10] helpa: has joined #RubyOnRails
[23:31:49] rushed: has joined #RubyOnRails
[23:32:11] towski__: has joined #RubyOnRails
[23:32:48] Prkl8r: Ah ok. So I got rid of the errors, but looks like it's still not creating the object looking in the rails console
[23:33:21] smathy: Prkl8r, btw, you misspelled attended_event_id here: https://gist.github.com/Prkl8r/57adb43c0ae6d5f3fc55#file-invitations_controller-rb-L13
[23:33:26] Shoutsid: has joined #RubyOnRails
[23:34:07] GriffinHeart: has joined #RubyOnRails
[23:34:57] havenwood: has joined #RubyOnRails
[23:35:06] Prkl8r: ooops. THAT did the trick!
[23:35:21] alol: has joined #RubyOnRails
[23:35:24] p7r: has joined #RubyOnRails
[23:35:29] Prkl8r: I suppose spelling counts in coding. :-)
[23:35:36] Hamled: has joined #RubyOnRails
[23:35:54] quazimodo: has joined #RubyOnRails
[23:35:54] rickmasta: has joined #RubyOnRails
[23:36:42] Prkl8r: Smathy: Thanks SO much for all your help. Going through the Odin trying to do a bit extra and this problem has tripped me up for almost a week now. I'm glad I stuck with it though. Thanks again!
[23:37:22] smathy: You're welcome.
[23:37:25] twilling: has joined #RubyOnRails
[23:37:39] FCser: has joined #RubyOnRails
[23:39:38] Lytol: has joined #RubyOnRails
[23:39:41] joelsmith: has joined #RubyOnRails
[23:39:48] shawnacscott: has joined #RubyOnRails
[23:39:55] svkurowski: has joined #RubyOnRails
[23:39:56] Liothen: has joined #RubyOnRails
[23:39:56] Liothen: has joined #RubyOnRails
[23:39:57] execute: has joined #RubyOnRails
[23:40:02] shtirlic: has joined #RubyOnRails
[23:40:04] beingjohnm: has joined #RubyOnRails
[23:40:08] Dfoolz: has joined #RubyOnRails
[23:40:16] bphogan: has joined #RubyOnRails
[23:43:44] baweaver: has joined #RubyOnRails
[23:45:51] helpa-bot: has joined #RubyOnRails
[23:47:49] Shoutsid: has joined #RubyOnRails
[23:49:15] helpa-bot: has joined #RubyOnRails
[23:59:19] helpa: has joined #RubyOnRails