neha-

Activity Graph

Page 1 of 1

2016-06-29

[02:48:38] neha-: Quit: Textual IRC Client: http://www.textualapp.com/

2016-06-28

[19:57:26] neha-: Quit: Textual IRC Client: http://www.textualapp.com/
[20:24:54] neha-: has joined #ruby
[20:24:54] neha-: has joined #RubyOnRails

2016-06-27

[18:46:58] neha-: has joined #RubyOnRails
[18:46:59] neha-: has joined #ruby
[20:55:22] neha-: Ping timeout: 244 seconds
[21:11:43] neha-: has joined #ruby
[21:11:43] neha-: has joined #RubyOnRails
[21:41:04] neha-: Ping timeout: 240 seconds
[21:47:21] neha-: has joined #ruby
[21:47:21] neha-: has joined #RubyOnRails

2016-06-21

[12:13:52] neha-: has joined #ruby
[12:13:52] neha-: has joined #RubyOnRails
[12:49:51] neha-: Ping timeout: 276 seconds

2016-06-16

[01:03:35] neha-: Quit: Textual IRC Client: www.textualapp.com
[18:52:45] neha-: has joined #ruby
[18:52:45] neha-: has joined #RubyOnRails
[20:23:34] neha-: it needs a javascript runtime
[20:23:47] neha-: some gems need javascript
[22:13:44] neha-: Quit: My Mac has gone to sleep. ZZZzzz…

2016-06-15

[19:22:25] neha-: has joined #ruby
[19:22:25] neha-: has joined #RubyOnRails
[19:54:21] neha-: hey, how do i serialize an enum to the int value in as_json
[19:54:40] neha-: right now it prints they key instead of the value / int
[20:02:19] neha-: hey how do i get as_json to print the value of an enum instead of the key
[20:04:05] neha-: so i have a class (activerecord model) with an enum type, however on as_json, it serializes out the key name instead of the value (what is stored in the db)
[20:04:34] neha-: my enum is enum duration: {no: 0, day:1, week:7 }
[20:04:55] neha-: but on as_json for this obj i get "duration": "day"
[20:05:07] neha-: but i would like "duration": 1
[20:08:34] neha-: did that make sense norc
[20:11:58] neha-: what are the options for as_json ?
[20:12:51] neha-: no just to the room
[20:16:47] neha-: ya maybe it's just rails
[20:16:54] neha-: sorry no one was answering in the rails room
[20:23:50] neha-: yeah i'm looking into jbuilder
[20:23:54] neha-: thanks tho
[20:25:37] neha-: how do i override as_json to like replace an existing key though
[20:28:44] neha-: this is so gross
[20:28:49] neha-: maybe i should just use an int
[21:59:18] neha-: Read error: Connection reset by peer
[23:43:21] neha-: has joined #ruby
[23:43:21] neha-: has joined #RubyOnRails
[23:44:18] neha-: Client Quit
[23:44:38] neha-: has joined #ruby
[23:44:38] neha-: has joined #RubyOnRails

2016-06-13

[01:04:59] neha-: Quit: My Mac has gone to sleep. ZZZzzz…
[13:06:47] neha-: has joined #ruby
[13:06:47] neha-: has joined #RubyOnRails
[13:58:50] neha-: hey, what's the difference between Dir.glob() and and Dir[]
[13:58:58] neha-: are they equivalent?
[15:20:14] neha-: Quit: My Mac has gone to sleep. ZZZzzz…
[17:11:10] neha-: has joined #ruby
[17:11:10] neha-: has joined #RubyOnRails
[17:39:26] neha-: romistrub: you should ask in #rubyonrails
[19:18:43] neha-: Quit: My Mac has gone to sleep. ZZZzzz…
[19:23:36] neha-: has joined #ruby
[19:23:36] neha-: has joined #RubyOnRails
[19:47:42] neha-: Quit: Textual IRC Client: www.textualapp.com

2016-06-12

[23:29:46] neha-: has joined #RubyOnRails
[23:29:50] neha-: has joined #ruby
[23:30:12] neha-: hey, how can i get the whole text piped into ruby instead of just line by line when doing ruby -e
[23:30:17] neha-: aka instead of doing ruby -pe
[23:33:46] neha-: whats $_ an alias for?
[23:34:31] neha-: ah okay, thanks
[23:35:12] neha-: for the sake of speed in writing one liners
[23:35:27] neha-: thank you
[23:36:21] neha-: is there a shortcut for read too lol
[23:36:39] neha-: $<.read isn't too bad though
[23:40:33] neha-: what does $1 do?
[23:41:09] neha-: oh like bash?

2016-06-11

[20:19:47] neha-: has joined #RubyOnRails
[20:20:07] neha-: is it possible to have activejob run synchronously for my seeds.rb?
[20:37:54] neha-: Quit: My Mac has gone to sleep. ZZZzzz…
[21:48:55] neha-: has joined #RubyOnRails
[21:58:05] neha-: Quit: Textual IRC Client: www.textualapp.com

2016-05-30

[17:58:07] neha-: Quit: Textual IRC Client: http://www.textualapp.com/

2016-05-29

[22:34:46] neha-: ya 2 space good space
[22:34:50] neha-: 2 space good 4 space bad
[22:40:50] neha-: whats 4.5 lol
[22:42:38] neha-: i'm going to start using that lol
[22:42:59] neha-: 2 spaces is in the interpreter? :o

2016-05-27

[17:05:44] neha-: hey, so i'm using a gem, and certain functions are defined in a Module. Now i want to just require one other file and extend that default module namespace (without having to do require file and then include SomeModule::Helper for example) how can i do this?
[17:11:30] neha-: well in my monkey-patched module (if thats the right term), i'm using the same namespace as what shoudl be already available in my file. IN this specific case, FactoryGirl::Syntax::Methods is already available. So i just want to add another method to this namespace by just requiring one support file
[17:12:58] neha-: yeah, but then if i just include that file (support/helpers/factory_girl.rb), i can't access the new helper methods
[17:14:12] neha-: sorry i meant "require the file"
[17:19:24] neha-: thanks shevy
[22:15:22] neha-: how do i recreate my database from migrations only?

2016-05-26

[16:10:33] neha-: hey for general style, is it better to use self.save! or just save!
[16:10:50] neha-: similarly is it better to use self.some_association or just some_association
[16:10:54] neha-: in a Model class for example
[16:11:34] neha-: oh really?
[16:16:33] neha-: cool, thanks :)

2016-05-25

[17:19:15] neha-: hey what method is hit when i make a write to a model? this is for testing, i want to make sure a call does not hit the database/write
[17:19:40] neha-: would it be :save
[17:22:16] neha-: i actually want to make sure the model object isn't being written to
[17:22:28] neha-: regardless of if it's saved (assuming it will be saved at some point)
[17:23:40] neha-: it doesn't have to do both, i just want to know this method is not being called
[17:24:19] neha-: i have a getter that does lazy loading i suppose. so in a unit test i want to check that it is not writing to the database under certain conditions
[22:35:10] neha-: job looks at the created_at time and the Time.now in order to run. So how do I test this properly?
[22:35:10] neha-: hey, so i have a job that i enqueue using ActiveJob. I want to test functionality if it works (which is time dependent, it looks at Time.now). However just using travel (ActiveSupport::Testing::TimeHelpers) doesn't trigger the job to run. Normally people suggest using perform_enqueue_jobs, however that means that the jobs run automatically once created - this won't work however as my

2016-05-24

[00:15:29] neha-: has joined #RubyOnRails
[00:16:30] neha-: if i have a has_many relationship (user has_many posts), can i ensure in my schema that posts user_id is not null?
[00:16:57] neha-: is that overkill, or good practice?
[00:17:25] neha-: i mean to ensure that some weirdness doesn't happen
[00:17:34] neha-: and an orphan post isn't created with a null user_id
[00:18:04] neha-: couldn't i do change_column_null ?
[00:18:10] neha-: as a migration
[00:18:36] neha-: okay thanks Radar
[14:42:39] neha-: *.net *.split
[15:38:48] neha-: has joined #RubyOnRails
[15:39:56] neha-: hey, what's the term for when i want to store like the posts_count of a user in the user object (for caching, speed)
[15:40:09] neha-: by user object i mean the user table
[15:40:23] neha-: not in memory, but to persist that data in the db
[15:41:35] neha-: is that persisting it in the regular db smathy?
[15:42:25] neha-: counter cache looks good smathy thanks
[15:44:04] neha-: haha, i was like...wha??
[21:25:41] neha-: has joined #ruby
[21:25:53] neha-: is there a way to do a map and then a reduce in one statement?
[21:26:35] neha-: irc.manas.ca
[21:27:13] neha-: requested_total = requested_total.reduce(:+)
[21:27:13] neha-: requested_total = user_with_posts.posts.map { |p| p.requested }
[21:27:27] neha-: i'm sure there is a better way :/
[21:29:19] neha-: thanks although i don't get it
[21:29:23] neha-: i'll read up on reduce more
[21:29:47] neha-: does that work tgeeky?
[21:29:52] neha-: that is ideal
[21:30:22] neha-: oh it actually works
[21:30:49] neha-: yeah i get that, i'm not sure of the syntax of jhass' line
[21:31:38] neha-: is 0 just the initial val and then sum the running total?
[21:32:39] neha-: well they say initial value
[21:33:03] neha-: but i get what you mean
[21:34:07] neha-: yeah true
[21:34:23] neha-: yeah it makess sense
[21:34:28] neha-: and yeah it is activerecord
[21:35:33] neha-: yeah i could do that too
[21:36:03] neha-: haha how do you do that
[21:37:07] neha-: i see there are some microbenchmark frameworks :o

2016-04-26

[14:01:31] neha-: dont use apt ruby
[17:10:16] neha-: you'll never get help on irc
[17:10:30] neha-: poeple are obsessed with "What are you really trying to do"
[17:10:39] neha-: they want to know your direction in life
[17:10:48] neha-: and will recommend you not even program and become a farmer instead
[17:11:00] neha-: just saying from my experience
[17:11:43] neha-: i wish i could start a room where people actually answered questions
[17:11:45] neha-: instead of all this BS
[17:11:57] neha-: maybe one day in the future :)
[17:33:20] neha-: has left #ruby: ("Textual IRC Client: http://www.textualapp.com/")

2016-04-24

[00:34:34] neha-: he prob isnt christian

2016-04-22

[00:53:04] neha-: maybe subclass it
[01:27:03] neha-: Quit: Textual IRC Client: http://www.textualapp.com/
[02:31:10] neha-: has joined #RubyOnRails
[02:31:10] neha-: has joined #ruby
[02:33:38] neha-: Client Quit
[02:34:00] neha-: has joined #RubyOnRails
[02:34:00] neha-: has joined #ruby
[14:17:41] neha-: can anyone recommend an advanced ruby book
[14:32:41] neha-: thanks crime and Ox0dea
[22:56:41] neha-: has left #RubyOnRails: ("Textual IRC Client: http://www.textualapp.com/")

2016-04-21

[23:56:44] neha-: has joined #ruby
[23:56:58] neha-: has joined #RubyOnRails