Activity
It looks like when the error gets thrown, they give you a random secret key that you should copy paste into an initializer then restart your app and you should be good.
I believe the secret_key
is a new security feature added recently and you probably just need to follow it's instructions. https://github.com/refile/refile#retrieving-files
This wasn't something that existed when I recorded those videos originally.
Posted in I'm lost and can't find the way out
Check this out and see if it helps!
If you've got a field on the User model called minecraft_uuid, when you query for a user, you can pass that attribute into the API.
@user = User.first # query for a single user
profile = MojangApi.get_profile_from_name(@user.username) # this should return the profile
You can then take the profile attributes and save them to the User or something. If you only want this to happen one time, you can make it a before_create
on the User model.
class User < ActiveRecord::Base
validates :username, presence: true
before_create :load_profile
def load_profile
profile = MojangApi.get_profile_from_name(username) # Only use username here because we are inside a User
assign_attributes(uuid: profile.uuid, other_attribute: profile.other_attribute) # Save those attributes to the user
end
end
You can validate no spaces using the format validator. Some examples here: http://stackoverflow.com/questions/18281198/rails-validate-no-white-space-in-user-name
Posted in File Uploads with Refile Discussion
It's on aws-sdk 2 now. https://github.com/refile/r...
Nope, this is mainly just to emulate production on your development machine.
Not really. You'll need to setup load balancers, etc to do that.
Posted in Must Read / Must Watch
Really enjoyed this post for working with software development teams. http://www.defmacro.org/2014/10/03/engman.html
Posted in Exporting Records To CSV Discussion
Since that's not an attribute, you can just swap this out:
csv << attributes.map{ |attr| user.send(attr) }
With something like this:
csv << [user.name, user.email, user.coupon.code]
That way you can just reference any attributes or methods you want when exporting and they don't have to be database attributes.
Posted in Idea for TimeClock Need Advice
I don't think this needs refactoring. It's straightforward and unless it gets more confusing, you won't get any benefit out of changing it. The only suggestion I'd make is to use an else, because you don't need two separate if statements.
<% if @clock_event.clock_in? %>
<%= link_to "Clock Out", clock_out_employees_path(@clock_event), :method => :put %>
<%= else %>
<%= link_to "Clock In", clock_in_employees_path(@clock_event), :method => :put %>
<% end %>
You could move this logic into a helper, but that's up to you. That will only just obscure what's going on a bit and not give you any more clarity when reading this again 3 months from now.
Posted in File Uploads with Refile Discussion
That's a great question. I think Refile might not be ideal, but you can always ask the author on the Github issue tracker.
Another useful resource is: http://bclennox.com/extreme...
Posted in Coffeescript Polling Issues
Ah yep, I overlooked the method call and thought you were just passing the reference. That'd do it!
Good debugging!
Posted in Coffeescript Polling Issues
loadWhenCached: ->
This might actually need to be a thick arrow so you can pass in @interval in the next callback too.
Posted in Coffeescript Polling Issues
You are calling loadWhenCached from inside loadWhenCached which is a recursive call. That's probably fine, but but you're not updating the footprintsCached value so it will always be false and it will always run again. Your success method needs to update the preview's footprintsCached attribute so that it can know not to do it again.
I'm curious why you need a loop at all? Issuing the first AJAX request should take care of it unless you have a reason that it's likely to fail. And if that's the case, you should consider pulling the loop out to a higher level rather than inside the method. That will help you manage it better so rather than making a recursive loop, you could do a setInterval
that calls the method every couple seconds and then kills the interval once it has been successful.
Yeah that should do it. You can sometimes use the apt packages for those or if you want to customize the install (like get the latest version) then cookbooks usually make the most sense.
Bower is pretty great and I plan on doing an episode on integration with that in the future. This episode was designed mostly for explaining if you're using something obscure that has no gems or packages at all for it (including Bower packages).
Yeah I'll be doing a screencast for that in the future!
Posted in Setup MacOS 10.10 Yosemite Discussion
Awesome! Once you do it a few times you start to realize what does what and it all starts to make a lot more sense. So don't feel bad having issues so far. :)
Posted in Setup MacOS 10.10 Yosemite Discussion
Sorry, been traveling and missed it I think.
Anytime you get an error that says "Errno::EACCES: Permission denied" usually means that you might have accidentally used "sudo" on one of the commands before. When you use sudo, the files become owned by the root user and that causes problems with the setup.
You can run this command to see what user owns the files and we can see if that's actually the problem:
ls -ls ~/.rbenv | tail -n +2 | tr -s ' ' | cut -d ' ' -f 5
Mine prints out "chris" a bunch of times which is my username.
Posted in Setup MacOS 10.10 Yosemite Discussion
Yes, but just press Enter to use the default location.
Awesome!! Congrats on the release! :) I prefer underscores because dashes sometimes get parsed as modules.