« Back to channel list

#RubyOnRails - 27 March 2016

« Back 1 day Forward 1 day »
[00:00:03] tfittsy: has joined #RubyOnRails
[00:01:24] pawnbox: has joined #RubyOnRails
[00:03:46] manfrin: has joined #RubyOnRails
[00:05:12] jobewan: has joined #RubyOnRails
[00:06:12] Musashi007: has joined #RubyOnRails
[00:07:31] Mattx: smathy, it looks like a hack not the rails way of thing this. weird
[00:07:50] hnanon: has joined #RubyOnRails
[00:08:09] smathy: Mattx, even the setting of the table name?
[00:08:17] hnanon: How can I check if a record was either created or updated?
[00:08:30] Papierkorb: Mattx: What's wrong with the first answer? Looks pretty clear in intention to me
[00:08:36] hnanon: I'm seeding some data and I want to puts a message one way or another.
[00:08:54] Papierkorb: (One could argue though that having multiple schemas isn't railsy in the first place)
[00:09:45] Mattx: Papierkorb, you require to setup multiple connections, one for each schema, I don't think that's necessary
[00:10:05] superlou: has joined #RubyOnRails
[00:10:19] Mattx: also you have to create a weird intermediary model from which your real models inherit
[00:10:58] smathy: Embrace the hack, it's all a hack.
[00:12:01] Mattx: you all have to repeat a lot on the yml config file
[00:12:13] Mattx: that workaround really sucks actually :P
[00:12:18] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[00:12:19] Mattx: you also *
[00:12:58] i4: has joined #RubyOnRails
[00:13:03] Mattx: well, you can define all schemas in the same search path, I guess that would work, never mind
[00:13:07] hnanon: I see there is a new_record method. Is there something similar for updated records?
[00:16:02] kanzure: has joined #RubyOnRails
[00:16:22] hnanon: Hmm. I think I can use @record.updated_at_changed?
[00:17:00] Dimik: how can i execute my .rb file with ruby on rails ?
[00:17:05] Dimik: is there such a thing ?
[00:17:08] Mattx: hnanon, .changed? .new_record?
[00:17:10] sandstrom: has joined #RubyOnRails
[00:18:38] kanzure: has joined #RubyOnRails
[00:20:15] yatish27: has joined #RubyOnRails
[00:21:41] i4: I do: 20.times do |i|, how can I group output by 4?
[00:23:18] dalbuschat: has joined #RubyOnRails
[00:25:34] shutch: i4: group output by 4?
[00:26:09] i4: for example, I have 20.times and want to output 4 times by 5
[00:26:13] i4: strings
[00:29:01] i4: shutch, how can I do this?
[00:29:28] smathy: Dimik, no, rails is a framework not an interpreter.
[00:30:48] hnanon: Mattx: Yes, thank you.
[00:30:53] smathy: i4, http://devdocs.io/rails/array#method-i-in_groups_of
[00:31:43] delgiudices: has joined #RubyOnRails
[00:32:07] delgiudices: I want content to be private but shareable
[00:32:19] delgiudices: So i was thinking in using a secret token associated with the record
[00:32:39] delgiudices: That way i can use the url : /table_name/secret_token so users can share the url
[00:32:44] delgiudices: Is this a correct approach?
[00:32:53] P4Titan: has joined #RubyOnRails
[00:33:04] smathy: delgiudices, yes.
[00:35:32] i4: any ideas?
[00:35:42] delgiudices: smathy how shoudl i generate the secret_token? is there an specific gem?
[00:35:44] smathy: i4, yes, the one I just mentioned.
[00:35:49] smathy: delgiudices, SecureRandom
[00:35:55] smathy: delgiudices, not a gem, stdlib.
[00:36:18] i4: thanks)
[00:37:17] delgiudices: smathy thanks
[00:38:05] smathy: delgiudices, just watch contention, if two users share the same content one after each other, will you just overwrite the first user's token?
[00:38:43] delgiudices: smathy actually the content is per user so there's no problem for this
[00:38:50] delgiudices: But shouldn't the token be generate for every record
[00:38:54] delgiudices: WHen creating
[00:38:57] delgiudices: Not when sharing?
[00:39:00] bronson: has joined #RubyOnRails
[00:39:44] smathy: Depends, if you do it just once then that URL is always valid, forever, so as long as you're comfortable with this "private" content being shared and reshared forever, then all good with "on creation".
[00:40:35] delgiudices: smathy alright
[00:44:50] ascarter: has joined #RubyOnRails
[00:48:44] hnanon: https://gist.github.com/anonymous/2f7b6bbb987c82aed4c6
[00:49:11] hnanon: I'm not getting any of the "created" or "updated" messages.
[00:52:02] DragonPunch: has joined #RubyOnRails
[00:56:34] htmldrum: has joined #RubyOnRails
[00:56:34] htmldrum_: has joined #RubyOnRails
[01:00:11] i4: smathy, very strange but %w(1 2 3 4 5).in_groups_of(2, false) {|group| p group} is not working(
[01:01:36] i4: syntax error, unexpected keyword_ensure, expecting end-of-input
[01:02:38] Cohedrin: has joined #RubyOnRails
[01:03:22] i4: Iw tried to set the DO
[01:04:45] one_zero: has joined #RubyOnRails
[01:06:26] i4: can I replace %w(1,2,3,4,5,6,7,8,9,10,11,12,13,14) to something 14.times -> in %w(1,2,3,4,5,6,7,8,9,10,11,12,13,14).in_groups(3, false) do |g| %>?
[01:07:25] i4: any ideas?
[01:09:17] i4: if I call 20.times do |i| ... how can I insert each 4 string some marker like a <br>?
[01:09:47] i4: maybe I must use split?
[01:13:59] i4: please help)
[01:14:42] DoctorMonocular: has joined #RubyOnRails
[01:16:32] manfrin: has joined #RubyOnRails
[01:18:07] i4: how can I check that number i is multiplies 5?
[01:18:54] pwnd_nsfw: modulo operator
[01:20:39] i4: I do the <% if i % 3 %> an it's not working for me
[01:20:44] i4: print each string
[01:20:49] i4: not only 3rd and 6
[01:21:04] i4: pwnd_nsfw, do you know why?
[01:21:53] pwnd_nsfw: Probably because your'e doing it wrong
[01:22:02] i4: == 0 or == 1
[01:22:04] i4: thanks!
[01:25:18] shaman42: has joined #RubyOnRails
[01:29:20] uglybandersnatch: has joined #RubyOnRails
[01:29:31] Musashi007: has joined #RubyOnRails
[01:29:36] tfittsy: has joined #RubyOnRails
[01:30:42] tfittsy: has left #RubyOnRails: ()
[01:31:01] htmldrum_: has joined #RubyOnRails
[01:31:01] htmldrum: has joined #RubyOnRails
[01:35:21] Cohedrin: has joined #RubyOnRails
[01:36:17] shaman42: has joined #RubyOnRails
[01:36:38] eyeamaye: has joined #RubyOnRails
[01:39:25] tvon: has joined #RubyOnRails
[01:44:35] tfittsy: has joined #RubyOnRails
[01:53:06] mrchris: has joined #RubyOnRails
[01:54:50] dever: has joined #RubyOnRails
[01:55:06] dever: hey all, is there a way to set a default route for an engine?
[01:56:02] htmldrum: has joined #RubyOnRails
[01:56:03] htmldrum_: has joined #RubyOnRails
[01:57:46] Rubie: has joined #RubyOnRails
[01:59:07] dever: ah, nevermind, you must specify a mountpoint.
[02:02:15] Jasaka: has joined #RubyOnRails
[02:04:43] sevenseacat: has joined #RubyOnRails
[02:04:53] tvon: has joined #RubyOnRails
[02:05:59] tfittsy: has joined #RubyOnRails
[02:06:19] tfittsy: has joined #RubyOnRails
[02:07:14] uglybandersnatch: has joined #RubyOnRails
[02:07:39] alex88: has joined #RubyOnRails
[02:08:57] draig: has joined #RubyOnRails
[02:09:03] shutch: has joined #RubyOnRails
[02:11:27] Axy: has joined #RubyOnRails
[02:16:57] yfeldblum: has joined #RubyOnRails
[02:19:53] patrick-sartent: has joined #RubyOnRails
[02:20:08] _Tariq: has joined #RubyOnRails
[02:20:21] P4Titan: Hello all. May someone check from following migration code: http://pastie.org/10774997
[02:20:37] P4Titan: I wish to implement the structure described in my model into a migration
[02:22:34] tfittsy: has joined #RubyOnRails
[02:27:21] P4Titan: In short, how should I use add_reference to connect a has_one :through
[02:33:32] dextertzu: has joined #RubyOnRails
[02:35:14] jaequery: has joined #RubyOnRails
[02:35:30] draig: has joined #RubyOnRails
[02:37:06] duncannz: has joined #RubyOnRails
[02:41:04] bronson: has joined #RubyOnRails
[02:46:41] Musashi007: has joined #RubyOnRails
[02:53:36] fighella: has joined #RubyOnRails
[02:57:02] htmldrum: has joined #RubyOnRails
[02:57:05] htmldrum_: has joined #RubyOnRails
[02:58:43] yatish27: has joined #RubyOnRails
[02:59:40] madielys-15d: has joined #RubyOnRails
[03:03:20] tvon: has joined #RubyOnRails
[03:04:36] tvon: has joined #RubyOnRails
[03:05:19] maidelys-15d: has joined #RubyOnRails
[03:06:29] tfittsy: has joined #RubyOnRails
[03:07:42] quazimodo: has joined #RubyOnRails
[03:10:42] pawnbox: has joined #RubyOnRails
[03:12:15] maidelys-15d: has left #RubyOnRails: ()
[03:12:48] DoctorMonocular: has joined #RubyOnRails
[03:15:30] madielys-15d: has left #RubyOnRails: ()
[03:15:34] pwnd_nsfw: P4Titan, your through table will reference the two models
[03:15:37] pwnd_nsfw: and that's all you have to do
[03:16:15] braincras: has joined #RubyOnRails
[03:16:28] pwnd_nsfw: the through table will belong to both of the models
[03:21:02] GodFodder: has joined #RubyOnRails
[03:21:22] a11: has joined #RubyOnRails
[03:22:35] GodFodder: has joined #RubyOnRails
[03:23:32] baweaver: has joined #RubyOnRails
[03:25:35] GodFodder: has joined #RubyOnRails
[03:28:47] Mattx: has joined #RubyOnRails
[03:29:45] Mattx: Hey guys, I've been trying for ours to fix this. I want to add nested models to the autoload path so they get reloaded if they change. I've added: config.autoload_paths << "#{Rails.root}/models/**/*" to applicaiton.rb
[03:29:50] Mattx: and many other things
[03:30:11] Mattx: but nothing seems to work, if I update the code of the models I don't see the updates on the page
[03:30:17] Mattx: sames happens with all nested controllers
[03:30:18] Mattx: any idea?
[03:30:55] sevenseacat: you shouldnt need to add anything to your autoload path - remove it
[03:31:09] sevenseacat: what classes have you defined in which file paths?
[03:31:25] Mattx: models/domains/properties.rb for instance
[03:31:50] sevenseacat: and what class does that file define?
[03:32:06] Mattx: Domains::Property
[03:32:23] sevenseacat: ok you've got a mismatch - it should be in a file called property.rb, not properties.rb
[03:32:35] Mattx: I meant property.rb, sorry
[03:32:46] Mattx: app/models/domains/property.rb
[03:33:31] sevenseacat: then that will load just fine. what error are you seeing?
[03:34:54] Mattx: it's loading, but if I update the model I don't see the changes
[03:35:00] alex88: has joined #RubyOnRails
[03:35:05] pwnd_nsfw: How are you attempting to view the changes?
[03:35:10] Mattx: I have to restart the server (I'm on develop environment anyway, but it's anoying)
[03:35:26] sevenseacat: have you done weird things like trying to load these files in an initializer?
[03:36:22] Mattx: nope, I've trying to update the code in both nested controllers and models, and print a value on the page for instance
[03:36:36] Mattx: and even if I change that value I don't see any change on the page until I restart
[03:36:54] Mattx: nothing weird, just things like: render json: 1
[03:37:01] Mattx: then I change 1 for 2, and refresh the page
[03:37:17] xcesariox: has joined #RubyOnRails
[03:40:37] pawnbox: has joined #RubyOnRails
[03:40:57] Mattx: any idea?
[03:41:23] Mattx: s/trying/tried/
[03:42:30] sevenseacat: have you turned on the caching of classes in your development.rb ?
[03:42:50] dpg: has joined #RubyOnRails
[03:45:26] Mattx: nope, I haven't touched anything apart from autoload_path << ..., which I removed now
[03:48:12] sevenseacat: are you actually checking, or just going by what you think you've changed?
[03:49:12] Mattx: I'm not checking, it's a new rails project, I didn't change any config apart from that
[03:51:42] pwnd_nsfw: Gotta start over Mattx
[03:52:05] digidog_: has joined #RubyOnRails
[03:57:46] htmldrum: has joined #RubyOnRails
[03:57:47] htmldrum_: has joined #RubyOnRails
[04:02:08] Mia: has joined #RubyOnRails
[04:03:01] Mattx: can anyone try that? I'm really lost, I've been with that the whole afternoong :(
[04:04:22] sevenseacat: i suggest checking the things we've mentioned
[04:05:23] tfittsy: has joined #RubyOnRails
[04:07:39] Rubie: has joined #RubyOnRails
[04:07:39] Mattx: I'm creating a new project, let's see
[04:10:12] jhn: has joined #RubyOnRails
[04:26:06] smoitra: has joined #RubyOnRails
[04:28:21] Puffball: has joined #RubyOnRails
[04:28:36] trosborn: has joined #RubyOnRails
[04:30:44] duderonomy: has joined #RubyOnRails
[04:31:22] gingray: has joined #RubyOnRails
[04:33:27] trosborn: has joined #RubyOnRails
[04:36:27] jaequery: has joined #RubyOnRails
[04:43:06] bronson: has joined #RubyOnRails
[04:44:06] Ericx2x_: has joined #RubyOnRails
[04:46:51] baweaver: has joined #RubyOnRails
[04:47:05] jonee: has joined #RubyOnRails
[04:47:38] tfittsy: has joined #RubyOnRails
[04:48:43] _Tariq: has joined #RubyOnRails
[04:58:34] htmldrum_: has joined #RubyOnRails
[04:58:35] htmldrum: has joined #RubyOnRails
[05:00:50] pawnbox: has joined #RubyOnRails
[05:02:54] mrgreenfur_: has joined #RubyOnRails
[05:05:46] htmldrum: has joined #RubyOnRails
[05:05:47] htmldrum_: has joined #RubyOnRails
[05:06:10] duderonomy: has joined #RubyOnRails
[05:09:19] pawnbox: has joined #RubyOnRails
[05:09:51] hiyosi: has joined #RubyOnRails
[05:10:29] trosborn: has joined #RubyOnRails
[05:13:14] _Tariq: has joined #RubyOnRails
[05:13:14] yfeldblum: has joined #RubyOnRails
[05:15:29] AnoHito: has joined #RubyOnRails
[05:18:08] hd1: has joined #RubyOnRails
[05:26:41] pawnbox: has joined #RubyOnRails
[05:27:03] cabargas: has joined #RubyOnRails
[05:33:16] srinidhi: has joined #RubyOnRails
[05:38:51] yatish27: has joined #RubyOnRails
[05:39:24] trosborn: has joined #RubyOnRails
[05:39:41] blackhuey: has joined #RubyOnRails
[05:44:40] rubyonrailed: has joined #RubyOnRails
[05:45:22] djbkd: has joined #RubyOnRails
[06:03:57] hd1: has joined #RubyOnRails
[06:04:58] gabr13l: has joined #RubyOnRails
[06:06:31] htmldrum: has joined #RubyOnRails
[06:06:32] htmldrum_: has joined #RubyOnRails
[06:06:37] tvon: has joined #RubyOnRails
[06:06:45] tvon: has joined #RubyOnRails
[06:07:06] Rubie: has joined #RubyOnRails
[06:13:35] DarkBushido: has joined #RubyOnRails
[06:13:36] DarkBushido: has joined #RubyOnRails
[06:18:49] tfittsy: has joined #RubyOnRails
[06:25:25] Rubie: has joined #RubyOnRails
[06:28:24] popsicle: has joined #RubyOnRails
[06:28:36] tjbiddle: has joined #RubyOnRails
[06:32:03] gabr13l: has joined #RubyOnRails
[06:33:56] sudoubuntu: has joined #RubyOnRails
[06:34:28] sbarg: has joined #RubyOnRails
[06:35:08] njero: has joined #RubyOnRails
[06:39:21] sbarg: Hi. I'm uploading a spreadsheet to a rails app and inserting it into mysql. I'm getting failures sometimes because the cell size is larger than the column size. I see how ActiveRecord can validate on length, but is there a way to validate against the schema?
[06:39:43] bob434: has joined #RubyOnRails
[06:40:03] hd1: schema.rb?
[06:40:07] htmldrum: has joined #RubyOnRails
[06:40:09] htmldrum_: has joined #RubyOnRails
[06:41:50] sbarg: Yes, hd1, I'd like to get the limit values from schema.rb, do I need to parse that file "by hand"? Or is there a better way to get those values?
[06:45:05] jaequery: has joined #RubyOnRails
[06:45:15] bronson: has joined #RubyOnRails
[06:46:55] gabr13l: has joined #RubyOnRails
[06:52:18] shinnya: has joined #RubyOnRails
[06:52:58] arup_r: has joined #RubyOnRails
[06:56:47] jaequery: has joined #RubyOnRails
[07:04:03] PaulePanter: Hi. http://guides.rubyonrails.org/action_controller_overview.html#session
[07:04:11] PaulePanter: ActionDispatch::Session::MemCacheStore - Stores the data in a memcached cluster (this is a legacy implementation; consider using CacheStore instead).
[07:04:39] PaulePanter: … do you know where I can find more information about this?
[07:04:58] PaulePanter: http://guides.rubyonrails.org/caching_with_rails.html does not contain similar information.
[07:05:52] PaulePanter: Or is that specific for the session? Why shouldn’t Memcached be used for it?
[07:09:28] User458764: has joined #RubyOnRails
[07:12:04] tvon: has joined #RubyOnRails
[07:12:10] rails690: has joined #RubyOnRails
[07:12:27] rails690: I want to update some attributes on a model after submission of the model's form
[07:12:39] rails690: the model's form contains association forms
[07:12:49] rails690: so the update has to occur after the associations are updated/created/destroyed
[07:12:58] rails690: because the attributes are based on the associations' information
[07:13:06] rails690: whats the best way to handle this, an after_commit callback?
[07:19:47] smoitra: has joined #RubyOnRails
[07:21:01] smoitra: Hi all what is the 'resource' variable in Controller ?
[07:22:02] fexilal: has joined #RubyOnRails
[07:25:59] Rubie: has joined #RubyOnRails
[07:33:37] tjbiddle: has joined #RubyOnRails
[07:34:05] arup_r: rails690: You have nested forms right?
[07:34:15] rails690: arup_r: yes
[07:34:38] arup_r: smoitra: that we can say, after seeing your code. There is not out of the box `resource` variable from Rails.
[07:35:03] arup_r: rails690: ok, So why not using accept_nested_attributes_for?
[07:35:05] smoitra: I am using devise
[07:35:27] rails690: arup_r: i am, i dont have a problem saving association fields
[07:35:30] arup_r: smoitra: ok, devise made that helpers method..
[07:35:39] smoitra: and to redirect after signup I am using def after_sign_in_path_for(resource)
[07:35:42] rails690: arup_r: i have a problem, updating normal attributes based on association attributes values after the save
[07:35:48] arup_r: rails690: ok, then can you tell me again where you got stuck..?
[07:35:51] smoitra: I dont understand what that resource does
[07:38:02] arup_r: smoitra: it is a helper method, devise use, in controller and views to refer the model object to which you added Devise configuration https://github.com/plataformatec/devise/blob/cecb3ee45b6fd53160a593d474a04e9816a04e75/app/controllers/devise/sessions_controller.rb#L17
[07:38:47] arup_r: rails690: What is the problem then? accept_nested_attributes_for should handle saving parent and child by default if you have proper configuration.
[07:39:10] smoitra: arup_r: thanks
[07:39:18] rails690: arup_r: nvm i dont have a problem anymore, thanks
[07:41:19] bmf_: has joined #RubyOnRails
[07:45:36] arup_r1: has joined #RubyOnRails
[07:47:00] srinidhi: has joined #RubyOnRails
[07:48:55] baweaver: has joined #RubyOnRails
[07:51:46] robbyoconnor: has joined #RubyOnRails
[07:52:56] smoitra: Hi all if I get unintialized controller Admin::Adminstration::RegistrationsController where should I put the resgistration_controller.rb ?
[07:53:56] smoitra: I have put it under controller/admin/adminstration/registration_controller.rb
[07:54:11] hightower2: has joined #RubyOnRails
[07:55:41] sevenseacat: well you've misspelt administration, and it should be registrations_controller.rb, not registration_controller
[07:58:12] smoitra: sevenseacat: My bad thanks a lot
[07:58:16] djellemah: has joined #RubyOnRails
[07:58:18] nocontrol: has joined #RubyOnRails
[07:58:33] nocontrol: hi all, what do you use for asset management in Rails ?
[07:58:56] sevenseacat: nocontrol: same thing as when you asked yesterday
[07:59:17] nocontrol: sevenseacat: I didn't get your reply
[07:59:27] sevenseacat: nocontrol: rubygems.
[07:59:45] nocontrol: sevenseacat: and If it's old ?
[07:59:59] sevenseacat: if whats old?
[08:00:11] nocontrol: If the gem has not been updated with the appropriate library
[08:00:28] sevenseacat: then download the newer one if you absolutely need it (which you probably dont)
[08:01:03] arup_r: has joined #RubyOnRails
[08:01:06] nocontrol: ok I trust you then
[08:01:24] nocontrol: sevenseacat: have you heard of browserify ?
[08:01:35] nocontrol: what's your opinion ?
[08:01:39] sevenseacat: no interest in it.
[08:02:17] nocontrol: I see npm getting stronger and I am searching If there's a way to automate assets installation and update
[08:02:34] sevenseacat: sure, thats why i use rubygems.
[08:03:26] nocontrol: I didn't know it works like that
[08:03:40] nocontrol: sevenseacat: thanks, questions answered :)
[08:04:51] AimlessRAven: has joined #RubyOnRails
[08:06:30] htmldrum: has joined #RubyOnRails
[08:06:30] htmldrum_: has joined #RubyOnRails
[08:07:19] AimlessRAven: can anyone help me to convert this sql request https://gist.github.com/anonymous/e634c4471da1731fb5cd to rails db request
[08:08:07] apotry: has joined #RubyOnRails
[08:14:36] darutoko: has joined #RubyOnRails
[08:17:37] FooBarWidget: has joined #RubyOnRails
[08:25:29] sandstrom: has joined #RubyOnRails
[08:37:07] agit0: has joined #RubyOnRails
[08:37:53] Musashi007: has joined #RubyOnRails
[08:40:47] yfeldblum: has joined #RubyOnRails
[08:40:51] syndikate: has joined #RubyOnRails
[08:44:07] defsdoor: has joined #RubyOnRails
[08:47:25] bronson: has joined #RubyOnRails
[08:48:57] agit0: has joined #RubyOnRails
[08:49:57] quazimodo: has joined #RubyOnRails
[08:51:56] doublemalt_: has joined #RubyOnRails
[08:58:17] AimlessRAven: can anyone help me to convert this sql request https://gist.github.com/anonymous/e634c4471da1731fb5cd to rails db request
[09:05:40] Musashi007: has joined #RubyOnRails
[09:08:50] rohit: has joined #RubyOnRails
[09:21:40] blackmesa: has joined #RubyOnRails
[09:32:41] tvon: has joined #RubyOnRails
[09:42:26] arup_r: has joined #RubyOnRails
[09:48:52] htmldrum_: has joined #RubyOnRails
[09:48:52] htmldrum: has joined #RubyOnRails
[09:48:55] TheGreatGudsby: has joined #RubyOnRails
[09:49:03] valetudo: has joined #RubyOnRails
[09:50:39] Terens: has joined #RubyOnRails
[09:51:11] User458764: has joined #RubyOnRails
[09:55:35] agit0: has joined #RubyOnRails
[09:56:39] blackmesa: has joined #RubyOnRails
[10:04:32] lxsameer: has joined #RubyOnRails
[10:04:32] lxsameer: has joined #RubyOnRails
[10:05:05] ok: has joined #RubyOnRails
[10:05:15] ok: has left #RubyOnRails: ()
[10:06:25] snowy: has joined #RubyOnRails
[10:06:40] cac: has joined #RubyOnRails
[10:07:57] th0m_: has joined #RubyOnRails
[10:08:21] chrissonar: has joined #RubyOnRails
[10:09:06] Synthead: has joined #RubyOnRails
[10:15:59] arup_r: has joined #RubyOnRails
[10:19:32] TheGreatGudsby: has joined #RubyOnRails
[10:20:10] beauby: has joined #RubyOnRails
[10:29:16] Ropeney: http://www.amazon.com/Ruby-Under-Microscope-Illustrated-Internals/dp/1593275277 Anyone read and recommend this book?
[10:32:21] sevenseacat: never heard of it.
[10:33:38] tvon: has joined #RubyOnRails
[10:35:32] Ropeney: It looks interesting, but I'm a bit weary on such books since I bought a book on "optimizing ruby" which was...
[10:37:15] pawnbox: has joined #RubyOnRails
[10:39:12] agit0: has joined #RubyOnRails
[10:43:52] User458764: has joined #RubyOnRails
[10:46:10] baweaver: has joined #RubyOnRails
[10:49:45] bronson: has joined #RubyOnRails
[10:50:52] chrissonar: I use RSpec shared_examples for testing a module https://gist.github.com/christianrolle/31ccc0111ed96ea4ac36
[10:50:56] chrissonar: I use RSpec share_example for testing a module https://gist.github.com/christianrolle/31ccc0111ed96ea4ac36
[10:51:09] chrissonar: Running 'rspec spec/person_spec.rb I expected 1 failure since the module was not included in Person yet. But there is 1 green example instead?
[10:56:16] Ropeney: chrissonar, have you read https://www.relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples ?
[10:56:33] differentreality: has joined #RubyOnRails
[10:56:37] Ropeney: your spec is passing, because spec_helper probably already loads humanizable
[10:57:53] chrissonar: ropeney, I more suspect the test not running in the scope of Person, but HumanizableUnit instead. I seeem to screw it up, didn't I?
[10:58:41] chrissonar: what about described_class?
[10:59:22] Ropeney: I don't know what your asking
[11:00:01] Ropeney: and you could see if its running, by using 'p 'this'' statements
[11:01:11] yfeldblum: has joined #RubyOnRails
[11:02:12] chrissonar: ropeney, well. did you see that I was testing HumanizableUnit? O.K. those tests will always be alright, since the module was included there. But I didn't knew, I wanted wanted to test the class Person (and others) instead.
[11:02:20] chrissonar: described_class solves my issue. thank you
[11:06:55] htmldrum: has joined #RubyOnRails
[11:06:57] htmldrum_: has joined #RubyOnRails
[11:11:21] drptbl: has joined #RubyOnRails
[11:14:47] differentreality: has joined #RubyOnRails
[11:18:08] arBmind: has joined #RubyOnRails
[11:29:30] User458764: has joined #RubyOnRails
[11:30:57] arBmind1: has joined #RubyOnRails
[11:31:30] differentreality: has joined #RubyOnRails
[11:33:38] siaW: after doign “rake db:migrate” from a repo i cloned, i get “LoadError: cannot load such file -- migration_helpers”
[11:33:41] siaW: what could be wrong?
[11:34:15] siaW: full error https://gist.github.com/siaw23/2c7cd9668f6da2496ad0
[11:34:29] tvon: has joined #RubyOnRails
[11:34:58] arup_r: ropeney: That book is awesome. went through few chapters though,,
[11:35:12] Ropeney: arup_r, oh?
[11:35:15] arup_r: Pat went to ruby internal.. higher to lower
[11:36:15] arup_r: ropeney: today Ind vs Aus T20 do or die macth! :D
[11:37:19] Ropeney: yeah starts in 2 and a half hours? lol
[11:37:22] Ropeney: midnight for us
[11:37:27] Ropeney: siaw, what ruby version?
[11:37:37] sevenseacat: siaw: where is your migration_helpers file?
[11:37:48] Ropeney: 2.3.0, my bad didnt even look :(
[11:38:01] siaW: ruby 2.3.0p0
[11:38:25] siaW: sevenseacat: i don’t know of any migration_helpers, i cloned and i don’t know why or if there should be one
[11:38:32] Ropeney: did u do bundle install?
[11:38:47] sevenseacat: well read the migration file being referenced
[11:39:05] siaW: yeap i did bundle install
[11:39:09] mostlybadfly: has joined #RubyOnRails
[11:39:12] siaW: yes i see it being referenced
[11:39:16] sevenseacat: i dont know what you cloned, but it might be part of the setup instructons that you skipped
[11:40:07] siaW: this is what i cloned: https://github.com/berkmancenter/h2o
[11:40:25] siaW: this is the first time i’m seeing “migrations_helpers"
[11:40:37] siaW: so i have no idea where to put it or what to put inside even
[11:40:38] sevenseacat: well you're using the wrong version of ruby, for starters
[11:40:48] siaW: how’s that?
[11:40:58] sevenseacat: reading the installation instructions
[11:41:12] Ropeney: "Install ruby 2.1.0p0 via rvm"
[11:41:26] dtzuzu: has joined #RubyOnRails
[11:41:28] Ropeney: sorry to jump ahead sevenseacat
[11:41:48] sevenseacat: i dont imagine that six year old migrations will run anymore, either
[11:42:21] sevenseacat: given they were likely written for crazy old versions of ruby that did have a migration_helpers file
[11:42:27] sevenseacat: *crazy old versions of rails
[11:42:39] siaW: oooo i see they put install instructions somewhere else. i was looking for it in the readme
[11:43:01] siaW: thanks sevenseacat and ropeney
[11:43:03] siaW: i’m trying again
[11:43:12] siaW: i already have ruby 2.1
[11:43:15] siaW: so i’m checking again
[11:43:17] sevenseacat: it appears to be a rails 2 thing.
[11:43:45] Coldblackice_: has joined #RubyOnRails
[11:47:35] hyperdrive: has joined #RubyOnRails
[11:47:58] bob434: has joined #RubyOnRails
[11:56:04] Spami: has joined #RubyOnRails
[11:57:55] arBmind: has joined #RubyOnRails
[11:59:21] blackmesa: has joined #RubyOnRails
[12:05:15] siaW: i have installed ruby-2.1.0 (as opposed to ruby-2.1.0p0 as it doesn’t exist!) and im’ still getting LoadError: cannot load such file -- migration_helpers
[12:05:18] siaW: any ideas? :D
[12:16:55] sevenseacat: i answered answered that...
[12:18:48] AzaToth: has joined #RubyOnRails
[12:21:08] beauby: has joined #RubyOnRails
[12:21:33] siaW: yeap seven
[12:21:39] siaW: you told me to check my ruby version
[12:21:55] siaW: i downloaded ruby 2.1.0
[12:22:35] Mattx: has joined #RubyOnRails
[12:27:54] tvon: has joined #RubyOnRails
[12:29:44] sevenseacat: i did, and then i said that migrations written for rails 2 will not work anymore
[12:30:01] sevenseacat: if you want to get the schema in your db, use db:schema:load
[12:31:39] siaW: but the rails version in the gemfile for this repor is 4.1.7
[12:32:31] sevenseacat: thats nice. it wasnt 4.1.7 in 2010 when that migration was written
[12:32:56] Ropeney: do a db:schema:load
[12:33:31] siaW: what does db:schema:load
[12:33:34] siaW: let me guess
[12:33:38] siaW: it loads the schema
[12:33:50] siaW: which i can find in schema.rb
[12:34:10] siaW: why do i want to load the schema here? what does it do?
[12:34:17] roshanavand: has joined #RubyOnRails
[12:34:42] sevenseacat: siaw: why are you trying to run the migrations?
[12:35:19] siaW: so i can have the db loaded
[12:35:24] siaW: and be able to start the server
[12:35:27] sevenseacat: and what do you think the schema is?
[12:35:48] siaW: schema is like a “plan” how the db should be build?
[12:36:02] sevenseacat: the schema is the state of the database, yes
[12:38:23] sevenseacat: you write migrations to modify the schema
[12:38:47] siaW: so db:schema:load should be doing what rake db:migrate should have done?
[12:39:02] blackmesa: has joined #RubyOnRails
[12:40:08] sevenseacat: it will have the same effect.
[12:41:08] siaW: so some progress. now i get “PG::DuplicateColumn: ERROR: column "print_links" of relation "users" already exists” what i’m thinking of doing is going to the PG console and deleting the db
[12:41:19] siaW: and then i can use db:schema:load this time
[12:41:21] Ropeney: rake db:reset
[12:41:28] sevenseacat: yes, you will need to reset your db because you've already run apile of the migrations.
[12:41:32] Ropeney: then run the schema:load
[12:44:09] siaW: if this doesn’t kill me i don’t know what else will https://gyazo.com/c48797c1f6317cce707808e7be4d7507
[12:48:04] moeabdol: has joined #RubyOnRails
[12:48:54] siaW: found something interesting
[12:49:01] siaW: after running rake db:reset
[12:49:15] siaW: 20151211174939 UserPrintSettingsNewExport
[12:49:22] siaW: means one migration is failign to go up
[12:49:42] Ropeney: do db:drop and db:create
[12:49:46] Ropeney: then db:schema:load
[12:50:15] siaW: Couldn't drop h2o_development
[12:50:23] Ropeney: you are connected to it
[12:50:27] Ropeney: stop being connected to it
[12:50:28] valetudo: has joined #RubyOnRails
[12:50:32] Ropeney: you probably should read a rails tutorial
[12:50:53] siaW: i have read many rails tutorials
[12:51:00] siaW: 2 actually
[12:51:03] siaW: i’m tired :p
[12:51:12] siaW: i’d rather learn from experience than keep reading
[12:51:19] siaW: i could read forever haha
[12:51:24] bronson: has joined #RubyOnRails
[12:51:25] Ropeney: you'd rather learn from other people tell you what to do it seems
[12:51:35] siaW: if that helps
[12:51:37] siaW: then yes
[12:52:53] FaresKAlaboud: has joined #RubyOnRails
[12:53:39] skislak: has joined #RubyOnRails
[12:54:41] _Tariq: has joined #RubyOnRails
[12:56:24] brt: has joined #RubyOnRails
[12:56:29] sevenseacat: it doesnt seem to be helping
[12:58:14] bob434: has joined #RubyOnRails
[12:59:56] siaW: now honeslty i’m stuck. i don’t understand why this migration won’t go “up” https://gist.github.com/siaw23/b647c85e37e9ea11c951
[13:00:38] fexilal: siaw : do you get some kind of error?
[13:00:39] Ropeney: why... are.... you... still.. running migrations
[13:01:04] siaW: ropeney. i’m loading schemas
[13:01:08] sevenseacat: no you're not
[13:01:13] siaW: stopped migrating
[13:01:17] pawnbox: has joined #RubyOnRails
[13:01:22] siaW: buuuut still same effect anyway
[13:01:39] siaW: i have tried disconnecting
[13:01:41] siaW: resetting
[13:01:43] siaW: creating
[13:01:46] siaW: schemal load
[13:01:51] sevenseacat: exactly what commands are you running and what is the full output of them?
[13:01:56] sevenseacat: because it sounds like you're doing random crazy shit
[13:02:06] siaW: no i’m not
[13:02:11] sevenseacat: prove me wrong hten
[13:02:21] siaW: this is what i just did
[13:02:29] roshanavand: has joined #RubyOnRails
[13:02:29] siaW: disconnected from the server
[13:02:40] sevenseacat: "exactly what commands are you running*
[13:02:51] siaW: CTRL + C
[13:02:59] siaW: to shut down rails server
[13:03:06] siaW: rake db:drop
[13:03:21] siaW: rake db:create
[13:03:21] sevenseacat: ...and the full output of them
[13:03:36] siaW: rake db:drop doesn’t output anything :/
[13:03:44] siaW: and so does rake db:create
[13:03:48] siaW: gist will come later :D
[13:04:00] siaW: now i have done
[13:04:03] siaW: rake db:create
[13:04:06] sevenseacat: thats a good thing to tell people who are already rapidly losing interest in helping you
[13:04:37] sevenseacat: its a simple copy and paste, and not at all difficult
[13:04:45] siaW: sorry but i know i have to gist something
[13:04:46] arBmind: has joined #RubyOnRails
[13:04:54] siaW: but the commands i’m using now don’t output anything
[13:04:59] fexilal: npm install migratethis
[13:05:02] Ropeney: just gist your whole terminal :(
[13:05:21] sevenseacat: gist what you're seeing that shows things not working, plus everything you did to get there
[13:05:30] sevenseacat: fexilal: this is not your terminal
[13:06:33] siaW: https://gist.github.com/siaw23/e7a0cc6785c202393ca3
[13:06:49] siaW: that’s a lot of stuff
[13:08:39] sevenseacat: k, the last thing is your schema load, and it appears to be successful
[13:08:42] sevenseacat: and the problem now is?
[13:10:23] sevenseacat: i see the problem - this app you've cloned didnt commit a full updated schema file
[13:10:33] sevenseacat: the timestamp at the top is wrong
[13:11:47] sevenseacat: the timestamp should reflect the timestamp of the most recently run migration - it does not
[13:12:01] siaW: you mean the timestamp for the migration that’s refusing to go up?
[13:12:28] sevenseacat: yes, because its already been run
[13:13:09] siaW: what if i reset the timestamp to be ahead of all the rest
[13:13:11] siaW: would it work then?
[13:14:01] sevenseacat: ahead? no. i've told you what you should do
[13:14:56] siaW: sorry seven, i might have missed it
[13:15:14] phredus: has joined #RubyOnRails
[13:15:38] sevenseacat: [21:11:47] sevenseacat: the timestamp should reflect the timestamp of the most recently run migration - it does not
[13:16:48] siaW: so this means i should edit the timestamp to be like the timestamp of the migration before?
[13:17:45] Ropeney: after the schema load, do a db:migrate
[13:17:59] sevenseacat: they did that, it didnt work
[13:18:21] sevenseacat: the line at the top of the schema file, eg. `ActiveRecord::Schema.define(version: 20160318044723) do`, it should have the same version number as the last timestamp
[13:18:27] agit0: has joined #RubyOnRails
[13:18:45] Rubie: has joined #RubyOnRails
[13:18:53] sevenseacat: because the migration has already been run, the columns in it can't be added again, hence an error
[13:19:01] sevenseacat: *same version number as the last migration
[13:19:06] siaW: aaaaaaaaaaaah
[13:19:08] siaW: i see it now!
[13:19:34] Ropeney: congratulations :D
[13:19:43] siaW: ropeney: see? there’s no way i’ll get this kind of thing from books! experience :D
[13:20:00] siaW: seven your book is awesome btw. haven’t finished it though
[13:20:02] sevenseacat: because books don't deal with broken apps
[13:20:23] mrgreenfur: has joined #RubyOnRails
[13:20:54] sevenseacat: and neither should you if you are not yet familiar with how things work
[13:20:54] siaW: but thanks a BUNCH sevenseacat and ropeney
[13:21:50] siaW: i agree with you seven. but i’m too eager and hasty
[13:22:09] siaW: impatient maybe…
[13:23:15] beauby: has joined #RubyOnRails
[13:24:36] blackhuey1: has joined #RubyOnRails
[13:24:42] blackhuey1: has left #RubyOnRails: ()
[13:25:11] siaW: i guess now i can do a normal rake db:migrate
[13:25:14] siaW: my favourite :p
[13:25:15] AntiSpamMeta: has joined #RubyOnRails
[13:25:20] bob434: has joined #RubyOnRails
[13:27:16] Ericx2x_: has joined #RubyOnRails
[13:31:15] pawnbox: has joined #RubyOnRails
[13:32:19] johnflux: has joined #RubyOnRails
[13:35:27] felltir: has joined #RubyOnRails
[13:36:57] stannard: has joined #RubyOnRails
[13:38:24] CodaBrink: has joined #RubyOnRails
[13:40:54] akshat: has joined #RubyOnRails
[13:49:16] stannard: has joined #RubyOnRails
[13:49:18] moeabdol: has joined #RubyOnRails
[13:52:44] IrishGringo: has joined #RubyOnRails
[13:53:27] krz: has joined #RubyOnRails
[13:55:50] qejk: has joined #RubyOnRails
[13:56:28] User458764: has joined #RubyOnRails
[13:57:31] futilegames: has joined #RubyOnRails
[14:01:07] pawnbox: has joined #RubyOnRails
[14:01:25] FooMunki: has joined #RubyOnRails
[14:02:37] futilegames: has joined #RubyOnRails
[14:04:16] cac: has joined #RubyOnRails
[14:05:20] gabr13l: has joined #RubyOnRails
[14:09:21] Meow-J: has joined #RubyOnRails
[14:09:54] agit0: has joined #RubyOnRails
[14:11:17] th0m_: has joined #RubyOnRails
[14:19:22] P4Titan: has joined #RubyOnRails
[14:20:04] P4Titan: Hello all. I am fairly new to models and migrations. After a bit of research, I came up w/ this: http://pastie.org/10775257 . Could someone offer advice as to if it is correct and all?
[14:20:25] sevenseacat: does it work and does it do what you want?
[14:20:51] P4Titan: I don't know. Shouldn't I have it correct before I do a migration?
[14:21:04] P4Titan: or should I try the migration
[14:21:09] sevenseacat: how do you know its correct unless you try it?
[14:21:27] P4Titan: I guess ...
[14:21:50] P4Titan: my main question then is, did I implement the has_one :through correctly w/ the add_reference
[14:23:50] HalcyonicStorm: has joined #RubyOnRails
[14:23:54] beauby: has joined #RubyOnRails
[14:25:17] sevenseacat: your associations don't make any sense - a user has many links, but which one belongs to the rev_req?
[14:25:55] P4Titan: well, the idea is that a user has many Links and RevReq, yes
[14:26:02] sevenseacat: what is a RevReq?
[14:26:11] sevenseacat: a more meaningful name might help me figure out what you're trying to do
[14:26:20] P4Titan: ReviewRequest
[14:26:38] sevenseacat: ok, i'd start by calling the model that
[14:26:50] P4Titan: and a Link of one user, points to a RevReq of another User
[14:26:53] P4Titan: and vice-versa
[14:27:30] P4Titan: so one user has many Links and ReviewRequests
[14:27:38] sevenseacat: yep, got that part
[14:27:42] P4Titan: another User also has many Links and ReviewRequests
[14:28:04] sevenseacat: its the associations between Links and ReviewRequests that are screwy
[14:28:14] P4Titan: say the first user has a link which points to a reviewrequest of the second and that second users reviewrequest points to the first user's link
[14:28:19] srinidhi: has joined #RubyOnRails
[14:28:39] P4Titan: it is very interconnected, but I need to be able to link users in some way
[14:28:55] P4Titan: in particular one's links to anothers review request, both directions
[14:29:10] sevenseacat: okay, I'm not following with what you're trying to do but your code is not correct
[14:29:15] sevenseacat: and will not work
[14:29:26] P4Titan: :D that is what I supposed
[14:29:44] P4Titan: I've found a bunch of documention over simply models
[14:30:27] sevenseacat: you're not linking to 'other users' anything with your current code
[14:30:38] sevenseacat: which i guess is the missing step, but I don't understand it
[14:31:17] P4Titan: doesn't the assignment part of these associations happen during runtime?
[14:31:34] sevenseacat: if they were structured correctly, sure. they're not.
[14:31:35] P4Titan: can't I assign one user's review request to another's link then?
[14:32:43] sevenseacat: at the moment you have a ReviewRequest associated to a single user, and somehow (incorrectly) associated to one of that user's links
[14:32:47] sevenseacat: no other users involved
[14:33:09] P4Titan: how would I involve other users?
[14:33:21] P4Titan: aren't all users under the User model?
[14:33:42] sevenseacat: sure they are, but your ReviewRequest only has a single user_id field
[14:33:53] sevenseacat: therefore it is linked to only one user
[14:34:17] Rubie: has joined #RubyOnRails
[14:34:18] P4Titan: I also add a link_id field
[14:34:28] P4Titan: to a reviewrequest
[14:34:52] sevenseacat: thats not used, based on your model code
[14:35:04] P4Titan: or does the has_one :through user the user_id I referenced to find the link?
[14:35:14] sevenseacat: you do not want a has_one through here
[14:37:01] P4Titan: that's how I visualized it
[14:37:13] P4Titan: a link connects to a reviewrequest via a User
[14:37:21] jarib: has joined #RubyOnRails
[14:37:21] jarib: has joined #RubyOnRails
[14:37:25] cac: has joined #RubyOnRails
[14:37:47] tribals: has joined #RubyOnRails
[14:38:15] sevenseacat: tribals: evening
[14:39:07] Rubie: has joined #RubyOnRails
[14:39:31] tribals: does ActiveRecord creates an automagicial scopes for bool feilds, like automagical methods `my_model.published?` ?
[14:40:01] Spami: has joined #RubyOnRails
[14:40:02] tribals: severseatcat: thanks
[14:41:07] Rubie: has joined #RubyOnRails
[14:41:30] tribals: sevenseacat: is there a common convention to name such scopes? (i mean scopes for bool fields) like `is_published` or whatever?
[14:42:08] agit0: has joined #RubyOnRails
[14:42:20] P4Titan: sevenseacat: Does has_one :through have to link via a has_one in the :through model?
[14:42:22] sevenseacat: name them whatever the field represents. eg. for a `published` boolean, you might want `published` and `unpublished` scopes
[14:43:11] arBmind1: has joined #RubyOnRails
[14:43:29] sevenseacat: P4Titan: that would be what the name implies, i believe.
[14:43:55] sevenseacat: but then again, I'm not really following your thinking
[14:44:26] sevenseacat: http://guides.rubyonrails.org/association_basics.html#the-has-one-through-association is a brief explanation of a has_one through
[14:44:45] P4Titan: yes, but that documentation isn't very verbose
[14:44:54] sevenseacat: your example would be if a supplier's account_history was for a different account than the linked account
[14:44:58] sevenseacat: which does not make snese
[14:45:23] P4Titan: well, it doesn't make sense in the context of suppliers
[14:45:29] sevenseacat: its not a topic to be very verbose about
[14:45:39] P4Titan: would u care to listen to another description of what Im trying to do?
[14:45:41] mrchris: has joined #RubyOnRails
[14:45:45] sevenseacat: its a straightforward shortcut through a middle association
[14:45:51] sevenseacat: if its going to make more sense than the others, sure
[14:45:54] bob434: has joined #RubyOnRails
[14:46:19] chrissonar: has joined #RubyOnRails
[14:46:26] P4Titan: so, one user uploads various url links which get saved in the Links table
[14:46:39] tvon: has joined #RubyOnRails
[14:47:38] P4Titan: then, there should be some way for another user to be able to access a specific link of the first user, the way I thought was by making a review request that linked to a Link of another user
[14:47:53] robbyoconnor: has joined #RubyOnRails
[14:47:54] P4Titan: likewise, the first user's link should know where to find the review request of the second user
[14:47:57] sevenseacat: right, thats what you dont have at the moment
[14:48:07] P4Titan: yes, of course
[14:48:09] sevenseacat: so you want a direct link between links and review requests, not through users
[14:48:12] Rubie: has joined #RubyOnRails
[14:48:55] sevenseacat: a direct association might be better wording, given we have a Link model
[14:49:35] P4Titan: ok, and there is no restriction stating that a Link's ReviewRequest has to be under the same user
[14:49:54] P4Titan: like, I can assign a ReviewRequest of another user to a given Link w/o problems
[14:50:28] sevenseacat: right. with your code the way it currently it, that isnt possible because there is no assigning to be done.
[14:53:35] bronson: has joined #RubyOnRails
[14:55:13] Rubie: has joined #RubyOnRails
[14:57:42] CodaBrink: has joined #RubyOnRails
[14:58:30] CodaBrink: has joined #RubyOnRails
[14:58:57] mrchris: has joined #RubyOnRails
[14:59:17] CodaBrink: has joined #RubyOnRails
[14:59:44] P4Titan: Does every has_one need to be paired w/ a belongs_to?
[15:00:06] sevenseacat: if you want to reference the relationship from either side, then yes
[15:02:02] P4Titan: hypothetically speaking, can each model have has_one's?
[15:02:21] sevenseacat: not if they're referencing the same relationship.
[15:03:07] sevenseacat: that would mean ModelA would have a b_id field and ModelB would have an a_id field and you'd need to manually keep them in sync, always.
[15:03:11] P4Titan: to get this straight, belongs_to creates an id field and has_one only tells the model that the other Model should have an id that matches its own?
[15:03:33] sevenseacat: yes, the only difference between a has_one and a belongs_to is which field has the foreign key.
[15:03:37] leifcr: has joined #RubyOnRails
[15:03:37] sevenseacat: *is which model
[15:03:49] P4Titan: has_one says that the other model has the key
[15:04:14] sevenseacat: belongs_to says that this model has the key. but there should be only one key.
[15:04:15] P4Titan: therefore, if both models have has_one, neither will have the key and therefore, not work
[15:04:54] sevenseacat: it would work, but they would not be talking about the same ket.
[15:04:57] mrchris: has joined #RubyOnRails
[15:05:49] P4Titan: however, as per the rails doc, has_one does not seem to create any key entries
[15:05:55] P4Titan: or does it?
[15:06:23] sevenseacat: no associations 'create key entries'. you create the keys when you write the migration.
[15:06:49] P4Titan: sorry to ask, but I don't seem to understand this then: what do associations do?
[15:07:32] HalcyonicStorm: has left #RubyOnRails: ()
[15:07:51] sevenseacat: provide quick and easy matching and lookup between records. If you have a User that has_many Links, you could manually look up Link.where(user_id: user.id) or you could just do user.links
[15:08:09] uglybandersnatch: has joined #RubyOnRails
[15:08:16] sevenseacat: the second uses the association you define
[15:08:54] sevenseacat: you also get a boatload of ways to manage the links between records
[15:09:04] sevenseacat: all of which are detailedi n the associations guide
[15:11:35] Mia: has joined #RubyOnRails
[15:14:15] stannard: has joined #RubyOnRails
[15:14:57] P4Titan: sevenseacat: ty for ur input
[15:15:36] P4Titan: I over thought what associations did; I feel like they're simpler than I make them out to be
[15:15:38] pawnbox: has joined #RubyOnRails
[15:16:21] pawnbox: has joined #RubyOnRails
[15:16:26] Ropeney: P4Titan, They are, if u do things normal
[15:16:54] sevenseacat: they are quite simple. but without knowing how you make them out to be, it's virtually impossible to compare that to how they actually are
[15:19:10] sudoubuntu: has joined #RubyOnRails
[15:21:34] davee_: has joined #RubyOnRails
[15:23:04] drptbl: has joined #RubyOnRails
[15:23:29] felltir: has joined #RubyOnRails
[15:24:36] beauby: has joined #RubyOnRails
[15:27:51] drptbl: has joined #RubyOnRails
[15:32:12] cac: has joined #RubyOnRails
[15:33:16] adavia: has joined #RubyOnRails
[15:33:41] awasum: has joined #RubyOnRails
[15:36:43] Mattx: has joined #RubyOnRails
[15:38:56] xcesariox: has joined #RubyOnRails
[15:49:59] User458764: has joined #RubyOnRails
[15:55:01] humbledaisy: has joined #RubyOnRails
[15:59:40] blackmesa: has joined #RubyOnRails
[16:03:01] dionysus69: has joined #RubyOnRails
[16:07:40] mrchris: has joined #RubyOnRails
[16:12:59] d0nn1e: has joined #RubyOnRails
[16:18:14] mdw: has joined #RubyOnRails
[16:19:53] User458764: has joined #RubyOnRails
[16:25:05] tvon: has joined #RubyOnRails
[16:26:04] griffindy: has joined #RubyOnRails
[16:26:55] ascarter: has joined #RubyOnRails
[16:26:57] tvon_: has joined #RubyOnRails
[16:35:58] chandlerbing: has joined #RubyOnRails
[16:39:52] moeabdol: has joined #RubyOnRails
[16:40:04] sudoubuntu: has joined #RubyOnRails
[16:40:28] dvinciguerra: has joined #RubyOnRails
[16:41:12] trifling-jest: has joined #RubyOnRails
[16:41:15] trifling-jest: has left #RubyOnRails: ()
[16:41:42] User458764: has joined #RubyOnRails
[16:42:05] gingray: has joined #RubyOnRails
[16:42:29] User458764: has joined #RubyOnRails
[16:42:50] bob434: has joined #RubyOnRails
[16:45:35] chandlerbing: has joined #RubyOnRails
[16:46:42] Wixy: has joined #RubyOnRails
[16:47:15] gokulnath: has joined #RubyOnRails
[16:47:48] Wixy: Hey. Is it possible to define dynamic controller names in routes? For example: get '/v:api/:processor/:handler' => '#{processor}/v#{api}/#{handler}#handle'
[16:48:11] stannard: has joined #RubyOnRails
[16:50:45] DragonPunch: has joined #RubyOnRails
[16:52:32] myntcake: has joined #RubyOnRails
[16:55:44] bronson: has joined #RubyOnRails
[16:56:19] jaequery: has joined #RubyOnRails
[16:56:24] _Tariq: has joined #RubyOnRails
[16:56:54] _Tariq: has joined #RubyOnRails
[16:57:21] blackmesa: has joined #RubyOnRails
[16:58:20] differentreality: has joined #RubyOnRails
[17:01:09] merida: has joined #RubyOnRails
[17:04:53] ql6wlld: has joined #RubyOnRails
[17:09:54] drptbl: has joined #RubyOnRails
[17:13:29] tenderlove: has joined #RubyOnRails
[17:15:36] pawnbox: has joined #RubyOnRails
[17:16:21] dvinciguerra: has joined #RubyOnRails
[17:17:01] htmldrum: has joined #RubyOnRails
[17:17:03] htmldrum_: has joined #RubyOnRails
[17:18:43] GodFather: has joined #RubyOnRails
[17:19:46] diegoaguilar: has joined #RubyOnRails
[17:22:53] _Tariq: has joined #RubyOnRails
[17:29:36] lxsameer: has joined #RubyOnRails
[17:31:55] xcesariox: has joined #RubyOnRails
[17:32:51] smathy: has joined #RubyOnRails
[17:33:00] ashishsingh173: has joined #RubyOnRails
[17:33:07] User458764: has joined #RubyOnRails
[17:35:35] nickenchuggets: has joined #RubyOnRails
[17:35:35] nickenchuggets: has joined #RubyOnRails
[17:36:02] DragonPunch: has joined #RubyOnRails
[17:36:07] pawnbox: has joined #RubyOnRails
[17:40:39] RegulationD: has joined #RubyOnRails
[17:53:16] GodFather: has joined #RubyOnRails
[17:54:49] blackmesa: has joined #RubyOnRails
[17:57:14] silentpost: has joined #RubyOnRails
[17:57:38] zmartAway: has left #RubyOnRails: ()
[18:01:17] drptbl: has joined #RubyOnRails
[18:02:26] tildes: has joined #RubyOnRails
[18:05:50] GodFather: has joined #RubyOnRails
[18:08:12] arup_r: has joined #RubyOnRails
[18:12:02] sandstrom: has joined #RubyOnRails
[18:14:23] Dimik: has joined #RubyOnRails
[18:14:30] jkahn: has joined #RubyOnRails
[18:17:15] pawnbox_: has joined #RubyOnRails
[18:18:14] djellemah: has joined #RubyOnRails
[18:21:59] marcdel: has joined #RubyOnRails
[18:22:27] stannard: has joined #RubyOnRails
[18:25:03] lxsameer: has joined #RubyOnRails
[18:25:06] andatche: has joined #RubyOnRails
[18:28:19] dvinciguerra: has joined #RubyOnRails
[18:32:33] eyeamaye: has joined #RubyOnRails
[18:33:00] i4: has joined #RubyOnRails
[18:34:15] FooMunki: has joined #RubyOnRails
[18:34:21] User458764: has joined #RubyOnRails
[18:34:42] i4: Why wehen I try to run this script onmy server at end after all i get "24" in last additional string? <%= 24.times do |i| %> <%= i+1 %><br> <%= (i==23)? "eeeee" : nil %> <% end %>
[18:35:03] i4: but I must get only from 0 to 23 strings
[18:35:28] apeiros: <%= %> embeds the return value of the expression
[18:35:31] smathy: i4, because you're telling it to output the return value of 24.times
[18:35:33] apeiros: and the return value of 24.times is 24
[18:35:36] i4: oyu right!
[18:35:43] i4: my fault! thanks
[18:37:18] lxsameer: has joined #RubyOnRails
[18:39:04] arthropododo: has joined #RubyOnRails
[18:40:06] lxsameer: has joined #RubyOnRails
[18:46:53] lxsameer: has joined #RubyOnRails
[18:50:47] QualityAddict: has joined #RubyOnRails
[18:55:53] Inside: has joined #RubyOnRails
[18:55:53] Inside: has joined #RubyOnRails
[18:56:20] lxsameer: has joined #RubyOnRails
[18:57:47] bronson: has joined #RubyOnRails
[18:57:49] mdw: has joined #RubyOnRails
[18:57:52] scepticulous: has joined #RubyOnRails
[19:00:19] mdw: has joined #RubyOnRails
[19:05:22] adavia: is this ok? self.where(attachable_id: user.id).where(attachable_type: "User").update_all(default: false)
[19:08:06] smathy: adavia, assuming that's a polymorphic association, you should be able to just do: where(attachable: user)...
[19:08:21] jaequery: has joined #RubyOnRails
[19:09:06] adavia: smathy: oh yes i forgot bout that
[19:09:55] adavia: smathy: why Attachment.where works and not self.where ?
[19:09:57] uglybandersnatch: has joined #RubyOnRails
[19:10:45] smathy: adavia, you're not showing enough code for me to know, but at a guess - because you're calling it in an instance method, so `self` is the instance and `where` is a class method.
[19:11:09] Mia: has joined #RubyOnRails
[19:11:09] Mia: has joined #RubyOnRails
[19:12:00] adavia: smathy: now it makes sense
[19:12:05] adavia: smathy: thanks
[19:12:33] smathy: adavia, np.
[19:14:11] spyd3r: has joined #RubyOnRails
[19:15:39] Musashi007: has joined #RubyOnRails
[19:16:10] arup_r: adavia: what about user.attachables.update_all(default: false) ?
[19:16:23] jaequery: has joined #RubyOnRails
[19:17:30] arup_r: You can make a method inside the User model for this, and do call it as many time as needed..Well, this is another way to go... I am not saying your approach is wrong. :)
[19:24:34] Silex: has joined #RubyOnRails
[19:25:02] lxsameer: has joined #RubyOnRails
[19:25:22] IrishGringo: has joined #RubyOnRails
[19:25:54] fedexo: has joined #RubyOnRails
[19:26:40] agit0: has joined #RubyOnRails
[19:27:36] moeabdol: has joined #RubyOnRails
[19:27:41] lxsameer: has joined #RubyOnRails
[19:27:59] AntiSpamMeta: has joined #RubyOnRails
[19:28:48] djellemah_: has joined #RubyOnRails
[19:32:05] adavia: arup_r: yes that would work also
[19:33:29] greengriminal: has joined #RubyOnRails
[19:33:40] lxsameer: has joined #RubyOnRails
[19:35:11] silentpost: has joined #RubyOnRails
[19:37:46] blackmesa: has joined #RubyOnRails
[19:38:16] i4: please give an advice how can I optimize this code? http://pastebin.com/ZEqi3Zyv
[19:39:22] i4: https://gist.github.com/anonymous/56a23733d9740b5d9941
[19:39:32] i4: please take a look
[19:40:45] GnuYawk: has joined #RubyOnRails
[19:41:01] stannard: has joined #RubyOnRails
[19:46:58] Wixy: i4, wtf? it sucks
[19:48:06] Wixy: i==5 or i == 10 or i==15 or i==20 or i==25 --> if i % 5 == 0
[19:48:10] Wixy: same for 1, 6, 11, etc
[19:48:29] fox_mulder_cp: i have a unqualified '\u' substing whet concat some vars
[19:48:30] fox_mulder_cp: self.web_root_path = "/var/clients/client"<<self.client.id.to_i.to_s<<'/'<<self.name<<"."<<
[19:48:33] fox_mulder_cp: self.client.reseller.domain_zones.where(group: 2).first.name
[19:48:45] Wixy: 24.times do |i| i=i+1 --> 1.upto(24) do |i|
[19:48:56] fox_mulder_cp: before self.client.id.to_i.to_s add \u after 'client'
[19:49:17] Wixy: also I don't know why you have two .times and not just one, i4
[19:49:19] fox_mulder_cp: how to drop it and leading zeroes in client id
[19:49:59] Wixy: fox_mulder_cp, what do you want to do?
[19:50:05] fox_mulder_cp: also, now it's a integer (sqlite), and what do when it moved to guids (pgsql)
[19:50:06] Wixy: give an example
[19:50:27] fox_mulder_cp: Wixy: web_root_path: "/var/clients/client1/blog.sites.mulder.kiev.ua'
[19:50:49] Wixy: i4, I meant 1.upto(25) btw, no 24
[19:50:50] fox_mulder_cp: now it web_root_path: "/var/clients/client\u0001/blogsites.mulder.kiev.ua"
[19:51:21] Wixy: fox_mulder_cp, why do you need that?
[19:52:00] Wixy: you need to add \u just before numbers?
[19:52:04] Wixy: I didn't get it
[19:52:17] fox_mulder_cp: Wixy: i's a self.before_save method for my WebApp model
[19:52:34] fox_mulder_cp: which update model properties before ansible run
[19:52:44] smathy: fox_mulder_cp, !code
[19:52:44] helpa: fox_mulder_cp: 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:53:20] pawnbox: has joined #RubyOnRails
[19:53:36] i4: Wizy hm
[19:53:38] fox_mulder_cp: smathy: i drop this code some lines ago
[19:54:23] Silex: has joined #RubyOnRails
[19:54:23] Wixy: fox_mulder_cp, why do you need to add \u before numbers? what for?
[19:54:50] fox_mulder_cp: Wixy: i want drop it
[19:55:12] fox_mulder_cp: https://gist.github.com/foxmuldercp/729f3a74920d19735913
[19:55:30] Wixy: "/var/clients/client#{self.client.id}/#{self.name}.#{self.client.reseller.domain_zones.where(group: 2).first.name}"
[19:55:35] Wixy: try this ^
[19:55:58] fox_mulder_cp: Wixy: hm. great idea. what is difference ?
[19:56:16] Wixy: no difference I believe, it's just easier to read
[19:56:22] Wixy: what do you get with that line?
[19:56:52] fox_mulder_cp: web_root_path: "/var/clients/client\u0001/blogsites.mulder.kiev.ua"
[19:57:02] Wixy: what is client.id?
[19:57:05] Wixy: what class is it?
[19:57:12] Wixy: are you sure?
[19:57:24] Wixy: you had .to_i previously
[19:57:42] Wixy: try self.client.id.class
[19:57:49] Wixy: and see what you get
[19:58:46] Rubie: has joined #RubyOnRails
[19:59:04] i4: Wizy <% if i % 5 == 0 %> it's not the same for my example i==5 or i == 10 or i==15 or i==20 or i==25
[19:59:16] Wixy: is it a column on a database? fox_mulder_cp
[19:59:33] fox_mulder_cp: Wixy: yes, default rails scaffold id
[20:00:19] Wixy: i4, why not?
[20:01:26] i4: because i need <div class="item text-center"> for fist 5 images and for next 5 and next and next
[20:02:00] Wixy: fox_mulder_cp, try this just in case "/var/clients/client#{1}/#{self.name}.#{self.client.reseller.domain_zones.where(group: 2).first.name}"
[20:02:48] Wixy: i4, that's what you get with i % 5 == 0, it returns true if i==5 or i==10 or ...
[20:02:57] yfeldblum: has joined #RubyOnRails
[20:03:07] i4: Wixy and what about i == 1?
[20:03:56] Wixy: i4, i==5 or i == 10 or i==15 or i==20 or i==25
[20:03:59] Wixy: this is not true for i=1
[20:04:28] Wixy: neither is i%5==0
[20:05:11] Aherin: has joined #RubyOnRails
[20:06:15] i4: Wixy not working for me thanks
[20:06:34] Wixy: it surely does, you're doing something wrong somewhere else
[20:06:37] Wixy: show your code
[20:10:52] TheShaun: has joined #RubyOnRails
[20:13:35] i4: Wixy https://gist.github.com/anonymous/99e782486e52ba75bc97
[20:14:01] i4: if I remove i==1 and i==5 it's not working
[20:14:09] i4: and with this elements too)
[20:14:14] Wixy: what's the expected result?
[20:14:37] i4: i need to every five images will be placed in <div class="item text-center <%= (i == 1)? "active" : nil %>"></div>
[20:14:45] bob434: has joined #RubyOnRails
[20:15:15] Wixy: you need to group 5 images within a div?
[20:15:30] Wixy: every 5 images
[20:16:10] siaW: away from rails. but i’ll ask anyone maybe someone knows
[20:16:26] Wixy: paste the result you're getting with this code
[20:16:34] siaW: i have a pull request. i want to edit some stuff. is pushing more changes the best way?
[20:18:03] i4: Wixy https://gist.github.com/anonymous/26ad76e69a9e83b72785
[20:18:40] djbkd: has joined #RubyOnRails
[20:20:10] norfumpit: has joined #RubyOnRails
[20:20:57] i4: Wixy all is ok
[20:21:12] i4: I place </div> before <div>
[20:21:13] Wixy: now the two condicions are the same
[20:21:18] i4: and all is wroked
[20:21:20] Wixy: don't do that!
[20:22:26] i4: it's working, but first part have is only 4 strings
[20:23:03] Wixy: https://gist.github.com/anonymous/99e782486e52ba75bc97
[20:23:08] i4: i do it like this https://gist.github.com/anonymous/57e85d295c9974a2d4fb
[20:23:09] pawnbox: has joined #RubyOnRails
[20:23:11] Wixy: check the comment there
[20:23:37] Wixy: i4, you shouldn't like that code
[20:23:45] i4: i ll try
[20:23:59] i4: what is th eformat of your code
[20:24:05] i4: what do you use?
[20:27:20] stannard: has joined #RubyOnRails
[20:27:40] smathy: So painful.
[20:29:32] Wixy: smathy, hey, do you happen to know if it's possible to define dynamic controller names in routes?
[20:29:36] Wixy: For example: get '/v:api/:processor/:handler' => '#{processor}/v#{api}/#{handler}#handle'
[20:29:48] Wixy: or something similar to achieve that
[20:30:18] smathy: I don't know off hand, sorry
[20:30:21] i4: Wixy it's worked great thanks!
[20:30:30] Wixy: http://joshsymonds.com/blog/2012/05/22/dynamic-routing-with-rails/
[20:30:32] uglybandersnatch: has joined #RubyOnRails
[20:30:35] Wixy: I've found this post from 2012
[20:30:52] Wixy: it's kind of the same but I don't have a predefined array with processors
[20:32:47] Wixy: and I would need all API versions beforehand, I can't use that
[20:33:49] i4: Wixy the code without <% %> it' SLIM?
[20:34:09] i4: HAML or SLIM?
[20:36:42] htmldrum_: has joined #RubyOnRails
[20:36:42] htmldrum: has joined #RubyOnRails
[20:36:53] Wixy: i4, I don't know what you're talking about, it's plain ruby
[20:37:09] Wixy: I wrote that and executed it using pry just to check it worked
[20:37:23] Wixy: it's not erb, haml, slim or anything else
[20:37:29] _Tariq: has joined #RubyOnRails
[20:37:45] i4: oh ok thanks
[20:42:34] FooMunki: has joined #RubyOnRails
[20:43:16] QualityAddict: has joined #RubyOnRails
[20:44:29] blackmesa: has joined #RubyOnRails
[20:46:31] Inside: has joined #RubyOnRails
[20:47:40] fox_mulder_cp: has joined #RubyOnRails
[20:49:19] sebyx07_: has joined #RubyOnRails
[20:50:02] TheGreatGudsby: has joined #RubyOnRails
[20:51:08] stannard: has joined #RubyOnRails
[20:56:30] Trynemjoel: has joined #RubyOnRails
[20:58:50] fox_mulder_cp: hm. bot can send private messages when user is online again?
[20:59:55] bronson: has joined #RubyOnRails
[21:00:48] Balzrael: has joined #RubyOnRails
[21:01:02] _Tariq: has joined #RubyOnRails
[21:01:29] agit0: has joined #RubyOnRails
[21:01:55] arup_r: fox_mulder_cp: i think no..
[21:02:42] th0m_: has joined #RubyOnRails
[21:03:06] fox_mulder_cp: arup_r: bad ( wixy is my collaegue, as i see in privat
[21:05:56] Radar: fox_mulder_cp: /msg memoserv help
[21:06:24] fox_mulder_cp: Radar: wow, glad to see u again.
[21:08:21] arup_r: nice to know memoserv
[21:08:34] arup_r: i knew only nickserv :D
[21:08:41] mrgreenfur: has joined #RubyOnRails
[21:09:08] fox_mulder_cp: Radar: I boasted to you my progress in writing the control panel?
[21:10:19] meoblast001: has joined #RubyOnRails
[21:10:50] dvinciguerra: has joined #RubyOnRails
[21:13:57] trinaldi: has joined #RubyOnRails
[21:15:28] Trynemjoel: has joined #RubyOnRails
[21:16:02] Cache_Money: has joined #RubyOnRails
[21:21:43] blackmesa: has joined #RubyOnRails
[21:24:00] TheGreatGudsby: has left #RubyOnRails: ("nah bro...")
[21:24:02] moeabdol: has joined #RubyOnRails
[21:30:01] Trynemjoel: has joined #RubyOnRails
[21:30:14] TheGreatGudsby: has joined #RubyOnRails
[21:30:50] TheGreatGudsby: has joined #RubyOnRails
[21:32:09] DoctorMonocular: has joined #RubyOnRails
[21:33:28] AntiSpamMeta: has joined #RubyOnRails
[21:39:20] northfurr: has joined #RubyOnRails
[21:43:42] flashpoint9: has joined #RubyOnRails
[21:45:13] Rubie: has joined #RubyOnRails
[21:45:30] bmf: has joined #RubyOnRails
[21:45:56] bmf_: has joined #RubyOnRails
[21:46:13] bmf_: has joined #RubyOnRails
[21:46:34] Silex: has joined #RubyOnRails
[21:47:23] _Tariq: has joined #RubyOnRails
[21:47:28] bmf_: has joined #RubyOnRails
[21:47:33] Trynemjoel: has joined #RubyOnRails
[21:48:03] bmf: has joined #RubyOnRails
[21:52:26] hightower3: has joined #RubyOnRails
[21:54:53] rubyonrailed: has joined #RubyOnRails
[21:56:05] rubyonrailed: What’s the best way to determine if a user has viewed data? For example, I want to show a “NEW” label next to data the user hasn’t viewed yet. I found fairly simple way on stackoverflow but it’s pretty dated.
[21:57:23] fox_mulder_cp: rubyonrailed: i think about caching and date-based functions
[21:57:56] fox_mulder_cp: and touching 'new' -> 'read' state
[21:58:02] jaequery: has joined #RubyOnRails
[21:58:42] fox_mulder_cp: rubyonrailed: in my project i make a log (userid, date_added, state, message, type) class
[21:58:53] bob434: has joined #RubyOnRails
[21:59:06] russt: has joined #RubyOnRails
[21:59:19] fox_mulder_cp: and when user open page show 2-3 first flashes with button 'see more events'
[21:59:51] fox_mulder_cp: and touch it to 'read' when 'x' button pushed
[22:00:48] northfurr: has joined #RubyOnRails
[22:02:19] xlegoman: has joined #RubyOnRails
[22:05:03] jenrzzz: has joined #RubyOnRails
[22:05:03] jenrzzz: has joined #RubyOnRails
[22:06:04] jhack: has joined #RubyOnRails
[22:06:17] GnuYawk: has joined #RubyOnRails
[22:06:54] jhack: Anyone upload their rails app onto a small orange before?
[22:07:06] jhack: I’ve linked it to the public folder, but still not getting anything
[22:07:14] greengriminal: has joined #RubyOnRails
[22:12:13] spyd3r: has joined #RubyOnRails
[22:14:45] htmldrum: has joined #RubyOnRails
[22:14:46] htmldrum_: has joined #RubyOnRails
[22:21:23] Gooer: has joined #RubyOnRails
[22:23:03] Silex: has joined #RubyOnRails
[22:24:09] Trynemjoel: has joined #RubyOnRails
[22:24:12] sandstrom: has joined #RubyOnRails
[22:24:29] delgiudices: has joined #RubyOnRails
[22:25:04] yatish27: has joined #RubyOnRails
[22:25:04] [gmi]: has joined #RubyOnRails
[22:27:38] DragonPunch: Can someone help me go through this code real quick? I'm just wondering what the first def does ?
[22:28:32] DragonPunch: It says group.hotels.each do |h| user.add_role :agent, h end end ... where does it get 'group' or ... 'hotels' ... or .. 'user' from ??
[22:28:43] qhp: has joined #RubyOnRails
[22:29:02] jhack: from the migrations
[22:29:40] apeiros: DragonPunch: hotels is obviously a method on the result of group. and group is either a local variable or a method. same for user.
[22:29:57] apeiros: and with only the given slice of code, we can't know. but given your confusion, I'd assume they're methods.
[22:30:25] Gargron: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[22:30:28] DragonPunch: Well, group is another model and hotels is another model as well, if that gives more context
[22:30:42] apeiros: DragonPunch: Group is a model. foo.group is a method.
[22:30:54] apeiros: . invokes methods. always.
[22:31:06] jhack: check the models
[22:31:14] apeiros: but yes, of course, the result is probably a relation of Hotel instances.
[22:31:37] DragonPunch: jhack, I will check the group model because it belong_to: group
[22:31:39] DragonPunch: for a method called hotels
[22:32:06] apeiros: it'll be Group.has_many :hotels
[22:32:14] DragonPunch: thats what is
[22:32:18] DragonPunch: but thats not a method is it ?
[22:32:22] DragonPunch: that is an association
[22:32:23] jhack: and check user model for add_role
[22:32:33] apeiros: DragonPunch: how do you suppose an association works?
[22:32:57] DragonPunch: to associate between two models to make common operations more simpler
[22:33:02] greengriminal: has joined #RubyOnRails
[22:33:20] apeiros: and what do you get to make common operations simpler? or rather - how do you perform operations in ruby?
[22:33:37] DragonPunch: you break it down
[22:34:52] apeiros: going the wrong direction. how do you perform operations in ruby?
[22:35:42] apeiros: all associations do is provide a couple of *method* to make common operations simpler. one of them being a method to get a relation.
[22:36:03] apeiros: +s, somewhere. left as an exercise to the reader.
[22:37:01] jhack: http://guides.rubyonrails.org/association_basics.html#has-many-association-reference
[22:42:17] quazimodo: has joined #RubyOnRails
[22:42:58] pawnbox: has joined #RubyOnRails
[22:44:21] yfeldblum: has joined #RubyOnRails
[22:45:15] htmldrum: has joined #RubyOnRails
[22:45:16] htmldrum_: has joined #RubyOnRails
[22:49:55] delgiudices: has joined #RubyOnRails
[22:49:59] delgiudices: Is there a recommended gem to share content in social networks?
[22:50:08] delgiudices: I'm looking at hermango/shareable but it's not really working for me
[22:51:59] _Tariq: has joined #RubyOnRails
[22:58:41] superlou: has joined #RubyOnRails
[22:58:55] sudoubuntu: has joined #RubyOnRails
[22:59:56] johnflux: has joined #RubyOnRails
[23:02:01] bronson: has joined #RubyOnRails
[23:03:48] chipotle: has joined #RubyOnRails
[23:04:36] Mattx: has joined #RubyOnRails
[23:04:44] Mattx: fox_mulder_cp, ping
[23:07:50] Mattx: has left #RubyOnRails: ()
[23:07:54] Mattx: has joined #RubyOnRails
[23:08:20] dalbusch1t: has joined #RubyOnRails
[23:08:36] _Tariq: has joined #RubyOnRails
[23:13:46] pawnbox: has joined #RubyOnRails
[23:16:33] _Tariq: has joined #RubyOnRails
[23:16:35] sudoubuntu: has joined #RubyOnRails
[23:20:04] akshat_: has joined #RubyOnRails
[23:21:35] Guest31: has joined #RubyOnRails
[23:22:11] htmldrum: has joined #RubyOnRails
[23:22:11] htmldrum_: has joined #RubyOnRails
[23:22:38] jhn: has joined #RubyOnRails
[23:22:52] greengriminal: has joined #RubyOnRails
[23:24:03] ur5us: has joined #RubyOnRails
[23:26:21] sypheren: has joined #RubyOnRails
[23:27:12] diegoaguilar: has joined #RubyOnRails
[23:28:26] ur5us: has joined #RubyOnRails
[23:30:03] delgiudi_: has joined #RubyOnRails
[23:30:47] _Tariq: has joined #RubyOnRails
[23:31:21] one_zero: has joined #RubyOnRails
[23:33:42] sudoubuntu: has joined #RubyOnRails
[23:38:22] diegoaguilar: has joined #RubyOnRails
[23:45:29] _Tariq: has joined #RubyOnRails
[23:59:24] greengriminal: has joined #RubyOnRails