Skip to content

Instantly share code, notes, and snippets.

View tpendragon's full-sized avatar

Trey Pendragon tpendragon

  • Princeton University Library
  • Salem, OR
View GitHub Profile
class Carnivore < Player
before_save :set_lvl
def initialize(attributes = {})
super
self.xp = 0
self.max_xp = 50
self.hp = 5
self.max_hp = 5
self.ap = 3
## I need to have a Group that can consist of Users and/or Companies
class User
has_many :relationships
has_many :companies, :through => :relationships
has_many :groups, :as => :groupable
end
class Relationships
belongs_to :user
class DellInfo extends \SoapClient {
//const ADDR = 'http://xserv.dell.com/services/assetservice.asmx?WSDL';
const ADDR = 'http://143.166.84.118/services/assetservice.asmx?WSDL';
const GUID = 'F5EE89B0-5332-11E1-B47D-8E584824019B';
function __construct($options = array()) {
if (!isset($options['exceptions'])) {
$options['exceptions'] = false;
}
<%= form_tag products_path, method: :get do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", title: nil %>
</p>
<% end %>
def content
translatedContent = self[:content]
if(!self.has_translation?(I18n.locale) && self.has_translation?(self.parent_translation(I18n.locale)))
translatedContent = self.translation_for(self.parent_translation(I18n.locale)).content
end
translatedContent
end