This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile < ActiveRecord::Base | |
belongs_to :user | |
has_many :collections | |
attr_accessible :avatar, :name, :title, :description | |
validates :name, presence: true, length: { minimum: 1, maximum: 60 } | |
validates :description, presence: true, length: { minimum: 1, maximum: 60 } | |
validates :title, presence: true, length: { minimum: 1, maximum: 60 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project < ActiveRecord::Base | |
belongs_to :collection | |
has_many :items | |
attr_accessible :name, :description, :links | |
attr_accessor :image | |
serialize :links | |
validates :name, uniqueness: { scope: :collection_id }, length: {minimum: 1, maximum: 20}, allow_blank: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Collection < ActiveRecord::Base | |
belongs_to :profile | |
has_many :projects | |
has_one :thumbnail, class_name: "item", as: :thumbnailable | |
attr_accessible :name, :description | |
attr_accessor :image | |
validates :name, uniqueness: { scope: :profile_id }, length: { minimum: 1, maximum: 100 }, allow_blank: false | |
validates :description, length: { minimum: 5, maximum: 1000 }, allow_blank: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Creating Items User can create an item | |
Failure/Error: click_button "Create Item" | |
Capybara::ElementNotFound: | |
Unable to find id 1 | |
# ./app/controllers/items_controller.rb:55:in `find_collection' | |
# ./spec/integration/item_create_spec.rb:22:in `block (2 levels) in <top (required)>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html | |
%head | |
%title Flip | |
= stylesheet_link_tag "application", :media => "all" | |
= javascript_include_tag "application" | |
= csrf_meta_tags | |
%body | |
.container | |
.row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ul.thumbnails | |
- gallery.each do |gallery_item| | |
%li{ class: "span8", id: "#{new_sibling}_#{gallery_item.id}" } | |
- if gallery_item.image | |
- gal_background = "background-image: url(#{gallery_item.image.url(:gallery)})" | |
- else | |
- gal_background = "background-image: url('/assets/empty.jpg')" | |
%div{ style: gal_background , class: "cutter thumbnail" } | |
%h1 | |
= link_to gallery_item.name, [parent, gallery_item] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% heroku run rake db:migrate | |
Running `rake db:migrate` attached to terminal... up, run.3374 | |
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7) | |
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7) | |
Connecting to database specified by DATABASE_URL | |
Migrating to DeviseCreateUsers (20130 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[15] pry(main)> Site | |
=> Site(Table doesn't exist) | |
[16] pry(main)> ActiveRecord::Base.connection.tables | |
=> ["schema_migrations", "site"] | |
Error: | |
PG::Error: ERROR: relation "sites" does not exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tweetstream' | |
require 'pry' | |
require 'pry-debugger' | |
# TweetStream.configure do |config| | |
# config.consumer_key = 'abcdefghijklmnopqrstuvwxyz' | |
# config.consumer_secret = '0123456789' | |
# config.oauth_token = 'abcdefghijklmnopqrstuvwxyz' | |
# config.oauth_token_secret = '0123456789' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class Api::Beta::UsersControllerTest < ActionController::TestCase | |
def setup | |
for i in 1..100 do | |
FactoryGirl.create(:user) | |
end | |
@user = FactoryGirl.create(:user) | |
end |
OlderNewer