code
stringlengths
1
1.73M
language
stringclasses
1 value
# include the utils rb file which has extra functionality for the ext theme dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'utils.rb') # register ext4 as a compass framework Compass::Frameworks.register 'ext4', dir
Ruby
# $ext_path: This should be the path of the Ext JS SDK relative to this file $ext_path = "../../extjs" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resources/sass folder # <root>/resources/sass sass_path = File.dirname(__FILE__) # css_pat...
Ruby
# Compass configurations sass_path = File.dirname(__FILE__) css_path = File.join(sass_path, "..", "css") # Require any additional compass plugins here. images_dir = File.join(sass_path, "..", "img") output_style = :expanded environment = :production
Ruby
module ExtJS4 module SassExtensions module Functions module Utils def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must...
Ruby
# # setup.rb # # Copyright (c) 2000-2005 Minero Aoki # # This program is free software. # You can distribute/modify this program under the terms of # the GNU LGPL, Lesser General Public License version 2.1. # unless Enumerable.method_defined?(:map) # Ruby 1.4.6 module Enumerable alias map collect end end un...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
load File.dirname(__FILE__) + '/Rakefile' gem_spec
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
module Xbrlware module Taxonomies module IFRS20090401 # :nodoc: def AccountingProfit return {"xbrli:balance" => "credit","name" => "AccountingProfit","nillable" => "true","xbrli:periodType" => "duration","id" => "ifrs_AccountingProfit","substitutionGroup" => "xbrli:item","info:creationID" => "i200806241028411001"...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
# This patch is to fix a bug in Ruby 1.8.x CGI::unescapeHTML # Till we upgrade to Ruby 1.9, we will use this patch. Ruby 1.9 handles it properly. # Other alternative is using htmlentities - http://htmlentities.rubyforge.org/ # # Bug explanation, # CGI::unescapeHTML("Equity in Earnings&#160;of") returns "Equity in Earni...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
# namespace aware module NSAware # namespace and namespace prefix attr_accessor :ns, :nsp end
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
#!/usr/bin/ruby # # Author:: xbrlware@bitstat.com # # Copyright:: 2009, 2010 bitstat (http://www.bitstat.com). All Rights Reserved. # # License:: Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
Ruby
require 'rubygems' # you need this when xbrlware is installed as gem require 'edgar' require 'xbrlware' dl=Edgar::HTMLFeedDownloader.new() url="http://www.sec.gov/Archives/edgar/data/843006/000135448809002030/0001354488-09-002030-index.htm" download_dir=url.split("/")[-2] # download dir is : 000135448809002030 dl.dow...
Ruby
require 'rubygems' # you need this when xbrlware is installed as gem require 'xbrlware' instance_file="c-20091230.xml" instance = Xbrlware.ins(instance_file) # Create parser instance item_name="NetIncomeLoss" # This is the item we are interested in. net_incomes = instance.item(item_name) # Extracts "NetIncomeLoss" i...
Ruby
require 'edgar' require 'xbrlware' d=Edgar::HTMLFeedDownloader.new url="http://www.sec.gov/Archives/edgar/data/1281761/000119312510036446/0001193125-10-036446-index.htm" download_dir=url.split("/")[-2] # download dir is : 000119312510036446 d.download(url, download_dir) ins=Xbrlware.ins(Xbrlware.file_grep(download_di...
Ruby
require 'xbrlware' r=Xbrlware::Report.new class << r public :xbrl_files end files=r.xbrl_files("../../../xbrlware-wiki/sample_reports/edgar_data") output = StringIO.new output << "|| *Instance + Taxonomy file size (KB)* || *Time (Seconds)* ||" output << "\n" files.each do |file_map| m=Benchmark.measure do in...
Ruby
require 'xbrlware' ## Assuming you have table "calculations" with below structure # id # element_name # element_value # element_label # period_start_date # period_end_date # parent_id def format_timeline(timeline) ## date format function return Xbrlware::DateUtil.stringify_date(timeline.value) unless timeline.is_du...
Ruby
require 'xbrlware' def format_timeline(timeline) ## date format function return Xbrlware::DateUtil.stringify_date(timeline.value) unless timeline.is_duration? header = StringIO.new header << Xbrlware::DateUtil.stringify_date(timeline.value["end_date"]) << " : " header << Xbrlware::DateUtil.months_between(timel...
Ruby
require 'rubygems' # you need this when xbrlware is installed as gem require 'xbrlware' instance=Xbrlware.ins("foo.xml") items=instance.item("ProfitLoss") puts "Profit-Loss \t Context" items.each do |item| puts item.value+" \t "+item.context.id end
Ruby
require 'rubygems' # you need this when xbrlware is installed as gem require 'edgar' require 'xbrlware' dl=Edgar::HTMLFeedDownloader.new() url="http://www.sec.gov/Archives/edgar/data/843006/000135448809002030/0001354488-09-002030-index.htm" download_dir=url.split("/")[-2] # download dir is : 000135448809002030 dl.dow...
Ruby
$:.push('gen-rb') require 'thrift' require 'thrift/transport/server_socket' require 'thrift/transport/buffered_transport' require 'thrift/server/simple_server' require 'rating' require 'rating-impl' # Thrift provides mutiple communication endpoints # - Here we will expose our service via a TCP socket # - Web-serv...
Ruby
# provide an implementation of Rating service class RatingImpl def piotroski(entity_name) # Code that use xbrlware goes here return 1 # return some dummy value end def altman_z(entity_name) # Code that use xbrlware goes here return 2.2567 # return some dummy value end end
Ruby
java_import javax.xml.XMLConstants java_import javax.xml.parsers.DocumentBuilder java_import javax.xml.parsers.DocumentBuilderFactory java_import javax.xml.transform.Source java_import javax.xml.transform.dom.DOMSource java_import javax.xml.transform.stream.StreamSource java_import javax.xml.validation.Schema java_impo...
Ruby
module XbrlTest class SchemaValidator def self.validate (xml_file, xsd_file) return end end end
Ruby
def first(name, &block) block = lambda{ puts "lambda"} if block.nil? second &block end def second(&block) yield end first("blk") { puts "Hello"} first("blk") def dummy(count, snipet=StringIO.new, &block) return snipet.string if count > 5 yield snipet count += 1 dummy(count, snipet, &block) end dummy(...
Ruby
module LinkbaseTestUtil def print_arc(arcs, indent=0) arcs.each do |arc| if arc.items.nil? || arc.items.size==0 puts " " * indent * 2 + arc.item_id + "[" + (arc.label if arc.respond_to?(:label)).to_s+"][role "+arc.role.to_s+"][order "+arc.order.to_s+"] = None .. ctx undefined.." else ...
Ruby
require 'test/unit' require 'xbrlware' require 'edgar' require 'tmpdir' begin require 'java' require File.dirname(__FILE__) + '/schema_validator_jruby' rescue Exception ENV["SCHEMA_VALIDATION"]="False" require File.dirname(__FILE__) + '/schema_validator_ruby' end $LOG.level = Logger::INFO
Ruby
#!/usr/bin/env ruby # # Tool to translate limited-dialect Java 1.5 into limited-dialect C# 2.0. # # THIS IS A BIG STONKING HACK, AND NOT INTENDED AS A GENERAL-PURPOSE TRANSLATOR. # require 'ftools' # scan a directory tree recursively, translating Java source and copying resources as we go def scan_dir(from_dir, ...
Ruby
#!/usr/bin/env ruby # # Tool to translate limited-dialect Java 1.5 into limited-dialect C# 2.0. # # THIS IS A BIG STONKING HACK, AND NOT INTENDED AS A GENERAL-PURPOSE TRANSLATOR. # require 'ftools' # scan a directory tree recursively, translating Java source and copying resources as we go def scan_dir(from_dir, ...
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' class Test::Unit::TestCase # Transactional fixtures accelerate your tests by wrapping each test method # in a transaction that's rolled back on completion. This ensures that the # test datab...
Ruby
#!D:/Develop/ruby/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely ...
Ruby
#!D:/Develop/ruby/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.cra...
Ruby
#!D:/Develop/ruby/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely ...
Ruby
#!D:/Develop/ruby/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely ...
Ruby
#!D:/Develop/ruby/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.cra...
Ruby
#!D:/Develop/ruby/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely ...
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/breakpointer'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/about'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/server'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/generate'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/plugin'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/breakpointer'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/console'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/about'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/server'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/console'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/plugin'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/spawner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/spawner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/inspector'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/reaper'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/reaper'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/inspector'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/benchmarker'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/profiler'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/benchmarker'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/profiler'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/generate'
Ruby
# Methods added to this helper will be available to all templates in the application. module ApplicationHelper end
Ruby
# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_xeefun_ses...
Ruby
ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. # Sample of regular route: # map.connect 'products/:id', :controller => 'catalog', :action => 'view' # Keep in mind you can assign values other than :controller and :action # ...
Ruby
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb unless defined?(RAILS_ROOT) root_path = File.join(File.dirname(__FILE__), '..') unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ require 'pathname' root_path = Pathname.new(root_path).cleanpath(true).to_s end ...
Ruby
# Be sure to restart your web server when you modify this file. # Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION ...
Ruby
# Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Full error repor...
Ruby
# Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the webserver when you make code changes. config.ca...
Ruby
# Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between...
Ruby
# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'tasks/rails'
Ruby
class CreateCategoriesCarts < ActiveRecord::Migration def self.up create_table :category_product_links do |t| t.column :product_id, :integer t.column :category_id, :integer end create_table :categories do |t| t.column :title, :string t.column :description, :text t.column :pos...
Ruby
class AddPaymentTermsToOrder < ActiveRecord::Migration def self.up add_column :orders, :payment_term_id, :integer end def self.down remove_column :orders, :payment_term_id end end
Ruby
class AddOrderSource < ActiveRecord::Migration def self.up add_column :orders, :source_id, :integer end def self.down remove_column :orders, :source_id end end
Ruby
class AddShippingMethods < ActiveRecord::Migration def self.up create_table "shipping_methods", :force => true do |t| t.string :name, :limit => 50 t.boolean :ups_code, :limit => 10 t.boolean :office_calculated, :default => false t.timestamps end ShippingMeth...
Ruby
class AddAgents < ActiveRecord::Migration def self.up create_table :representations do |r| r.column :customer_id, :integer r.column :agent_id, :integer r.column :created_at, :datetime end add_column :customers, :type, :string end def self.down drop_table :representation remove_column :...
Ruby
class AddNotesToCustomer < ActiveRecord::Migration def self.up add_column :customers, :notes, :text end def self.down remove_column :customers, :notes end end
Ruby
class AddBillingCountryId < ActiveRecord::Migration def self.up add_column :orders, :billing_country_id, :integer end def self.down remove_column :orders, :billing_country_id end end
Ruby
class CreateDiscountTables < ActiveRecord::Migration def self.up create_table :discount_tables do |t| t.column "qty", :integer t.column "discount_applied", :float t.column "discount_id", :integer end end def self.down drop_table :discount_tables end end
Ruby