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 User < ActiveRecord::Base | |
belongs_to :roleable, :polymorphic => true | |
end |
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 CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :first_name | |
t.string :last_name | |
t.integer :age | |
t.timestamps | |
end | |
end |
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
INSERT INTO `users` (`age`, `created_at`, `first_name`, `last_name`, `updated_at`) | |
VALUES (32, '2010-09-24 08:10:32', 'Juan', 'Perez', '2010-09-24 08:10:32') |
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
# | |
# Script builded to ruby 1.9.1 | |
# | |
require 'CSV' | |
class ArrayIterator | |
# | |
# Class ArrayIterator | |
# Implementation of Iterator pattern | |
# |
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
$options['joins'] = array( | |
array('table' => 'books_tags', | |
'alias' => 'BooksTag', | |
'type' => 'inner', | |
'conditions' => array( | |
'Books.id = BooksTag.books_id' )), | |
array('table' => 'tags', | |
'alias' => 'Tag', | |
'type' => 'inner', |
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
@products.each_with_index do |p, i| | |
p.update_attributes(:date_available => i.minutes.ago) | |
end |
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
window.Representante = Backbone.Model.extend({}) |
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
window.Variant = Backbone.Model.extend({ | |
url: function() { | |
if (this.id != null) { | |
return 'variants/' + this.id; | |
} else { | |
return 'variants'; | |
} | |
}, | |
addToCart: function() { | |
return alert('I was added to cart ' + this.id); |
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 ApplicationController < ActionController::Base | |
helper_method :omniture_common_params, :set_omniture_cookie | |
def omniture_common_params(omniture_data_objs) | |
omniture_data_arr = [omniture_data_objs].flatten.compact | |
# Set the omniture LOGIN | |
if params[:logged] || session['omn_fire_registration_success'] | |
omniture_data_arr.insert(0, Omniture.generate_params(:login_success, params)) |
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 ApplicationController < ActionController::Base | |
include Omniture::Helper | |
end |
OlderNewer