|
Devise has a configuration called :token_authenticatable that will let your users log in via API key.
|
# ? Jul 6, 2012 05:51 |
|
|
# ? Jun 5, 2024 03:29 |
|
What an acceptable amount of time for it to take to render a view in response to a request? Is 70ms too long in a development environment? As I haven't pushed anything to production, I cannot tell how careful I should be about performance and optimization in the initial development stage. (writing my first major application)
|
# ? Jul 6, 2012 07:20 |
Jam2 posted:What an acceptable amount of time for it to take to render a view in response to a request? Is 70ms too long in a development environment? As I haven't pushed anything to production, I cannot tell how careful I should be about performance and optimization in the initial development stage. (writing my first major application) Don't get into premature optimization. Once you deploy on production mode it'll be much faster anyway (because Rails won't have to knock down and reload your classes with every request).
|
|
# ? Jul 6, 2012 13:39 |
|
What's the best way to make this readable and within 80 chars per line?code:
|
# ? Jul 17, 2012 05:56 |
Jam2 posted:What's the best way to make this readable and within 80 chars per line? code:
|
|
# ? Jul 17, 2012 14:05 |
|
Note that in 1.8 you would have to put the dots at the end of the lines rather than the beginning. Can you do it like this? This is how I like to do it in Javascript but I don't know if it's valid Ruby. code:
|
# ? Jul 17, 2012 14:41 |
prom candy posted:Note that in 1.8 you would have to put the dots at the end of the lines rather than the beginning. Pretty sure it's valid.
|
|
# ? Jul 17, 2012 14:46 |
|
Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking. On a rails specific note, how can I check now or ensure that when I deploy, it gets marked as "test"? I have a feeling one of my builds isn't using the right settings.
|
# ? Jul 17, 2012 15:45 |
|
Jam2 posted:What's the best way to make this readable and within 80 chars per line? code:
|
# ? Jul 17, 2012 16:02 |
|
Thanks, guys. I like that style. I'm going to change it a bit to appease the skeptic in me that thinks Ruby might misinterpret the new line. Putting the periods on the same line seems a bit more sane.code:
|
# ? Jul 17, 2012 17:49 |
|
Bonzo is right that at a certain point you should be moving those types of calls to the model.
|
# ? Jul 17, 2012 17:56 |
|
prom candy posted:Bonzo is right that at a certain point you should be moving those types of calls to the model. Always move those types of calls into the model
|
# ? Jul 17, 2012 18:12 |
|
Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time.
|
# ? Jul 17, 2012 18:48 |
|
prom candy posted:Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time. If your models are "morbidly obese" they probably do too much, either simulating some kind of entity that the model doesn't directly represent (in which case you should create a new model that doesn't inherit from anything to encapsulate that behavior), or some extra behavior (that can be refactored into a Concern). Ruby code:
Ruby code:
|
# ? Jul 17, 2012 19:18 |
|
prom candy posted:Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time. IMO, the rules for moving controller code into a model method are about the same as moving model code into its own method: - do you need to use the same code in multiple places? - are you indenting too deep? A moderately complex query is fine in the controller. But if you have to abstract it out for reuse/simplicity, the model is the place to do it.
|
# ? Jul 17, 2012 19:21 |
|
hepatizon posted:A moderately complex query is fine in the controller. But if you have to abstract it out for reuse/simplicity, the model is the place to do it. There may even be a better way to split it up. Complex queries are probably going to have two parts: business object manipulation (I want the posts joined with their user) and formatting for display (I want page 6 and posts sorted by rating). Using ActiveRecord you can break that up. Ruby code:
|
# ? Jul 17, 2012 19:33 |
|
BonzoESC posted:(that can be refactored into a Concern). Thanks for getting me reading about ActiveSupport::Concern -- I'm not even using ActiveRecord, but my modules are much cleaner now. I've always disliked the ClassMethods idiom, and recently I realized that pure Ruby is not equipped for handling "super" calls from modules that include other modules. Concern takes care of it all. Awesome.
|
# ? Jul 17, 2012 19:49 |
|
Nybble posted:Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking. Are these things that should be caught within your test suite/CI server?
|
# ? Jul 17, 2012 19:53 |
|
Nybble posted:Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking. Work in your own branch, and pick and choose what you merge. Nybble posted:On a rails specific note, how can I check now or ensure that when I deploy, it gets marked as "test"? I have a feeling one of my builds isn't using the right settings.
|
# ? Jul 17, 2012 20:10 |
|
Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely.
|
# ? Jul 19, 2012 20:46 |
|
atastypie posted:Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely. Thanks all the credit goes to one of my coworkers. Also super cool is postgresapp comes with postgis and plv8 so you can play with those without having to compile them yourself. Pardot fucked around with this message at 22:20 on Dec 8, 2013 |
# ? Jul 19, 2012 20:59 |
|
I found installing postgres with homebrew to be a breeze. Does anyone know if there's a way to get Heroku to skip asset compilation if you haven't actually changed any assets? Or does it not matter because each push spins up a fresh dyno with no memory of past dynos?
|
# ? Jul 19, 2012 21:38 |
|
prom candy posted:I found installing postgres with homebrew to be a breeze. Each push is going to create a new slug with no memory of past slugs. Edit: if you want it to go faster, push your assets to S3 and CloudFront, and disable asset compilation.
|
# ? Jul 19, 2012 23:23 |
|
atastypie posted:Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely. gently caress that. i've wasted my afternoon trying to get my tools up and running again after breaking my perfectly-good postgres install trying to get this working. Now, when I rails s, I get: code:
code:
|
# ? Jul 20, 2012 04:41 |
|
Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available.
|
# ? Jul 20, 2012 05:32 |
|
prom candy posted:Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available. By googling "libpq" I noticed one of the first results dealt with an issue with the default installation options of Homebrew. So, I think a "which psql" might be useful.
|
# ? Jul 20, 2012 05:50 |
|
prom candy posted:Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available. gems folder? Do you mean delete gemfile.lock? I've never heard of the gems folder. Where can I find it? When I installed postgres a few weeks back, I exhausted macports and brew in attempts to get it going. I don't remember which finally succeeded. Here's what's installed via port: code:
code:
here's what happens when I try to gem install pg: code:
|
# ? Jul 20, 2012 05:56 |
|
If the pg gem was previously compiled against a different libpq, you're going to have to get rid of it and re build with the one you're using. If it's trying to get at one in /opt/... that's not postgres.app edit: http://postgresapp.com/documentation#toc_15 For best results, you should remove any existing installation of PostgreSQL. Here's a run-down of the most common ways you may have installed it previously: http://postgresapp.com/documentation#toc_20 Binaries: /Applications/Postgres.app/Contents/MacOS/bin Headers: /Applications/Postgres.app/Contents/MacOS/include Libraries: /Applications/Postgres.app/Contents/MacOS/lib Shared Libraries: /Applications/Postgres.app/Contents/MacOS/share Data: ~/Library/Containers/com.heroku.Postgres/Data/Library/Application\ Support/Postgres/var Pardot fucked around with this message at 06:00 on Jul 20, 2012 |
# ? Jul 20, 2012 05:57 |
|
Trabisnikof posted:By googling "libpq" I noticed one of the first results dealt with an issue with the default installation options of Homebrew. So, I think a "which psql" might be useful. /usr/bin/psql
|
# ? Jul 20, 2012 06:07 |
|
Pardot posted:If the pg gem was previously compiled against a different libpq, you're going to have to get rid of it and re build with the one you're using. If it's trying to get at one in /opt/... that's not postgres.app code:
code:
code:
|
# ? Jul 20, 2012 06:18 |
|
What is the output of `pg_config` ? and then see if it's better with `PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config`
|
# ? Jul 20, 2012 06:24 |
|
Pardot posted:What is the output of `pg_config` ? and then see if it's better with `PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config` code:
|
# ? Jul 20, 2012 06:25 |
|
Do I enter this into .profile exactly as shown?code:
|
# ? Jul 20, 2012 06:30 |
|
Jam2 posted:Do I enter this into .profile exactly as shown? pg_config just shows you what is going on, it doesn't change anything. If your env was set up to use postgres.app it'd look something like this code:
|
# ? Jul 20, 2012 06:41 |
|
Jam2 posted:gems folder? Do you mean delete gemfile.lock? I've never heard of the gems folder. Where can I find it? I'm going to let pardot keep helping you as he has a lot more experience in this than I do, but I was referring to the folder where bundler installs your gems. Generally it's a good idea to keep your gems installed in your project folder( Vendor Everything Still Applies) but if you're using gemsets you might just need to gem uninstall pg. That's after doing the things that pardot is recommending as it seems like you may have postgres installed in a few different places. It's a road we've all been down.
|
# ? Jul 20, 2012 06:51 |
|
Since there isn't a general ruby thread I thought I would just post this here. I am going the full Uncle Bob and trying to make a memory based instance handling system inspired by his lost years of architecture talk. I have an early version, which still needs a few features to be truly useful, but it is good enough that I was able to hook it into a simple sinatra app with user registration and login and user registration and login works. Anyway, I was looking to see if anyone wanted to get in on this or call me an idiot or both. https://github.com/kwstannard/the_blob Also, I am looking for a better name than the_blob.
|
# ? Jul 22, 2012 02:41 |
|
What's the use case for this? Or is it a learning project?
|
# ? Jul 22, 2012 06:36 |
|
wolfman101 posted:memory based instance handling system Is this an established concept that I can learn about without watching a 66-minute video?
|
# ? Jul 22, 2012 06:46 |
|
hepatizon posted:Is this an established concept that I can learn about without watching a 66-minute video? That video is really worth watching, it's not centered around memory based instance handling systems at all. It's about the separation of concerns and program architecture and it's really, really interesting.
|
# ? Jul 22, 2012 06:47 |
|
|
# ? Jun 5, 2024 03:29 |
|
prom candy posted:What's the use case for this? Or is it a learning project? This started out as a learning project to try making an app that would eventually need a database, but to push that decision back until the last possible minute and thereby create a consistent framework that you can build an app on top of and plug in any sort of persistance you want without having to change anything in the app itself. As of right now I think the memory based persistance system, i.e. caching, is fully functional, and I think the next thing in line is a Sequel interface.
|
# ? Jul 24, 2012 15:16 |