This file contains hidden or 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
| plan = '50UserTier' | |
| without_stripe = Company.all.select { |company| company.stripe_rel.nil? } | |
| without_stripe.each { |company| company.create_stripe_relationship plan } |
This file contains hidden or 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 CreateKeyVals < ActiveRecord::Migration | |
| def change | |
| create_table :key_vals do |t| | |
| t.string :key | |
| t.text :value | |
| t.string :value_type | |
| t.timestamps | |
| end | |
| add_index :key_vals, :key, unique: true | |
| end |
This file contains hidden or 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 WebViewController < UIViewController | |
| def viewDidLoad | |
| super | |
| @url = NSURL.URLWithString("<redacted>") | |
| request = NSURLRequest.requestWithURL(@url) | |
| connection = NSURLConnection.connectionWithRequest(request, delegate: self) | |
| self.view = UIWebView.alloc.init |
This file contains hidden or 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
| {"card":{"subject":"some subject","contents":"longer content to be practiced"}} |
This file contains hidden or 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 Card < ActiveRecord::Base | |
| attr_accessible :reference, :scripture, :subject | |
| validates :scripture, presence: true, length: { minimum: 20 } | |
| validate :at_least_one_subject_or_reference | |
| def self.updated_since(time) | |
| if time | |
| Card.where("updated_at >= ?", time) | |
| else |