Module: ActsAsFu
- Defined in:
- lib/acts_as_fu.rb,
lib/acts_as_fu/helper.rb
Constant Summary collapse
- VERSION =
'0.0.2'
Class Attribute Summary collapse
-
.log ⇒ Object
readonly
Returns the value of attribute log.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.log ⇒ Object (readonly)
Returns the value of attribute log.
3 4 5 |
# File 'lib/acts_as_fu/helper.rb', line 3 def log @log end |
Class Method Details
.connect!(config = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/acts_as_fu/helper.rb', line 5 def connect!(config={}) @log = "" ActiveRecord::Base.logger = Logger.new(StringIO.new(log)) ActiveRecord::Base.establish_connection(config) end |
Instance Method Details
#build_model(name, options = {}, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/acts_as_fu/helper.rb', line 12 def build_model(name, ={}, &block) connect! super_class = [:superclass] || begin ActiveRecord::Base.connection.create_table(name, :force => true) { } ActiveRecord::Base end set_class!(name, super_class, &block) end |