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
def approval_by(role) | |
singleton_class_with_workflow = class << self | |
approval = self.class.approval_transitions_for[role] | |
workflow do | |
(approval || []).each do |state_name, events| | |
state state_name do | |
events.each do |event_name| | |
event event_name, transitions_to: EVENT_RESULTS[event_name] | |
end | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<application> | |
<title> | |
<text xml:lang="de"><![CDATA[]]></text> | |
<text xml:lang="en"><![CDATA[]]></text> | |
<text xml:lang="fr"><![CDATA[]]></text> | |
</title> | |
<picture> | |
<uri xml:lang="de">file://example1.jpg</uri> | |
<uri xml:lang="en">file://example2.jpg</uri> |
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
require 'mongo_mapper' | |
MongoMapper.database = 'testing' | |
require 'tire' | |
class Thing | |
include MongoMapper::Document | |
include Tire::Model::Search | |
include Tire::Model::Callbacks | |
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
1.9.3p0 :001 > "10FFFF".to_i 16 | |
=> 0 | |
1.9.3p0 :002 > exit | |
bogn@Mojito:~$ irb | |
1.9.3p0 :001 > "10FFFF".to_i(16) | |
=> 1114111 | |
1.9.3p0 :002 > "10FFFF".to_i 16 | |
=> 1114111 | |
und noch mal mit p194 | |
1.9.3p194 :001 > "10FFFF".to_i 16 |
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
$ gem install plist4r --verbose --backtrace --debug | |
Exception `NameError' at /home/bogn/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand | |
Exception `Gem::LoadError' at /home/bogn/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247 - Could not find psych (>= 1.2.1, ~> 1.2) amongst [RedCloth-4.2.7, aaronh-chronic-0.3.9, abstract-1.0.0, actionmailer-3.0.9, actionmailer-3.0.7, actionmailer-3.0.5, actionmailer-3.0.4, actionmailer-3.0.3, actionmailer-2.3.2, actionmailer-2.1.0, actionmailer-1.3.3, actionpack-3.0.9, actionpack-3.0.7, actionpack-3.0.5, actionpack-3.0.4, actionpack-3.0.3, actionpack-3.0.0.beta3, actionpack-2.3.2, actionpack-2.1.0, actionpack-1.13.3, actionwebservice-1.2.3, activemodel-3.0.10, activemodel-3.0.9, activemodel-3.0.7, activemodel-3.0.6, activemodel-3.0.5, activemodel-3.0.4, activemodel-3.0.3, activemodel-3.0.0.beta3, activerecord-3.0.9, activerecord-3.0.7, activerecord-3.0.5 |
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 Page | |
include MongoMapper::Document | |
end | |
class ContentPage < Page | |
many :content_blocks #tried :as => :page as well | |
end | |
class ContentBlock | |
include MongoMapper::EmbeddedDocument |
NewerOlder