Activity Graph

Page 1 of 2 | Next »


[16:13:36] markalanevans: has joined #RubyOnRails


[20:17:35] markalanevans: has joined #RubyOnRails
[21:19:00] markalanevans: Quit: markalanevans
[21:20:30] markalanevans: has joined #RubyOnRails
[22:06:21] markalanevans: has joined #RubyOnRails
[22:46:03] markalanevans: Quit: markalanevans
[23:07:38] markalanevans: has joined #RubyOnRails
[23:43:16] markalanevans: Quit: markalanevans


[00:16:03] markalanevans: has joined #RubyOnRails
[00:25:42] markalanevans: Quit: markalanevans


[00:13:29] markalanevans: has joined #RubyOnRails
[00:43:33] markalanevans: Quit: markalanevans
[15:20:06] markalanevans: has joined #RubyOnRails


[17:20:36] markalanevans: has joined #RubyOnRails
[22:45:10] markalanevans: Quit: markalanevans


[07:12:34] markalanevans: has joined #RubyOnRails
[07:29:27] markalanevans: Quit: markalanevans
[07:30:29] markalanevans: has joined #RubyOnRails
[07:53:04] markalanevans: Quit: markalanevans


[06:40:23] markalanevans: has joined #RubyOnRails
[06:40:47] markalanevans: Hey folks, just create a new rails app.
[06:40:54] markalanevans: Installed mysql and setup the database config
[06:41:05] markalanevans: running bundle exec rake db:migrate i get a bizzare error
[06:41:13] markalanevans: wrong number of arguments (1 for 0)
[06:41:34] markalanevans: wrong number of arguments (1 for 0)/var/www/myqpp/html/db/migrate/20151102060737_create_triggers.rb:4:in `block in change'
[06:42:10] markalanevans: sevenseacat:
[06:42:17] markalanevans: I used the rails g migration to create it
[06:43:03] markalanevans: let me redo that.
[06:44:48] markalanevans: sevenseacat: tnx
[06:51:49] markalanevans: Quit: markalanevans


[18:05:58] markalanevans: has joined #RubyOnRails
[21:17:15] markalanevans: Quit: markalanevans


[05:25:29] markalanevans: has joined #RubyOnRails
[15:27:39] markalanevans: Quit: markalanevans
[16:16:31] markalanevans: has joined #RubyOnRails
[16:24:22] markalanevans: Ping timeout: 252 seconds


[19:08:35] markalanevans: has joined #RubyOnRails


[01:40:30] markalanevans: Quit: markalanevans


[01:18:10] markalanevans: Quit: markalanevans
[21:23:53] markalanevans: has joined #RubyOnRails
[21:24:16] markalanevans: If have a model bids
[21:24:27] markalanevans: which has platform_id and advertiser_id in it
[21:24:41] markalanevans: and then i have a table advertiser_platforms
[21:24:59] markalanevans: which has platform_id and advertiser_id also.
[21:25:15] markalanevans: i???d like to define a relationship on bids
[21:25:32] markalanevans: so i could get the advertiser_platform
[21:25:49] markalanevans: based on a join of the platform_id and advertiserid in the bids table.
[21:26:01] markalanevans: so i could do bids.advertiser_platform()
[21:26:30] markalanevans: i could do it with a few joins, but is there some magic way to set that up on Active record?
[21:31:41] markalanevans: what is it called that i???m looking for?
[21:32:58] markalanevans: so with a scope i can join 2 tables together on defined keys?
[21:33:19] markalanevans: umgrosscol: its associations on 2 fields
[21:34:37] markalanevans: basically its a select * from bids join advertiser_platforms on (advertiser_platforms.platform_id = bids.platform_id and advertiser_platforms.advertiser_id = bids.advertiser_id) where bids.advertiser_id = 3 and bids.platform_id = 23;
[21:34:39] markalanevans: Somethign like that
[21:37:37] markalanevans: there are 3 tables
[21:37:40] markalanevans: ill create a pastie
[21:44:17] markalanevans: weaksauce: just in case:
[21:45:12] markalanevans: weaksauce: in my case given an bid, there is no need to pass in params
[21:45:33] markalanevans: it should just say find me the corresponding advertiser_platform with the same advertiser_id and platform_id
[21:47:37] markalanevans: i???ll try your example and modify it just at ad
[21:51:19] markalanevans: weaksauce: testing that now
[21:58:00] markalanevans: weaksauce: the scope method is unknown
[21:58:13] markalanevans: in this case the method advertiser_platform
[21:58:19] markalanevans: give a model bid
[21:58:28] markalanevans: bid.advertiser_platform() return unkown method error
[21:59:13] markalanevans: weaksauce: the model
[21:59:26] markalanevans: i had give you simpler names of models
[22:11:43] markalanevans: weaksauce: so i ended up doing it sort of like that
[22:12:05] markalanevans: def advertiser_platform AdvertiserRetargetingPlatform.by_advertiser_and_platform(self.advertiser_id, self.retargeting_platform_id) end
[22:12:20] markalanevans: I added that method to my audience_bids model.
[22:12:36] markalanevans: and added :
[22:12:48] markalanevans: to my advertiser_retargeing_platforms model
[22:13:04] markalanevans: now i can just do bid.advertiser_platform()
[22:13:06] markalanevans: and it works great


[18:13:47] markalanevans: has joined #RubyOnRails
[18:14:08] markalanevans: has joined #ruby
[18:15:17] markalanevans: Hey folks, what do you call these :
[18:16:06] markalanevans: i want to understand how blocks like that are initalized
[18:16:15] markalanevans: is it a conditional block ?
[18:16:22] markalanevans: for ex: environment :test do ???. end
[18:18:07] markalanevans: so just for clarificaiton
[18:18:16] markalanevans: there is a function somehwere defined as environment
[18:18:25] markalanevans: and it it there is some sort of test
[18:18:28] markalanevans: to see if :test
[18:18:32] markalanevans: or if :production
[18:19:42] markalanevans: how is the block aware of the :test or :production
[18:22:01] markalanevans: so in the block, i just compare args == some_function_that_returns_actual_env()
[18:22:15] markalanevans: and then if true it executes
[18:23:09] markalanevans: So i have a ruby file that just have the block statements
[18:23:51] markalanevans: Does that meant that there is some global function environment
[18:27:30] markalanevans: thanks nofxx & miah


[04:02:10] markalanevans: has joined #RubyOnRails
[04:02:31] markalanevans: has joined #ruby
[08:48:41] markalanevans: Quit: markalanevans


[20:28:25] markalanevans: Quit: markalanevans


[03:22:26] markalanevans: Quit: markalanevans
[03:23:57] markalanevans: has joined #RubyOnRails
[05:19:21] markalanevans: Quit: markalanevans
[17:41:17] markalanevans: has joined #RubyOnRails


[00:28:36] markalanevans: has joined #RubyOnRails


[19:34:52] markalanevans: Quit: markalanevans


[02:00:18] markalanevans: Quit: markalanevans
[02:00:50] markalanevans: has joined #RubyOnRails
[04:16:01] markalanevans: Quit: markalanevans
[04:19:21] markalanevans: has joined #RubyOnRails
[04:38:09] markalanevans: Quit: markalanevans
[04:40:04] markalanevans: has joined #RubyOnRails
[05:15:47] markalanevans: Quit: markalanevans
[19:57:54] markalanevans: has joined #RubyOnRails
[19:59:02] markalanevans: When in production mode, even if my environments/production.rb :: config.log_level = :debug
[19:59:27] markalanevans: the production.log file doesn???t spit out all the errors
[19:59:48] markalanevans: but if i change my apache RailsEnv=production the logs have the errors
[20:00:14] markalanevans: Is there some other setting to ensure that all errors are written to the logs when on production?
[20:03:52] markalanevans: tubbo: In my situation, i???m saying that I have RailsEnv=production in my vhost file. And i also have environments/production.rb :: config.log_level = :debug
[20:04:08] markalanevans: So i would expect all errors to be written to the production log file
[20:04:31] markalanevans: But nothing is written out to it. In particular when there are app errors.
[20:04:45] markalanevans: However, if i change RailsEnv=development
[20:04:51] markalanevans: i see all the errors i???m looking for in the logs.
[20:05:04] markalanevans: tubbo: yes. touch tmp/restart
[20:05:28] markalanevans: i just left that off
[20:05:43] markalanevans: What else needs to be done to get full errors in my logs?
[20:06:33] markalanevans: simplyianm: you should consider having a few classes to do what you are talking about.
[20:06:49] markalanevans: For example a class to handle payments in general.
[20:07:07] markalanevans: and then a class that its specific for purchasing items.
[20:07:45] markalanevans: simplyianm: what do these thigns need to do?
[20:15:05] markalanevans: simplyianm: are you familiar with singe responsibility ?
[20:16:12] markalanevans: simplyianm: read these:
[20:16:45] markalanevans: simplyianm: then read this:


[23:10:14] markalanevans: has joined #RubyOnRails


[22:51:57] markalanevans: Hey folks, i'm trying to use Goliath & RackAttack together w/ Redis.
[22:52:29] markalanevans: I can't seem to figure out how to share the redis object / connection from the goliath server to the RackAttack middleware
[22:53:17] markalanevans: Might some point me in the right direction on how to share a 'redis' connection between Goliath & RackAttack?
[22:56:59] markalanevans: nickjj: hi concurrecy API
[23:08:56] markalanevans:
[23:09:35] markalanevans: I haven't played w/ it to much


[17:39:51] markalanevans: Hey guys, question about managing environment variables. I know there are multiple gems (Figaro, .dotenv, etc) that help manage variables. But typically it's recommend to ignore them in your git repo.
[17:40:18] markalanevans: So what is the recommend place and way to store the production or other environment level variables.
[17:40:38] markalanevans: Where do they get stored and how do they get "deployed"
[17:43:01] markalanevans: pipework: so where do you store the producution files?
[17:43:26] markalanevans: do you have some other repo that has configs?
[17:43:55] markalanevans: Which your deployment process has access to , pulls down and then copies to /etc/defualt/app ?
[17:45:34] markalanevans: pipework: so if you need a new env variable for your app. Where do you go to add it so that puppet knows about it?
[17:46:05] markalanevans: is it just some config file on your deployment server?
[17:46:32] markalanevans: pipework: so i'm talking about api secrets, db username pw etc
[17:46:44] markalanevans: pipework: so what are you refereing to when you mean genrated on disk
[17:47:28] markalanevans: pipework: I mean like third party api secrets
[17:47:32] markalanevans: i can't "generate" those
[17:47:38] markalanevans: they are provided to me and i need to store them
[17:47:54] markalanevans: same for database credentails,
[17:48:35] markalanevans: pipework: I want to read more about this process, but i'm not sure what to google for
[17:48:48] markalanevans: all i end up finding are docs for tools to use env variables
[17:48:54] markalanevans: but not how ot manage and deploy them
[17:51:05] markalanevans: pipework: ok. So usually these deployment processes have a method for dealing with this
[17:54:27] markalanevans: thanks pipework


[06:51:33] markalanevans: I just got devise working and i have a SessionsController
[06:52:09] markalanevans: I wanted to add a route that i could use to get some account types associated to a user
[06:52:18] markalanevans: Figured it could go in the Sessions controller
[06:52:52] markalanevans: But i'm not quite sure if there is anything special that needs to be done in the routes file to make it acceptable.
[06:53:09] markalanevans: sevenseacat: well its related to the user
[06:53:32] markalanevans: Seems that my /users route is directed to the Sessions controller
[06:55:24] markalanevans: sevenseacat: devise_for :users, controllers: { sessions: 'sessions', registrations: 'registrations', passwords: 'passwords', confirmations: 'confirmations' }, defaults: { format: :json }
[06:55:35] markalanevans: So if I have a route /users
[06:55:57] markalanevans: how does that conflict w/ what would be handled my my UsersController
[06:58:09] markalanevans: Perhaps i need to understand exactly what this bit does "devise_for :users,"
[06:59:39] markalanevans: Oooh. that is handy


[06:24:44] markalanevans: Hey folks. on 4.1 here. Trying to learn about how to load modules/class from my libs folder
[06:24:51] markalanevans: for use in both my app and rake files
[06:25:08] markalanevans: I did this in the applicaiton.rb file: config.autoload_paths += Dir["#{config.root}/lib/**/*.rb"]
[06:25:45] markalanevans: And i have /libs/pretargets/service/Pretarget.rb
[06:26:29] markalanevans: I was reading about "modularizing" your app and how its a good idea to start organizing logic by "features"
[06:26:56] markalanevans: But when i'm in my rake task and i have the above config in the application.rb file
[06:28:25] markalanevans: thomasfedb: does anything else about file names or folder structure matter?
[06:31:33] markalanevans: rvanlieshout: One sec i'm gonna show you how i'm laying it out
[06:34:32] markalanevans: rvanlieshout: so this is the file structure: /lib/pretarget/service/pretarget.rb
[06:35:33] markalanevans: rvanlieshout: and this is the file:
[06:35:47] markalanevans: I added this: config.autoload_paths += Dir["#{config.root}/lib/**/*.rb"]
[06:35:52] markalanevans: in my applicaiton.rb file
[06:37:18] markalanevans: I'm fine w/ that
[06:37:24] markalanevans: but does the "Module" namespacing matter?
[06:44:25] markalanevans: thomasfedb: so i fixed the file names and the class names
[06:44:32] markalanevans: And now running the rake tasks moves forward
[06:44:41] markalanevans: I am seeing this: Pretarget is not a module
[06:44:51] markalanevans: This is the first time i've used the namespace.
[06:45:09] markalanevans: well the module Pretarget
[06:45:39] markalanevans: TypeError: Pretarget is not a module
[06:46:45] markalanevans: thomasfedb:
[06:49:09] markalanevans: thomasfedb: .rake file
[06:49:56] markalanevans: thomasfedb: product.rb
[06:54:11] markalanevans: May someone else did.
[06:54:45] markalanevans: Bahhhh. Its a model name.
[06:54:53] markalanevans: Guess that is going to cause a problem.
[06:55:13] markalanevans: thomasfedb: do you normally namespace your models?
[06:55:39] markalanevans: i'm struggilng w/ naming "feautres" is there like a good rule of thumb?
[06:56:10] markalanevans: like adding -ing to the end of a "module"
[06:57:04] markalanevans: convert URL's to products. Then get some data about some AD's related to the product.
[06:57:45] markalanevans: perhaps it s "functionality"
[06:58:33] markalanevans: Then where do you put "nothing" haha
[06:59:44] markalanevans: Well i need a place to organize some logic.
[07:00:17] markalanevans: I need a class that can take in a url and thendo some work on it and give me back and array of some products.
[07:00:50] markalanevans: no. who puts business logic in a controller?
[07:01:04] markalanevans: That stuff should go in service class somewhere so it can be used all over the app....
[07:01:27] markalanevans: basically if put a string in a function i need get back an array of products from the DB and a few other sources
[07:01:46] markalanevans: before hand i had lots of helper. rb files
[07:01:53] markalanevans: and a Sinatra app
[07:02:07] markalanevans: but i'm getting "hip" and trying to use Rails & improve my organization skills
[07:02:49] markalanevans: thomasfedb: well the string isn't to important for this conv, its an identifier that i can use to find products throughout my system and other 3rd party systems.
[07:03:03] markalanevans: I read a few posts about organizing rails apps.
[07:03:17] markalanevans: And i just read through Sandi Metz book
[07:03:25] markalanevans: and there should litteraly be nothing in your controllers
[07:03:54] markalanevans: thomasfedb: not rails, many other apps and they usually have a nice way that they want you to organize the app
[07:04:28] markalanevans: So i was hoping i could create "service" classes that organizg my business logic.
[07:05:15] markalanevans: Well service classes are just classes that group your business logic.
[07:08:48] markalanevans: FYI: Alot of my thinking revolves around things like this:
[07:09:20] markalanevans: :
[07:11:23] markalanevans: thomasfedb: thanks very much for your help.


[20:51:07] markalanevans: tnd ari-_-e that worked perfectly!