Skip to content

Instantly share code, notes, and snippets.

@houen
houen / dsfg
Created July 11, 2011 16:38
dsfgdsfg
Loading development environment (Rails 3.0.7)
irb: warn: can't alias exit from irb_exit.
ruby-1.9.2-p180 :001 > inst = ImageUploader.new
=>
ruby-1.9.2-p180 :002 > inst.recreate_versions!
NoMethodError: undefined method `read' for nil:NilClass
from /Users/houen/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.7/lib/active_support/whiny_nil.rb:48:in `method_missing'
from /Users/houen/.rvm/gems/ruby-1.9.2-p180/gems/carrierwave-0.5.5/lib/carrierwave/uploader/cache.rb:73:in `cache_stored_file!'
from /Users/houen/.rvm/gems/ruby-1.9.2-p180/gems/carrierwave-0.5.5/lib/carrierwave/uploader/versions.rb:174:in `recreate_versions!'
from (irb):2
@houen
houen / Gemfile
Created March 24, 2012 23:41
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
level: {
workout_id: 42,
number: 2,
session_plans: [
{
phase: 'strength',
position: 1
exercises: {
[
{
{
"level": {
"number": 1,
"workout_id": "TODO",
"session_plans": [
{
"phase": {
"table": {
"number": 1,
"key": "STABILITY"
How about this as a format for session_plan (written in Pseudo-JSON)
session_plan:
session_plan_exercises:
[
{
number_in_set: int
position: int
station: Station (if locked to one)
exercise: Exercise (no adjustments)
session_plan:
id: int
level_id: int
phase_number: int
phase: string
position: int
session_plan_exercises:
[
{
id: int